APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.synth

public Class SynthTableHeaderUI

extends BasicTableHeaderUI
implements PropertyChangeListener, SynthUI
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.synth.SynthUI, javax.swing.plaf.synth.SynthConstants, java.beans.PropertyChangeListener, java.util.EventListener
Imports
java.awt.Component, .Graphics, java.beans.PropertyChangeEvent, .PropertyChangeListener, javax.swing.JComponent, .JLabel, .JTable, .RowSorter, javax.swing.border.Border, javax.swing.plaf.ComponentUI, .UIResource, javax.swing.plaf.basic.BasicTableHeaderUI, javax.swing.table.JTableHeader, .TableCellRenderer, sun.swing.table.DefaultTableCellHeaderRenderer

Provides the Synth L&F UI delegate for javax.swing.table.JTableHeader.
Authors
Alan Chung, Philip Milne
Since
1.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
SynthTableHeaderUI.HeaderRenderer

The DefaultTableCellHeaderRenderer installed by the UI.

Field Summary

Modifier and TypeField and Description
private TableCellRenderer
private SynthStyle
Inherited from javax.swing.plaf.basic.BasicTableHeaderUI:
headermouseInputListenerrendererPane

Constructor Summary

AccessConstructor and Description
public
SynthTableHeaderUI()

Constructs a SynthTableHeaderUI.

Method Summary

Modifier and TypeMethod and Description
public static ComponentUI

Returns:

the UI object
createUI
(JComponent
component to create UI object for
h
)

Hides javax.swing.plaf.basic.BasicTableHeaderUI.createUI.

Creates a new UI object for the given component.

public SynthContext
getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

private SynthContext
getContext(JComponent c, int state)

protected void
installDefaults()

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.installDefaults.

Initializes JTableHeader properties such as font, foreground, and background.

protected void
installListeners()

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.installListeners.

Attaches listeners to the JTableHeader.

public void
paint(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.paint.

Paints the specified component according to the Look and Feel.

protected void
paint(SynthContext
context for the component being painted
context
,
Graphics
the Graphics object used for painting
g
)

Paints the specified component.

public void
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

public void
propertyChange(PropertyChangeEvent evt)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

protected void
rolloverColumnUpdated(int oldColumn, int newColumn)

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.rolloverColumnUpdated.

This method gets called every time when a rollover column in the table header is updated.

protected void
protected void
public void
update(Graphics
the Graphics object used for painting
g
,
JComponent
the component being painted
c
)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component.

private void
Inherited from javax.swing.plaf.basic.BasicTableHeaderUI:
createMouseInputListenergetBaselinegetMaximumSizegetMinimumSizegetPreferredSizegetRolloverColumninstallKeyboardActionsinstallUIuninstallKeyboardActionsuninstallUI

Field Detail

prevRendererback to summary
private TableCellRenderer prevRenderer
styleback to summary
private SynthStyle style

Constructor Detail

SynthTableHeaderUIback to summary
public SynthTableHeaderUI()

Constructs a SynthTableHeaderUI.

Method Detail

createUIback to summary
public static ComponentUI createUI(JComponent h)

Hides javax.swing.plaf.basic.BasicTableHeaderUI.createUI.

Creates a new UI object for the given component.

Parameters
h:JComponent

component to create UI object for

Returns:ComponentUI

the UI object

getContextback to summary
public SynthContext getContext(JComponent c)

Implements javax.swing.plaf.synth.SynthUI.getContext.

Doc from javax.swing.plaf.synth.SynthUI.getContext.

Returns the Context for the specified component.

Annotations
@Override
getContextback to summary
private SynthContext getContext(JComponent c, int state)
installDefaultsback to summary
protected void installDefaults()

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.installDefaults.

Doc from javax.swing.plaf.basic.BasicTableHeaderUI.installDefaults.

Initializes JTableHeader properties such as font, foreground, and background. The font, foreground, and background properties are only set if their current value is either null or a UIResource, other properties are set if the current value is null.

Annotations
@Override
installListenersback to summary
protected void installListeners()

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.installListeners.

Doc from javax.swing.plaf.basic.BasicTableHeaderUI.installListeners.

Attaches listeners to the JTableHeader.

Annotations
@Override
paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.paint.

Paints the specified component according to the Look and Feel.

This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext, Graphics) method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
paintback to summary
protected void paint(SynthContext context, Graphics g)

Paints the specified component.

Parameters
context:SynthContext

context for the component being painted

g:Graphics

the Graphics object used for painting

See Also
update(Graphics, JComponent)
paintBorderback to summary
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthUI.paintBorder.

Doc from javax.swing.plaf.synth.SynthUI.paintBorder.

Paints the border.

Annotations
@Override
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent evt)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Annotations
@Override
rolloverColumnUpdatedback to summary
protected void rolloverColumnUpdated(int oldColumn, int newColumn)

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.rolloverColumnUpdated.

Doc from javax.swing.plaf.basic.BasicTableHeaderUI.rolloverColumnUpdated.

This method gets called every time when a rollover column in the table header is updated. Every look and feel that supports a rollover effect in a table header should override this method and repaint the header.

Annotations
@Override
uninstallDefaultsback to summary
protected void uninstallDefaults()

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.uninstallDefaults.

Doc from javax.swing.plaf.basic.BasicTableHeaderUI.uninstallDefaults.

Uninstalls default properties

Annotations
@Override
uninstallListenersback to summary
protected void uninstallListeners()

Overrides javax.swing.plaf.basic.BasicTableHeaderUI.uninstallListeners.

Doc from javax.swing.plaf.basic.BasicTableHeaderUI.uninstallListeners.

Unregisters listeners.

Annotations
@Override
updateback to summary
public void update(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.update.

Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls the paint(SynthContext, Graphics) method.

In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.

Parameters
g:Graphics

the Graphics object used for painting

c:JComponent

the component being painted

Annotations
@Override
See Also
paint(SynthContext, Graphics)
updateStyleback to summary
private void updateStyle(JTableHeader c)
javax.swing.plaf.synth back to summary

private Class SynthTableHeaderUI.HeaderRenderer

extends DefaultTableCellHeaderRenderer
Class Inheritance
Annotations
@SuppressWarnings:serial

The DefaultTableCellHeaderRenderer installed by the UI.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Component
getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)

Overrides sun.swing.table.DefaultTableCellHeaderRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

public void
setBorder(Border border)

Overrides javax.swing.JComponent.setBorder.

Sets the border of this component.

Inherited from sun.swing.table.DefaultTableCellHeaderRenderer:
getColumnSortOrderpaintComponentsetHorizontalTextPosition

Constructor Detail

HeaderRendererback to summary
pack-priv HeaderRenderer()

Method Detail

getTableCellRendererComponentback to summary
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)

Overrides sun.swing.table.DefaultTableCellHeaderRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Doc from javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

During a printing operation, this method will be called with isSelected and hasFocus values of false to prevent selection and focus from appearing in the printed output. To do other customization based on whether or not the table is being printed, check the return value from javax.swing.JComponent#isPaintingForPrint().

Annotations
@Override
setBorderback to summary
public void setBorder(Border border)

Overrides javax.swing.JComponent.setBorder.

Doc from javax.swing.JComponent.setBorder.

Sets the border of this component. The Border object is responsible for defining the insets for the component (overriding any insets set directly on the component) and for optionally rendering any border decorations within the bounds of those insets. Borders should be used (rather than insets) for creating both decorative and non-decorative (such as margins and padding) regions for a swing component. Compound borders can be used to nest multiple borders within a single component.

Although technically you can set the border on any object that inherits from JComponent, the look and feel implementation of many standard Swing components doesn't work well with user-set borders. In general, when you want to set a border on a standard Swing component other than JPanel or JLabel, we recommend that you put the component in a JPanel and set the border on the JPanel.

This is a bound property.

Annotations
@Override