|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
javax.swing.table.DefaultTableCellRenderer
uk.ac.starlink.table.gui.NumericCellRenderer
Provides better rendering of numeric table cells than the default JTable renderer. Single-element primitive arrays are treated just like the corresponding wrapper classes, and the first few elements of a multi-element array are displayed. Numeric values are displayed with decimal points aligned and so on. This class is generally adapted to display of numeric values, but it can render Strings or other Objects too.
Cell rendering can be further refined by extending this class and
overriding the setValue(java.lang.Object)
method.
Nested Class Summary |
Nested classes inherited from class javax.swing.table.DefaultTableCellRenderer |
DefaultTableCellRenderer.UIResource |
Nested classes inherited from class javax.swing.JLabel |
JLabel.AccessibleJLabel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
static int |
MAX_SHOW_ELEMENTS
The most elements that will be shown in a single cell. |
Fields inherited from class javax.swing.table.DefaultTableCellRenderer |
noFocusBorder |
Fields inherited from class javax.swing.JLabel |
labelFor |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
NumericCellRenderer(Class clazz)
Construct a new NumericCellRenderer with a hint about the values it will be expected to render. |
Method Summary | |
Font |
getCellFont()
Returns the font in which cell contents will be rendererd. |
int |
getCellWidth()
Returns the advised width for table cells rendered by this object, on the assumption that the objects it is asked to render are as per the constructor. |
void |
setBadValue(Object badValue)
Sets a value to be regarded as bad when found in a non-header cell. |
void |
setCellFont(Font font)
Sets the font in which to render cell contents. |
protected void |
setValue(Object value)
Sets the state of this renderer, overriding the method in DefaultTableCellRenderer to provide more intelligent behaviour. |
Methods inherited from class javax.swing.table.DefaultTableCellRenderer |
firePropertyChange, firePropertyChange, getTableCellRendererComponent, isOpaque, repaint, repaint, revalidate, setBackground, setForeground, updateUI, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MAX_SHOW_ELEMENTS
Constructor Detail |
public NumericCellRenderer(Class clazz)
clazz
- the type of object it will expect to render on the wholeMethod Detail |
public void setCellFont(Font font)
font
- the font to use for text renderingpublic Font getCellFont()
protected void setValue(Object value)
Subclasses note: the work is done by invoking this object's setText and possibly setIcon methods (remember this object is a javax.swing.JLabel).
value
- the value to be renderedpublic void setBadValue(Object badValue)
badValue
- the special bad valuepublic int getCellWidth()
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |