APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.swing.table

public Class DefaultTableCellHeaderRenderer

extends DefaultTableCellRenderer
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Known Direct Subclasses
javax.swing.plaf.synth.SynthTableHeaderUI.HeaderRenderer
Annotations
@SuppressWarnings:serial
Imports
sun.swing.DefaultLookup, java.awt.Component, .Color, .FontMetrics, .Graphics, .Insets, .Point, .Rectangle, java.io.Serializable, javax.swing.*, javax.swing.plaf.UIResource, javax.swing.border.Border, javax.swing.table.*

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private DefaultTableCellHeaderRenderer.EmptyIcon
private boolean
private Icon
Inherited from javax.swing.table.DefaultTableCellRenderer:
noFocusBorder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Point
public static SortOrder
getColumnSortOrder(JTable table, int column)

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

Overrides javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent.

Implements javax.swing.table.TableCellRenderer.getTableCellRendererComponent.

Returns the default table cell renderer.

public void
paintComponent(Graphics g)

Overrides javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null.

public void
setHorizontalTextPosition(int textPosition)

Overrides javax.swing.JLabel.setHorizontalTextPosition.

Sets the horizontal position of the label's text, relative to its image.

Inherited from javax.swing.table.DefaultTableCellRenderer:
firePropertyChangefirePropertyChangeinvalidateisOpaquerepaintrepaintrepaintrevalidatesetBackgroundsetForegroundsetValueupdateUIvalidate

Field Detail

emptyIconback to summary
private DefaultTableCellHeaderRenderer.EmptyIcon emptyIcon
horizontalTextPositionSetback to summary
private boolean horizontalTextPositionSet
sortArrowback to summary
private Icon sortArrow

Constructor Detail

DefaultTableCellHeaderRendererback to summary
public DefaultTableCellHeaderRenderer()

Method Detail

computeIconPositionback to summary
private Point computeIconPosition(Graphics g)
getColumnSortOrderback to summary
public static SortOrder getColumnSortOrder(JTable table, int column)
getTableCellRendererComponentback to summary
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)

Overrides javax.swing.table.DefaultTableCellRenderer.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().

paintComponentback to summary
public void paintComponent(Graphics g)

Overrides javax.swing.JComponent.paintComponent.

Doc from javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoke super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in an opaque color. If you do not honor the opaque property you will likely see visual artifacts.

The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.

Annotations
@Override
setHorizontalTextPositionback to summary
public void setHorizontalTextPosition(int textPosition)

Overrides javax.swing.JLabel.setHorizontalTextPosition.

Doc from javax.swing.JLabel.setHorizontalTextPosition.

Sets the horizontal position of the label's text, relative to its image.

sun.swing.table back to summary

private Class DefaultTableCellHeaderRenderer.EmptyIcon

extends Object
implements Icon, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.swing.Icon
Annotations
@SuppressWarnings:serial

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Returns the icon's height.

public int
getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Returns the icon's width.

public void
paintIcon(Component c, Graphics g, int x, int y)

Implements javax.swing.Icon.paintIcon.

Draw the icon at the specified location.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

heightback to summary
pack-priv int height
widthback to summary
pack-priv int width

Constructor Detail

EmptyIconback to summary
private EmptyIcon()

Method Detail

getIconHeightback to summary
public int getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Doc from javax.swing.Icon.getIconHeight.

Returns the icon's height.

getIconWidthback to summary
public int getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Doc from javax.swing.Icon.getIconWidth.

Returns the icon's width.

paintIconback to summary
public void paintIcon(Component c, Graphics g, int x, int y)

Implements javax.swing.Icon.paintIcon.

Doc from javax.swing.Icon.paintIcon.

Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.