org.openbp.swing.plaf.sky
Class SkyTableUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TableUI
          extended by javax.swing.plaf.basic.BasicTableUI
              extended by org.openbp.swing.plaf.sky.SkyTableUI

public class SkyTableUI
extends javax.swing.plaf.basic.BasicTableUI

PLAF for a JTable component We override this class just in order to prevent some NPEs that happen occasionally in JTreeTable components (absolutely no idea why, but, well, this JTable/JTree stuff is absolutely horrible, so no wonder that the JTreeTable does not always what it should). All the code below is copied from the BasicTableUI class (which uses private methods, so there is no other way). We just added the try/catch(Exception) in the paintCell method.

Author:
Heiko Erhardt

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTableUI
javax.swing.plaf.basic.BasicTableUI.FocusHandler, javax.swing.plaf.basic.BasicTableUI.KeyHandler, javax.swing.plaf.basic.BasicTableUI.MouseInputHandler
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicTableUI
focusListener, keyListener, mouseInputListener, rendererPane, table
 
Constructor Summary
SkyTableUI()
          Default constructor.
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Creates a new instance of this ui.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paint a representation of the table instance that was set in installUI().
 
Methods inherited from class javax.swing.plaf.basic.BasicTableUI
createFocusListener, createKeyListener, createMouseInputListener, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installDefaults, installKeyboardActions, installListeners, installUI, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkyTableUI

public SkyTableUI()
Default constructor.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Creates a new instance of this ui.

Parameters:
c - Component to create this ui for
Returns:
The new ui instance

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Paint a representation of the table instance that was set in installUI().

Overrides:
paint in class javax.swing.plaf.basic.BasicTableUI


Copyright © 2011. All Rights Reserved.