EchoPoint
1.0

echopoint
Class Thermometer

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
              extended byechopoint.meter.AbstractMeterComponent
                  extended byechopoint.Thermometer
All Implemented Interfaces:
MouseCursorable, ReflectionSetter, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport

public class Thermometer
extends AbstractMeterComponent

This component uses the JFreeChart capabilties to draw a Thermometer.

This class is derived from AbstractMeterComponent which contains many of its methods.

This class uses the MeterModelJFreeChartAdapter class to bridge data from the EchoPoint MeterModel interface to the JFreeChart MeterDatSet interface.

The "axis" used on the Thermometer is controlled by the height of the component. If you make the component higher, more values will be shown on the axis.

See Also:
Serialized Form

Nested Class Summary
static class Thermometer.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String BOUNDS_CHANGED_PROPERTY
           
protected  double lowerBound
           
protected  nextapp.echo.Color mercuryColor
           
static java.lang.String STYLE_LOWER_BOUND
          A style constant for the Lower Bound Placement property.
static java.lang.String STYLE_MERCURY_COLOR
          A style constant for the Mercury Color property.
static java.lang.String STYLE_THERMOMETER_COLOR
          A style constant for the Thermometer Color property.
static java.lang.String STYLE_UPPER_BOUND
          A style constant for the Upper Bound Placement property.
static java.lang.String STYLE_VALUE_FORMAT
          A style constant for the Value Format property.
static java.lang.String STYLE_VALUE_LINES_SHOWN
          A style constant for the Value Lines Shown property.
static java.lang.String STYLE_VALUE_PLACEMENT
          A style constant for the Value Placement property.
protected  nextapp.echo.Color thermometerColor
           
protected  double upperBound
           
static java.lang.String VALUE_FORMAT_CHANGED_PROPERTY
           
static java.lang.String VALUE_LINES_SHOWN_CHANGED_PROPERTY
           
static int VALUE_PLACEMENT_BULB
           
static java.lang.String VALUE_PLACEMENT_CHANGED_PROPERTY
           
static int VALUE_PLACEMENT_NONE
          These constants control the shape of the Tachometer
static int VALUE_PLACEMENT_RIGHT
           
protected  java.text.NumberFormat valueFormat
           
protected  boolean valueLinesShown
           
protected  int valuePlacement
           
static SymbolicValue[] valuePlacementSymbolics
          Helper static SymbolicValue[] - Thermometer.VALUE_PLACEMENT_NONE, VALUE_PLACEMENT_RIGHT, and VALUE_PLACEMENT_BULB
 
Fields inherited from class echopoint.meter.AbstractMeterComponent
COLORS_CHANGED_PROPERTY, criticalColor, height, HEIGHT_CHANGED_PROPERTY, image, IMAGE_CHANGED_PROPERTY, insets, INSETS_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, needsRedraw, normalColor, STYLE_CRITICAL_COLOR, STYLE_HEIGHT, STYLE_INSETS, STYLE_NORMAL_COLOR, STYLE_VALUE_COLOR, STYLE_VALUE_FONT, STYLE_WARNING_COLOR, STYLE_WIDTH, units, UNITS_CHANGED_PROPERTY, valueColor, valueFont, warningColor, width, WIDTH_CHANGED_PROPERTY
 
Fields inherited from class echopoint.EchoPointComponent
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.MouseCursorable
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI
 
Constructor Summary
Thermometer()
          Thermometer constructor.
 
Method Summary
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
protected  nextapp.echo.ImageReference drawMeterImage()
          Called to redraw the image for this meter.
 org.jfree.chart.JFreeChart getJFreeChart()
          Returns the internal JFreeChart used to paint the component.
 double getLowerBound()
          Returns the lower bound of the Thermometer.
 nextapp.echo.Color getMercuryColor()
          Returns the color of the Thermometer's mercury area (the bulb)
 nextapp.echo.Color getThermometerColor()
          Returns the color of the Thermometer's outside lines
 double getUpperBound()
          Returns the upper bound of the Thermometer.
 java.text.NumberFormat getValueFormat()
          Gets the format of the Thermometer value.
 int getValuePlacement()
          Returns the value placement on the Thermometer.
protected  boolean isImageRepresentation()
          Subclasses can overrride this method to indicate that a "image" representation is NOT required.
 boolean isValueLinesShown()
          Returns true if the value lines are shown
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setLowerBound(double newLowerBound)
          Sets the lower bound of the Thermometer.
 void setMercuryColor(nextapp.echo.Color newMercuryColor)
          Sets the color of the Thermometer's mercury area (the bulb)
 void setModel(MeterModel model)
          Sets the model for the Thermometer
 void setThermometerColor(nextapp.echo.Color newThermometerColor)
          Sets the color of the Thermometer's outside lines
 void setUpperBound(double newUpperBound)
          Returns the upper bound of the Thermometer.
 void setValueFormat(java.text.NumberFormat newValueFormat)
          Sets the format of the Thermometer value.
 void setValueLinesShown(boolean newValueLinesShown)
          If this is true then value lines are shown.
 void setValuePlacement(int newValuePlacement)
          Sets the value placement on the Thermometer.
 
Methods inherited from class echopoint.meter.AbstractMeterComponent
addChangeListener, getCriticalColor, getHeight, getImage, getInsets, getMaximumCriticalValue, getMaximumNormalValue, getMaximumValue, getMaximumWarningValue, getMinimumCriticalValue, getMinimumNormalValue, getMinimumValue, getMinimumWarningValue, getModel, getNormalColor, getUnits, getValue, getValueColor, getValueFont, getWarningColor, getWidth, invalidate, removeChangeListener, setCriticalColor, setCriticalRange, setHeight, setInsets, setNormalColor, setNormalRange, setRange, setUnits, setValue, setValue, setValueColor, setValueFont, setWarningColor, setWarningRange, setWidth, validate
 
Methods inherited from class echopoint.EchoPointComponent
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText
 
Methods inherited from class nextapp.echo.Component
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_PLACEMENT_NONE

public static final int VALUE_PLACEMENT_NONE
These constants control the shape of the Tachometer

See Also:
Constant Field Values

VALUE_PLACEMENT_RIGHT

public static final int VALUE_PLACEMENT_RIGHT
See Also:
Constant Field Values

VALUE_PLACEMENT_BULB

public static final int VALUE_PLACEMENT_BULB
See Also:
Constant Field Values

STYLE_THERMOMETER_COLOR

public static final java.lang.String STYLE_THERMOMETER_COLOR
A style constant for the Thermometer Color property. Values of this key must be of type Color

See Also:
Constant Field Values

STYLE_MERCURY_COLOR

public static final java.lang.String STYLE_MERCURY_COLOR
A style constant for the Mercury Color property. Values of this key must be of type Color

See Also:
Constant Field Values

STYLE_VALUE_PLACEMENT

public static final java.lang.String STYLE_VALUE_PLACEMENT
A style constant for the Value Placement property. Values of this key must be of type int

See Also:
Constant Field Values

STYLE_VALUE_FORMAT

public static final java.lang.String STYLE_VALUE_FORMAT
A style constant for the Value Format property. Values of this key must be of type NumberFormat

See Also:
Constant Field Values

STYLE_VALUE_LINES_SHOWN

public static final java.lang.String STYLE_VALUE_LINES_SHOWN
A style constant for the Value Lines Shown property. Values of this key must be of type boolean

See Also:
Constant Field Values

STYLE_LOWER_BOUND

public static final java.lang.String STYLE_LOWER_BOUND
A style constant for the Lower Bound Placement property. Values of this key must be of type double

See Also:
Constant Field Values

STYLE_UPPER_BOUND

public static final java.lang.String STYLE_UPPER_BOUND
A style constant for the Upper Bound Placement property. Values of this key must be of type double

See Also:
Constant Field Values

valuePlacementSymbolics

public static SymbolicValue[] valuePlacementSymbolics
Helper static SymbolicValue[] - Thermometer.VALUE_PLACEMENT_NONE, VALUE_PLACEMENT_RIGHT, and VALUE_PLACEMENT_BULB


VALUE_PLACEMENT_CHANGED_PROPERTY

public static final java.lang.String VALUE_PLACEMENT_CHANGED_PROPERTY
See Also:
Constant Field Values

VALUE_FORMAT_CHANGED_PROPERTY

public static final java.lang.String VALUE_FORMAT_CHANGED_PROPERTY
See Also:
Constant Field Values

VALUE_LINES_SHOWN_CHANGED_PROPERTY

public static final java.lang.String VALUE_LINES_SHOWN_CHANGED_PROPERTY
See Also:
Constant Field Values

BOUNDS_CHANGED_PROPERTY

public static final java.lang.String BOUNDS_CHANGED_PROPERTY
See Also:
Constant Field Values

thermometerColor

protected nextapp.echo.Color thermometerColor

mercuryColor

protected nextapp.echo.Color mercuryColor

valuePlacement

protected int valuePlacement

valueFormat

protected java.text.NumberFormat valueFormat

valueLinesShown

protected boolean valueLinesShown

lowerBound

protected double lowerBound

upperBound

protected double upperBound
Constructor Detail

Thermometer

public Thermometer()
Thermometer constructor.

Method Detail

applyStyle

public void applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. The base nextapp.echo.Component style names can be used as well.

Specified by:
applyStyle in interface MouseCursorable
Overrides:
applyStyle in class AbstractMeterComponent

drawMeterImage

protected nextapp.echo.ImageReference drawMeterImage()
Called to redraw the image for this meter.

Specified by:
drawMeterImage in class AbstractMeterComponent

getJFreeChart

public org.jfree.chart.JFreeChart getJFreeChart()
Returns the internal JFreeChart used to paint the component.


getLowerBound

public double getLowerBound()
Returns the lower bound of the Thermometer.

The data value can be set lower than this, but it will not be shown in the thermometer.

Returns:
double

getMercuryColor

public nextapp.echo.Color getMercuryColor()
Returns the color of the Thermometer's mercury area (the bulb)

Returns:
nextapp.echo.Color

getThermometerColor

public nextapp.echo.Color getThermometerColor()
Returns the color of the Thermometer's outside lines

Returns:
nextapp.echo.Color

getUpperBound

public double getUpperBound()
Returns the upper bound of the Thermometer.

The data value can be set higher than this, but it will not be shown in the thermometer.

Returns:
double

getValueFormat

public java.text.NumberFormat getValueFormat()
Gets the format of the Thermometer value.

Returns:
java.text.NumberFormat

getValuePlacement

public int getValuePlacement()
Returns the value placement on the Thermometer.

This can be one of the following values:

Returns:
int

isImageRepresentation

protected boolean isImageRepresentation()
Subclasses can overrride this method to indicate that a "image" representation is NOT required. The "drawImage" method will not be called and the subclass is therefore responsible for all visual representation processing.

Specified by:
isImageRepresentation in class AbstractMeterComponent

isValueLinesShown

public boolean isValueLinesShown()
Returns true if the value lines are shown

Returns:
boolean

setLowerBound

public void setLowerBound(double newLowerBound)
Sets the lower bound of the Thermometer.

The data value can be set lower than this, but it will not be shown in the thermometer.

Parameters:
newLowerBound - double

setMercuryColor

public void setMercuryColor(nextapp.echo.Color newMercuryColor)
Sets the color of the Thermometer's mercury area (the bulb)

Parameters:
newMercuryColor - nextapp.echo.Color

setModel

public void setModel(MeterModel model)
Sets the model for the Thermometer

Overrides:
setModel in class AbstractMeterComponent
Parameters:
model - echopoint.meter.MeterModel

setThermometerColor

public void setThermometerColor(nextapp.echo.Color newThermometerColor)
Sets the color of the Thermometer's outside lines

Parameters:
newThermometerColor - nextapp.echo.Color

setUpperBound

public void setUpperBound(double newUpperBound)
Returns the upper bound of the Thermometer.

The data value can be set higher than this, but it will not be shown in the thermometer.

Parameters:
newUpperBound - double

setValueFormat

public void setValueFormat(java.text.NumberFormat newValueFormat)
Sets the format of the Thermometer value.

Parameters:
newValueFormat - java.text.NumberFormat

setValueLinesShown

public void setValueLinesShown(boolean newValueLinesShown)
If this is true then value lines are shown.

Parameters:
newValueLinesShown - boolean

setValuePlacement

public void setValuePlacement(int newValuePlacement)
Sets the value placement on the Thermometer.

This can be one of the following values:

Parameters:
newValuePlacement - int

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Overrides:
set in class AbstractMeterComponent
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0