javax.swing.plaf.basic
Class BasicTableHeaderUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TableHeaderUI
          extended by javax.swing.plaf.basic.BasicTableHeaderUI

public class BasicTableHeaderUI
extends TableHeaderUI

Basic pluggable look and feel interface for JTableHeader.


Nested Class Summary
 class BasicTableHeaderUI.MouseInputHandler
          Handles column movement and rearrangement by mouse.
 
Field Summary
protected  JTableHeader header
          The table header that is using this interface.
protected  MouseInputListener mouseInputListener
          The mouse input listener, responsible for mouse manipulations with the table header.
protected  CellRendererPane rendererPane
          Paint the header cell.
 
Constructor Summary
BasicTableHeaderUI()
          Construct a new BasicTableHeaderUI, create mouse listeners.
 
Method Summary
protected  MouseInputListener createMouseInputListener()
          Create and return the mouse input listener.
static ComponentUI createUI(JComponent h)
           
 Dimension getPreferredSize(JComponent ignored)
          Get the preferred header size.
protected  void installDefaults()
           
protected  void installKeyboardActions()
           
protected  void installListeners()
          Add the mouse listener and the mouse motion listener to the table header.
 void installUI(JComponent c)
          Sets up the specified component so it conforms the the design guidelines of the implemented look and feel.
 void paint(Graphics gfx, JComponent c)
          Repaint the table header.
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
           
protected  void uninstallListeners()
          Remove the previously installed listeners.
 void uninstallUI(JComponent c)
          Puts the specified component into the state it had before ComponentUI.installUI(javax.swing.JComponent) was called.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

header

protected JTableHeader header
The table header that is using this interface.


mouseInputListener

protected MouseInputListener mouseInputListener
The mouse input listener, responsible for mouse manipulations with the table header.


rendererPane

protected CellRendererPane rendererPane
Paint the header cell.

Constructor Detail

BasicTableHeaderUI

public BasicTableHeaderUI()
Construct a new BasicTableHeaderUI, create mouse listeners.

Method Detail

createUI

public static ComponentUI createUI(JComponent h)

createMouseInputListener

protected MouseInputListener createMouseInputListener()
Create and return the mouse input listener.

Returns:
the mouse listener (BasicTableHeaderUI.MouseInputHandler, if not overridden.

installDefaults

protected void installDefaults()

installKeyboardActions

protected void installKeyboardActions()

installListeners

protected void installListeners()
Add the mouse listener and the mouse motion listener to the table header. The listeners support table column resizing and rearrangement by mouse.


installUI

public void installUI(JComponent c)
Description copied from class: ComponentUI
Sets up the specified component so it conforms the the design guidelines of the implemented look and feel. When the look and feel changes, a ComponentUI delegate is created. The delegate object then receives an installUI message.

This method should perform the following tasks:

Overrides:
installUI in class ComponentUI
Parameters:
c - the component for which this delegate will provide services.
See Also:
ComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

uninstallDefaults

protected void uninstallDefaults()

uninstallKeyboardActions

protected void uninstallKeyboardActions()

uninstallListeners

protected void uninstallListeners()
Remove the previously installed listeners.


uninstallUI

public void uninstallUI(JComponent c)
Description copied from class: ComponentUI
Puts the specified component into the state it had before ComponentUI.installUI(javax.swing.JComponent) was called.

Overrides:
uninstallUI in class ComponentUI
Parameters:
c - the component for which this delegate has provided services.
See Also:
ComponentUI.installUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

paint

public void paint(Graphics gfx,
                  JComponent c)
Repaint the table header.

Overrides:
paint in class ComponentUI
Parameters:
gfx - the graphics for painting.
c - the component for which this delegate performs services.

getPreferredSize

public Dimension getPreferredSize(JComponent ignored)
Get the preferred header size.

Overrides:
getPreferredSize in class ComponentUI
Parameters:
ignored - unused
Returns:
the preferred size of the associated header.