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:
  • Field Details

    • selectionColor

      protected static final Color selectionColor
      Description
    • component

      protected JComponent component
      the component that gets rendered
    • value

      Description
    • backgroundColor

      protected Color backgroundColor
      the background color
    • foregroundColor

      protected Color foregroundColor
      Description
    • selectedBackgroundColor

      protected Color selectedBackgroundColor
      Description
    • selectedForegroundColor

      protected Color selectedForegroundColor
      Description
    • _defaultFont

      protected static Font _defaultFont
      the font used by all non-numeric data
    • _numberFont

      protected static Font _numberFont
      the font used by numeric data
    • _unitSystem

      protected int _unitSystem
      the unit system
    • _ignoreParameterRounding

      protected boolean _ignoreParameterRounding
    • _columnScalingList

      protected Hashtable _columnScalingList
      records the column number and the scale value.
    • _scaleFactor

      protected double _scaleFactor
      Description
    • _paramIdForScaling

      protected int _paramIdForScaling
      Description
    • DEBUG

      protected static final boolean DEBUG
      Description
    • _focusedCellBorder

      protected Border _focusedCellBorder
    • _missingString

      protected String _missingString
    • _showComma

      protected boolean _showComma
    • _formater

      protected DecimalFormat _formater
  • Constructor Details

    • RmaCellRenderer

      public RmaCellRenderer()
      Constructor for the RmaCellRenderer object
    • RmaCellRenderer

      public RmaCellRenderer(JLabel x)
      Constructor for the RmaCellRenderer object
      Parameters:
      x - Description
    • RmaCellRenderer

      public RmaCellRenderer(JButton x)
      Constructor for the RmaCellRenderer object
      Parameters:
      x - Description
    • RmaCellRenderer

      public RmaCellRenderer(JCheckBox x)
      Constructor for the RmaCellRenderer object
      Parameters:
      x - Description
  • Method Details

    • setIgnoreParameterRounding

      public void setIgnoreParameterRounding(boolean ignore)
    • ignoreParameterRounding

      public boolean ignoreParameterRounding()
    • setBackgroundColor

      public void setBackgroundColor(Color newColor)
      Sets the BackgroundColor attribute of the RmaCellRenderer object
      Parameters:
      newColor - The new BackgroundColor value
    • getBackgroundColor

      public Color getBackgroundColor()
      Gets the BackgroundColor attribute of the RmaCellRenderer object
      Returns:
      The BackgroundColor value
    • setForegroundColor

      public void setForegroundColor(Color newColor)
      Sets the ForegroundColor attribute of the RmaCellRenderer object
      Parameters:
      newColor - The new ForegroundColor value
    • getForegroundColor

      public Color getForegroundColor()
      Gets the ForegroundColor attribute of the RmaCellRenderer object
      Returns:
      The ForegroundColor value
    • setSelectedBackgroundColor

      public void setSelectedBackgroundColor(Color newColor)
      Sets the SelectedBackgroundColor attribute of the RmaCellRenderer object
      Parameters:
      newColor - The new SelectedBackgroundColor value
    • getSelectedBackgroundColor

      public Color getSelectedBackgroundColor()
      Gets the SelectedBackgroundColor attribute of the RmaCellRenderer object
      Returns:
      The SelectedBackgroundColor value
    • setSelectedForegroundColor

      public void setSelectedForegroundColor(Color newColor)
      Sets the SelectedForegroundColor attribute of the RmaCellRenderer object
      Parameters:
      newColor - The new SelectedForegroundColor value
    • getSelectedForegroundColor

      public Color getSelectedForegroundColor()
      Gets the SelectedForegroundColor attribute of the RmaCellRenderer object
      Returns:
      The SelectedForegroundColor value
    • setToolTipText

      public void setToolTipText(String text)
      Sets the ToolTipText attribute of the RmaCellRenderer object
      Parameters:
      text - The new ToolTipText value
    • getComponent

      public Component 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

      public void setIcon(Icon value)
      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 interface TableCellRenderer
      Parameters:
      table - Description
      value - Description
      isSelected - Description
      hasFocus - Description
      row - Description
      column - Description
      Returns:
      The TableCellRendererComponent value
    • setAlternateRowBackground

      public void setAlternateRowBackground(Color altColor)
    • getAlternateRowBackground

      public Color 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 interface UnitsCellRenderer
      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 interface UnitsCellRenderer
      Parameters:
      paramId - The new DisplayScaleFactor value
      scaleFactor - 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 value
      paramId - The new DisplayScaleFactor value
      scaleFactor - The new DisplayScaleFactor value
    • setMissingString

      public void setMissingString(String missingStr)
      set the string for undefined/missing values
      Parameters:
      missingStr - the new missing string
    • setShowCommas

      public void setShowCommas(boolean showCommas)