stella.jview
Class JSensorTable

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by jview.AbstractDisplayable
                  extended by stella.jview.JSensorTable
All Implemented Interfaces:
Cloneable, Displayable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class JSensorTable
extends AbstractDisplayable

A table that displays some sensor data. The user can click on the column header giving the sensor name to scroll between true, predicted, smoothened and derivative data. It typically looks like this: JSensorTable


Nested Class Summary
private  class JSensorTable.JSensorTableDisplay
          We have to define special cell renderer for the zeroth column.
static class JSensorTable.Show
          Pops up a frame and displays the sensor table.
private static class JSensorTable.WeatherRenderer
          A helper class to allow colored sensor names.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static TableCellRenderer bad
          The cell renderer for bad wether.
private static TableCellRenderer clear
          The cell renderer for clear wether.
private static Color DEFBADCOLOR
          Color for bad weather, if reason is equal shown one.
private static Color DEFCLEARCOLOR
          The default clear color.
private static String DEFCOLUMNLABEL
          The default column labels.
private static Color DEFNOWEATHERCOLOR
          Color for invalid weather.
private static Color DEFRETARDBADCOLOR
          Color for bad weather retard, if reason is equal shown one.
private static Color DEFRETARDCLEARCOLOR
          Color for bad weather retard, if reason is equal shown one.
private static long DEFSAMPLEPERIOD
          The default sampling period.
static String KEY_BADCOLOR
          The color for bad sensor readings.
static String KEY_CLEARCOLOR
          The color for clear sensor readings.
static String KEY_COLUMNLABEL
          The labels on the sensor value columns, comma-separated.
static String KEY_NOWEATHERCOLOR
          The color for non-weather sensors.
static String KEY_REPOSITORY
          The name of the repository the table should bind to.
static String KEY_RETARDBADCOLOR
          The color for sensor retarding to bad.
static String KEY_RETARDCLEARCOLOR
          The color for sensor retarding to good.
static String KEY_SAMPLEPERIOD
          The key to the averaging period imposed on the table model.
static String KEY_SENSORLIST
          The key to a list of sensor that should be displayed.
private static TableCellRenderer noweather
          The cell renderer for no wether.
private static TableCellRenderer retardbad
          The cell renderer for retarding bad wether.
private static TableCellRenderer retardclear
          The cell renderer for retarding good wether.
private  SensorTableModel sensor
          My sensor table to ease access.
private  JTable view
          The jtable to display.
 
Fields inherited from class jview.AbstractDisplayable
KEY_COMPONENTNAME, KEY_ICON, KEY_INSETS
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
JSensorTable(Map prop)
          Constructs a new sensor table.
 
Method Summary
 Component getRepresentation()
          Returns the JTable dedescant that describes this table.
 void init()
          Initializes the sensor by building a SensorTableModel and binding it to the KEY_REPOSITORY.
 
Methods inherited from class jview.AbstractDisplayable
getComponentName, getIcon, getIcon
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_REPOSITORY

public static final String KEY_REPOSITORY
The name of the repository the table should bind to.

See Also:
Constant Field Values

KEY_SENSORLIST

public static final String KEY_SENSORLIST
The key to a list of sensor that should be displayed.

See Also:
Constant Field Values

KEY_SAMPLEPERIOD

public static final String KEY_SAMPLEPERIOD
The key to the averaging period imposed on the table model.

See Also:
Constant Field Values

KEY_CLEARCOLOR

public static final String KEY_CLEARCOLOR
The color for clear sensor readings.

See Also:
Constant Field Values

KEY_BADCOLOR

public static final String KEY_BADCOLOR
The color for bad sensor readings.

See Also:
Constant Field Values

KEY_RETARDCLEARCOLOR

public static final String KEY_RETARDCLEARCOLOR
The color for sensor retarding to good.

See Also:
Constant Field Values

KEY_RETARDBADCOLOR

public static final String KEY_RETARDBADCOLOR
The color for sensor retarding to bad.

See Also:
Constant Field Values

KEY_NOWEATHERCOLOR

public static final String KEY_NOWEATHERCOLOR
The color for non-weather sensors.

See Also:
Constant Field Values

KEY_COLUMNLABEL

public static final String KEY_COLUMNLABEL
The labels on the sensor value columns, comma-separated.

See Also:
Constant Field Values

DEFSAMPLEPERIOD

private static final long DEFSAMPLEPERIOD
The default sampling period.

See Also:
Constant Field Values

DEFCLEARCOLOR

private static final Color DEFCLEARCOLOR
The default clear color.


DEFBADCOLOR

private static final Color DEFBADCOLOR
Color for bad weather, if reason is equal shown one.


DEFRETARDBADCOLOR

private static final Color DEFRETARDBADCOLOR
Color for bad weather retard, if reason is equal shown one.


DEFRETARDCLEARCOLOR

private static final Color DEFRETARDCLEARCOLOR
Color for bad weather retard, if reason is equal shown one.


DEFNOWEATHERCOLOR

private static final Color DEFNOWEATHERCOLOR
Color for invalid weather.


DEFCOLUMNLABEL

private static final String DEFCOLUMNLABEL
The default column labels.

See Also:
Constant Field Values

view

private JTable view
The jtable to display.


sensor

private SensorTableModel sensor
My sensor table to ease access.


clear

private static TableCellRenderer clear
The cell renderer for clear wether.


bad

private static TableCellRenderer bad
The cell renderer for bad wether.


retardclear

private static TableCellRenderer retardclear
The cell renderer for retarding good wether.


retardbad

private static TableCellRenderer retardbad
The cell renderer for retarding bad wether.


noweather

private static TableCellRenderer noweather
The cell renderer for no wether.

Constructor Detail

JSensorTable

public JSensorTable(Map prop)
Constructs a new sensor table. Initialization is deferred to the init() method.

Method Detail

init

public void init()
Initializes the sensor by building a SensorTableModel and binding it to the KEY_REPOSITORY. Additionally, a JTable is initialized, which is then delivered in the getRepresentation() method.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

getRepresentation

public Component getRepresentation()
Returns the JTable dedescant that describes this table. Sensor lists are not intended for scrolling, thus we deliver a JPanel with both, the header and the table body in it.