|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
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
com.sciapp.renderers.DefaultRenderer
com.sciapp.renderers.NumberRenderer
public class NumberRenderer
NumberRenderer is a TableCellRenderer suitable for rendering Number objects.
NumberRenderer uses an internal NumberFormat object to render Numbers.
By default, numbers are aligned to the right of the cell.
The appearance of the cell can be controlled by modifying the properties of the internal
NumberFormat, an instance of which can be acquired with getNumberFormat
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
DefaultTableCellRenderer.UIResource |
Nested classes/interfaces inherited from class javax.swing.JLabel |
---|
JLabel.AccessibleJLabel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected NumberFormat |
numberFormat
The number format instance |
Fields inherited from class com.sciapp.renderers.DefaultRenderer |
---|
evenColor, oddColor, space, spacing |
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 | |
---|---|
NumberRenderer()
Constructs a default NumberRenderer. |
|
NumberRenderer(NumberFormat numberFormat)
Constructs a default NumberRenderer with numberFormat as the NumberFormat instance
that will render the cells. |
Method Summary | |
---|---|
NumberFormat |
getNumberFormat()
Returns the internal NumberFormat object used to render the Numbers. |
void |
setNumberFormat(NumberFormat numberFormat)
Assigns a new NumberFormat object. |
protected void |
setValue(Object value)
Sets the Number object for the cell being rendered to value. |
Methods inherited from class com.sciapp.renderers.DefaultRenderer |
---|
getEvenColor, getOddColor, getSpacing, getTableCellRendererComponent, setEvenColor, setOddColor, setSpaces, setSpacing, setText |
Methods inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
firePropertyChange, firePropertyChange, 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 |
---|
protected NumberFormat numberFormat
Constructor Detail |
---|
public NumberRenderer()
public NumberRenderer(NumberFormat numberFormat)
numberFormat
as the NumberFormat instance
that will render the cells.
Method Detail |
---|
public NumberFormat getNumberFormat()
public void setNumberFormat(NumberFormat numberFormat)
numberFormat
- the NumberFormat object to assignprotected void setValue(Object value)
setValue
in class DefaultTableCellRenderer
value
- the value to assign.JLabel.setText(java.lang.String)
|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |