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 Hashtablerecords the column number and the scale value.protected static Fontthe font used by all non-numeric dataprotected Borderprotected DecimalFormatprotected booleanprotected Stringprotected static Fontthe font used by numeric dataprotected intDescriptionprotected doubleDescriptionprotected booleanprotected intthe unit systemprotected Colorthe background colorprotected JComponentthe component that gets renderedprotected static final booleanDescriptionprotected ColorDescriptionprotected ColorDescriptionprotected ColorDescriptionprotected static final ColorDescriptionprotected RmaCellRenderer.ValuePropertyDescription -
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 objectintGets 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 objectbooleanprotected ComponentrenderCellComponent(JTable table, Object value, boolean hasFocus, int row, int column) render the non-selected cellsprotected ComponentrenderSelectedCellComponent(JTable table, Object value, boolean hasFocus, int row, int column) render the selected cellvoidsetAlternateRowBackground(Color altColor) voidsetBackgroundColor(Color newColor) Sets the BackgroundColor attribute of the RmaCellRenderer objectvoidsetDisplayScaleFactor(int paramId, double scaleFactor) Sets the DisplayScaleFactor attribute of the RmaCellRenderer objectvoidsetDisplayScaleFactor(int col, int paramId, double scaleFactor) Sets the DisplayScaleFactor attribute of the RmaCellRenderer objectvoidsetDisplayUnitsSystem(int unitsSystem) Sets the DisplayUnitsSystem attribute of the RmaCellRenderer objectvoidsetForegroundColor(Color newColor) Sets the ForegroundColor attribute of the RmaCellRenderer objectvoidsetHorizontalAlignment(int align) Sets the HorizontalAlignment attribute of the RmaCellRenderer objectvoidSets the Icon attribute of the RmaCellRenderer objectvoidsetIgnoreParameterRounding(boolean ignore) voidsetMissingString(String missingStr) set the string for undefined/missing valuesvoidsetSelectedBackgroundColor(Color newColor) Sets the SelectedBackgroundColor attribute of the RmaCellRenderer objectvoidsetSelectedForegroundColor(Color newColor) Sets the SelectedForegroundColor attribute of the RmaCellRenderer objectvoidsetShowCommas(boolean showCommas) voidsetToolTipText(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:
getTableCellRendererComponentin 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:
setDisplayUnitsSystemin 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:
setDisplayScaleFactorin 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)
-