Package rma.swing.table
Class RmaCellRenderer
java.lang.Object
rma.swing.table.RmaCellRenderer
- All Implemented Interfaces:
Serializable
,TableCellRenderer
,UnitsCellRenderer
- Direct Known Subclasses:
AlignTableCellRenderer
,ComboBoxRenderer
,DecimalCellRenderer
,FileNameCellRenderer
,ParameterStringCellRenderer
,RmaDateTimeRenderer
,RmaJTable.CurrencyCellRenderer
,YesNoRenderer
public class RmaCellRenderer
extends Object
implements TableCellRenderer, Serializable, UnitsCellRenderer
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Hashtable
records the column number and the scale value.protected static Font
the font used by all non-numeric dataprotected Border
protected DecimalFormat
protected boolean
protected String
protected static Font
the font used by numeric dataprotected int
Descriptionprotected double
Descriptionprotected boolean
protected int
the unit systemprotected Color
the background colorprotected JComponent
the component that gets renderedprotected static final boolean
Descriptionprotected Color
Descriptionprotected Color
Descriptionprotected Color
Descriptionprotected static final Color
Descriptionprotected RmaCellRenderer.ValueProperty
Description -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the RmaCellRenderer objectConstructor for the RmaCellRenderer objectConstructor for the RmaCellRenderer objectConstructor for the RmaCellRenderer object -
Method Summary
Modifier and TypeMethodDescriptionGets the BackgroundColor attribute of the RmaCellRenderer objectGets the Component attribute of the RmaCellRenderer objectGets the ForegroundColor attribute of the RmaCellRenderer objectint
Gets the SelectedBackgroundColor attribute of the RmaCellRenderer objectGets the SelectedForegroundColor attribute of the RmaCellRenderer objectgetTableCellRendererComponent
(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) Gets the TableCellRendererComponent attribute of the RmaCellRenderer objectboolean
protected Component
renderCellComponent
(JTable table, Object value, boolean hasFocus, int row, int column) render the non-selected cellsprotected Component
renderSelectedCellComponent
(JTable table, Object value, boolean hasFocus, int row, int column) render the selected cellvoid
setAlternateRowBackground
(Color altColor) void
setBackgroundColor
(Color newColor) Sets the BackgroundColor attribute of the RmaCellRenderer objectvoid
setDisplayScaleFactor
(int paramId, double scaleFactor) Sets the DisplayScaleFactor attribute of the RmaCellRenderer objectvoid
setDisplayScaleFactor
(int col, int paramId, double scaleFactor) Sets the DisplayScaleFactor attribute of the RmaCellRenderer objectvoid
setDisplayUnitsSystem
(int unitsSystem) Sets the DisplayUnitsSystem attribute of the RmaCellRenderer objectvoid
setForegroundColor
(Color newColor) Sets the ForegroundColor attribute of the RmaCellRenderer objectvoid
setHorizontalAlignment
(int align) Sets the HorizontalAlignment attribute of the RmaCellRenderer objectvoid
Sets the Icon attribute of the RmaCellRenderer objectvoid
setIgnoreParameterRounding
(boolean ignore) void
setMissingString
(String missingStr) set the string for undefined/missing valuesvoid
setSelectedBackgroundColor
(Color newColor) Sets the SelectedBackgroundColor attribute of the RmaCellRenderer objectvoid
setSelectedForegroundColor
(Color newColor) Sets the SelectedForegroundColor attribute of the RmaCellRenderer objectvoid
setShowCommas
(boolean showCommas) void
setToolTipText
(String text) Sets the ToolTipText attribute of the RmaCellRenderer object
-
Field Details
-
selectionColor
Description -
component
the component that gets rendered -
value
Description -
backgroundColor
the background color -
foregroundColor
Description -
selectedBackgroundColor
Description -
selectedForegroundColor
Description -
_defaultFont
the font used by all non-numeric data -
_numberFont
the font used by numeric data -
_unitSystem
protected int _unitSystemthe unit system -
_ignoreParameterRounding
protected boolean _ignoreParameterRounding -
_columnScalingList
records the column number and the scale value. -
_scaleFactor
protected double _scaleFactorDescription -
_paramIdForScaling
protected int _paramIdForScalingDescription -
DEBUG
protected static final boolean DEBUGDescription -
_focusedCellBorder
-
_missingString
-
_showComma
protected boolean _showComma -
_formater
-
-
Constructor Details
-
RmaCellRenderer
public RmaCellRenderer()Constructor for the RmaCellRenderer object -
RmaCellRenderer
Constructor for the RmaCellRenderer object- Parameters:
x
- Description
-
RmaCellRenderer
Constructor for the RmaCellRenderer object- Parameters:
x
- Description
-
RmaCellRenderer
Constructor for the RmaCellRenderer object- Parameters:
x
- Description
-
-
Method Details
-
setIgnoreParameterRounding
public void setIgnoreParameterRounding(boolean ignore) -
ignoreParameterRounding
public boolean ignoreParameterRounding() -
setBackgroundColor
Sets the BackgroundColor attribute of the RmaCellRenderer object- Parameters:
newColor
- The new BackgroundColor value
-
getBackgroundColor
Gets the BackgroundColor attribute of the RmaCellRenderer object- Returns:
- The BackgroundColor value
-
setForegroundColor
Sets the ForegroundColor attribute of the RmaCellRenderer object- Parameters:
newColor
- The new ForegroundColor value
-
getForegroundColor
Gets the ForegroundColor attribute of the RmaCellRenderer object- Returns:
- The ForegroundColor value
-
setSelectedBackgroundColor
Sets the SelectedBackgroundColor attribute of the RmaCellRenderer object- Parameters:
newColor
- The new SelectedBackgroundColor value
-
getSelectedBackgroundColor
Gets the SelectedBackgroundColor attribute of the RmaCellRenderer object- Returns:
- The SelectedBackgroundColor value
-
setSelectedForegroundColor
Sets the SelectedForegroundColor attribute of the RmaCellRenderer object- Parameters:
newColor
- The new SelectedForegroundColor value
-
getSelectedForegroundColor
Gets the SelectedForegroundColor attribute of the RmaCellRenderer object- Returns:
- The SelectedForegroundColor value
-
setToolTipText
Sets the ToolTipText attribute of the RmaCellRenderer object- Parameters:
text
- The new ToolTipText value
-
getComponent
Gets the Component attribute of the RmaCellRenderer object- Returns:
- The Component value
-
setHorizontalAlignment
public void setHorizontalAlignment(int align) Sets the HorizontalAlignment attribute of the RmaCellRenderer object- Parameters:
align
- The new HorizontalAlignment value
-
getHorizontalAlignment
public int getHorizontalAlignment() -
setIcon
Sets the Icon attribute of the RmaCellRenderer object- Parameters:
value
- The new Icon value
-
getTableCellRendererComponent
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) Gets the TableCellRendererComponent attribute of the RmaCellRenderer object- Specified by:
getTableCellRendererComponent
in interfaceTableCellRenderer
- Parameters:
table
- Descriptionvalue
- DescriptionisSelected
- DescriptionhasFocus
- Descriptionrow
- Descriptioncolumn
- Description- Returns:
- The TableCellRendererComponent value
-
setAlternateRowBackground
-
getAlternateRowBackground
-
renderSelectedCellComponent
protected Component renderSelectedCellComponent(JTable table, Object value, boolean hasFocus, int row, int column) render the selected cell- Parameters:
table
-value
-hasFocus
-row
-column
-- Returns:
-
renderCellComponent
protected Component renderCellComponent(JTable table, Object value, boolean hasFocus, int row, int column) render the non-selected cells- Parameters:
table
-value
-hasFocus
-row
-column
-- Returns:
-
setDisplayUnitsSystem
public void setDisplayUnitsSystem(int unitsSystem) Sets the DisplayUnitsSystem attribute of the RmaCellRenderer object- Specified by:
setDisplayUnitsSystem
in interfaceUnitsCellRenderer
- Parameters:
unitsSystem
- The new DisplayUnitsSystem value
-
setDisplayScaleFactor
public void setDisplayScaleFactor(int paramId, double scaleFactor) Sets the DisplayScaleFactor attribute of the RmaCellRenderer object- Specified by:
setDisplayScaleFactor
in interfaceUnitsCellRenderer
- Parameters:
paramId
- The new DisplayScaleFactor valuescaleFactor
- The new DisplayScaleFactor value
-
setDisplayScaleFactor
public void setDisplayScaleFactor(int col, int paramId, double scaleFactor) Sets the DisplayScaleFactor attribute of the RmaCellRenderer object- Parameters:
col
- The new DisplayScaleFactor valueparamId
- The new DisplayScaleFactor valuescaleFactor
- The new DisplayScaleFactor value
-
setMissingString
set the string for undefined/missing values- Parameters:
missingStr
- the new missing string
-
setShowCommas
public void setShowCommas(boolean showCommas)
-