org.opensourcephysics.display
Class DataTable.UnitRenderer

java.lang.Object
  extended by org.opensourcephysics.display.DataTable.UnitRenderer
All Implemented Interfaces:
javax.swing.table.TableCellRenderer
Enclosing class:
DataTable

protected static class DataTable.UnitRenderer
extends java.lang.Object
implements javax.swing.table.TableCellRenderer

A cell renderer that adds units to displayed values. Added by D Brown Dec 2010


Constructor Summary
DataTable.UnitRenderer(javax.swing.table.TableCellRenderer renderer, java.lang.String units, java.lang.String tooltip)
          UnitRenderer constructor
 
Method Summary
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
          Returns the rendered component.
 void setBaseRenderer(javax.swing.table.TableCellRenderer renderer)
          Sets the base renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTable.UnitRenderer

public DataTable.UnitRenderer(javax.swing.table.TableCellRenderer renderer,
                              java.lang.String units,
                              java.lang.String tooltip)
UnitRenderer constructor

Parameters:
renderer - a TableCellRenderer
factor - a conversion factor
Method Detail

setBaseRenderer

public void setBaseRenderer(javax.swing.table.TableCellRenderer renderer)
Sets the base renderer.

Parameters:
renderer - the base renderer

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column)
Returns the rendered component.

Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer