|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JLabel com.jstatcom.table.JSCCellRendererTypes
public class JSCCellRendererTypes
The class defines different JSCCellRenderers
for the JSCAbstractDataTable
,
which can be used in different modeling contexts, for example to display coefficients matrizes or
subset matrizes. It is possible to extend this enumeration to provide special
renderers for different contexts.
The class implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21).
If you compare JSCCellRendererTypes
, always use the ==
operator. This is
save, because they are Singletons (Gamma et al., 1995).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static JSCCellRendererTypes |
COEFF_DEFAULT
Default TableCellRenderer for coefficients. |
static JSCCellRendererTypes |
COEFF_SCIENTIFIC
Scientific TableCellRenderer for coefficients. |
static JSCCellRendererTypes |
DEFAULT
Default TableCellRenderer . |
static JSCCellRendererTypes |
DIAG_01M1NEGINF
A TableCellRenderer for the A and B matrizes of an SVAR model. |
static JSCCellRendererTypes |
DIAGONAL_01
A TableCellRenderer for the special subset matrizes. |
static JSCCellRendererTypes |
EQUATION_NAMES
Equation String TableCellRenderer . |
static JSCCellRendererTypes |
SCIENTIFIC
TableCellRenderer with scientific notation, for example 1.23E-2. |
static JSCCellRendererTypes |
SUBSET_01
A TableCellRenderer for the subset matrizes. |
static JSCCellRendererTypes |
SUBSET_01_GRAY
A TableCellRenderer for the non editable subset matrizes
with a gray background. |
static JSCCellRendererTypes |
SUBSET_012
A TableCellRenderer for subset matrizes. |
static JSCCellRendererTypes |
SUBSET_01M1NEGINF
A TableCellRenderer for the A and B matrizes of an SVAR model. |
static JSCCellRendererTypes |
VARIABLE_NAMES
String TableCellRenderer for variable names. |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Override prevention method to enforce a.equals(b) if and only if a==b . |
java.lang.String |
getName()
Gets the name of this type. |
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int col)
Defines how the cell is painted. |
int |
hashCode()
Override prevention method invokes super method. |
java.lang.String |
toString()
Gets a string representing this type, do not use for comparisons. |
Methods inherited from class javax.swing.JLabel |
---|
getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final JSCCellRendererTypes DEFAULT
TableCellRenderer
. It displays doubles as they appear with
a given precision set by the underlying table,
using the default number format.
public static final JSCCellRendererTypes SCIENTIFIC
TableCellRenderer
with scientific notation, for example 1.23E-2.
It also takes the precision into account.
public static final JSCCellRendererTypes COEFF_DEFAULT
TableCellRenderer
for coefficients. It displays doubles as they appear with
a given precision set by the underlying table. If an element is restricted
by the underlying restricion matrix, it is displayed as "---". This is also true for values
that are exactly 0.
public static final JSCCellRendererTypes COEFF_SCIENTIFIC
TableCellRenderer
for coefficients. It displays doubles as they appear with
a given precision set by the underlying table. If an element is restricted
by the underlying restricion matrix, it is displayed as "---"
public static final JSCCellRendererTypes SUBSET_01
TableCellRenderer
for the subset matrizes. It displays "0" for 0,
"*" for 1 and "---" for all other values.
If a subset restriction is set in the coefficients table,
the corresponding element is set to Double.NaN
and displayed as "---".
public static final JSCCellRendererTypes SUBSET_01_GRAY
TableCellRenderer
for the non editable subset matrizes
with a gray background. It displays "0" for 0,
"*" for 1 and "---" for all other values.
If a subset restriction is set in the coefficients table,
the corresponding element is set to Double.NaN
and displayed as "---".
public static final JSCCellRendererTypes SUBSET_012
TableCellRenderer
for subset matrizes. It displays "0" for 0,
"*" for 1 and "!" for 2. All other values are displayed as "---".
If a subset restriction is set in the underlying coefficients table,
the corresponding element is set to Double.NaN
and displayed as "---".
public static final JSCCellRendererTypes DIAGONAL_01
TableCellRenderer
for the special subset matrizes. It displays "0" for 0,
"*" for 1 and "---" for all other values. The diagonal elements are rendered
with a gray background, because they are usually not editable.
If a subset restriction is set in the coefficients table,
the corresponding element is set to Double.NaN
and displayed as "---".
This renderer might be used for the matrix of structural coefficients.
public static final JSCCellRendererTypes EQUATION_NAMES
TableCellRenderer
. It is used as a left hand side
equation description.
public static final JSCCellRendererTypes VARIABLE_NAMES
TableCellRenderer
for variable names. It displays an index
if it is set for a VarNamesVector
and isShowingIndex
is true.
public static final JSCCellRendererTypes DIAG_01M1NEGINF
TableCellRenderer
for the A and B matrizes of an SVAR model.
It displays "0" for 0, "*" for -INF
, "1" for 1, "-1" for -1 and all other values "as is".
The diagonal elements are rendered with a gray background, because they are usually not editable.
public static final JSCCellRendererTypes SUBSET_01M1NEGINF
TableCellRenderer
for the A and B matrizes of an SVAR model.
It displays "0" for 0, "*" for -INF
, "1" for 1, "-1" for -1 and all other values "as is".
Method Detail |
---|
public final boolean equals(java.lang.Object o)
a.equals(b)
if and only if a==b
.
equals
in class java.lang.Object
o
- object to compare with
true
if equal, false
otherwisepublic final java.lang.String getName()
getName
in class java.awt.Component
public final java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int col)
set
and get
methods can be
redefined by subclasses of JSCDataTableRendererTypes
without changing the general structure of the algorithm.
The ordering of calls is the following:
setFirst
(always)
getDoubleValue
(if data table contains number types)
setDoubleValue
(if data table contains number types)
getStringValue
(if data table contains String
types)
setStringValue
(if data table contains String
types)
setValue
(if data table contains other types)
getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
table
- the table to rendervalue
- the value to displayisSelected
- true
if cell is selectedhasFocus
- true
if cell has focusrow
- index for rowcol
- index for column
public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.awt.Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |