|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.Component nextapp.echo.Container echopoint.EchoPointComponent echopoint.meter.AbstractMeterComponent
This abstract component class can be used as the base class for a component that has a range of values, a current value as well as a normal, warning and critical range.
The sub class needs to override the drawMeterImage
method and
return an image that is the visual representation of the meter.
Also when a property has changed, call the invalidate method to ensure that the component image is redraw.
Nested Class Summary | |
static class |
AbstractMeterComponent.NestedStyleInfo
Nested public static StyleInfo class. |
Field Summary | |
static java.lang.String |
COLORS_CHANGED_PROPERTY
|
protected nextapp.echo.Color |
criticalColor
|
protected int |
height
|
static java.lang.String |
HEIGHT_CHANGED_PROPERTY
|
protected nextapp.echo.ImageReference |
image
|
static java.lang.String |
IMAGE_CHANGED_PROPERTY
|
protected nextapp.echo.Insets |
insets
|
static java.lang.String |
INSETS_CHANGED_PROPERTY
|
protected MeterModel |
model
|
static java.lang.String |
MODEL_CHANGED_PROPERTY
Public property change names |
protected boolean |
needsRedraw
|
protected nextapp.echo.Color |
normalColor
|
static java.lang.String |
STYLE_CRITICAL_COLOR
A style constant for the Criticial Color property. |
static java.lang.String |
STYLE_HEIGHT
A style constant for the Height property. |
static java.lang.String |
STYLE_INSETS
A style constant for the Insets property. |
static java.lang.String |
STYLE_NORMAL_COLOR
A style constant for the Normal Color property. |
static java.lang.String |
STYLE_VALUE_COLOR
A style constant for the Value Color property. |
static java.lang.String |
STYLE_VALUE_FONT
A style constant for the Value Font property. |
static java.lang.String |
STYLE_WARNING_COLOR
A style constant for the Warning Color property. |
static java.lang.String |
STYLE_WIDTH
A style constant for the Width property. |
protected java.lang.String |
units
|
static java.lang.String |
UNITS_CHANGED_PROPERTY
|
protected nextapp.echo.Color |
valueColor
|
protected nextapp.echo.Font |
valueFont
|
protected nextapp.echo.Color |
warningColor
|
protected int |
width
|
static java.lang.String |
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 | |
AbstractMeterComponent()
AbstractMeterComponent constructor comment. |
Method Summary | |
void |
addChangeListener(nextapp.echo.event.ChangeListener l)
Adds a ChangeListener to the button. |
void |
applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. |
protected abstract nextapp.echo.ImageReference |
drawMeterImage()
This is called to redraw the "image" repsentation if the meter. |
nextapp.echo.Color |
getCriticalColor()
Gets the critical color used |
int |
getHeight()
Returns the height. |
nextapp.echo.ImageReference |
getImage()
This returns the "Image" representation of the meter. |
nextapp.echo.Insets |
getInsets()
Returns the insets (margins) of the tabbed pane contents. |
java.lang.Number |
getMaximumCriticalValue()
Returns the maximum critical value. |
java.lang.Number |
getMaximumNormalValue()
Returns the maximum normal value. |
java.lang.Number |
getMaximumValue()
Returns the maximum value. |
java.lang.Number |
getMaximumWarningValue()
Returns the maximum warning value. |
java.lang.Number |
getMinimumCriticalValue()
Returns the minimum critical value. |
java.lang.Number |
getMinimumNormalValue()
Returns the minimum normal value. |
java.lang.Number |
getMinimumValue()
Returns the minimum value. |
java.lang.Number |
getMinimumWarningValue()
Returns the minimum warning value. |
MeterModel |
getModel()
Gets the model in use. |
nextapp.echo.Color |
getNormalColor()
Gets the normal color used by the meter |
java.lang.String |
getUnits()
Returns the "units" string associated with the meter. |
java.lang.Number |
getValue()
Returns the value. |
nextapp.echo.Color |
getValueColor()
Gets the value color used by the meter |
nextapp.echo.Font |
getValueFont()
Gets the value font used by the meter |
nextapp.echo.Color |
getWarningColor()
Gets the warning color used by the meter |
int |
getWidth()
Returns the width. |
void |
invalidate()
Can be called to invalidate the Meter component so that it will redraw its internals when next rendered. |
protected abstract boolean |
isImageRepresentation()
Subclasses can overrride this method to indicate that a "image" representation is NOT required. |
void |
removeChangeListener(nextapp.echo.event.ChangeListener l)
Removes a ChangeListener from the button. |
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 |
setCriticalColor(nextapp.echo.Color newCriticalColor)
Sets the critical color used by the meter |
void |
setCriticalRange(java.lang.Number minCritical,
java.lang.Number maxCritical)
Sets the critical range for the dataset. |
void |
setHeight(int newValue)
Sets the height of the displayed chart. |
void |
setInsets(nextapp.echo.Insets newValue)
Sets the insets (margins) of the Thermometer |
void |
setModel(MeterModel newModel)
Sets the model to be used. |
void |
setNormalColor(nextapp.echo.Color newNormalColor)
Sets the normal color used by the meter |
void |
setNormalRange(java.lang.Number minNormal,
java.lang.Number maxNormal)
Sets the normal range for the dataset. |
void |
setRange(java.lang.Number min,
java.lang.Number max)
Sets the range for the dataset. |
void |
setUnits(java.lang.String newUnits)
Sets the "units" string associated with the Meter. |
void |
setValue(double value)
Sets the value. |
void |
setValue(java.lang.Number value)
Sets the value for the dataset. |
void |
setValueColor(nextapp.echo.Color newValueColor)
Sets the value color used by the meter |
void |
setValueFont(nextapp.echo.Font newValueFont)
Sets the value font used by the meter |
void |
setWarningColor(nextapp.echo.Color newWarningColor)
Sets the warning color used by the meter |
void |
setWarningRange(java.lang.Number minWarning,
java.lang.Number maxWarning)
Sets the warning range for the dataset. |
void |
setWidth(int newValue)
Sets the width of the displayed chart. |
void |
validate()
Validates this component. |
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 |
public static final java.lang.String STYLE_INSETS
nextapp.echo.Insets.
public static final java.lang.String STYLE_HEIGHT
int
public static final java.lang.String STYLE_WIDTH
int
public static final java.lang.String STYLE_CRITICAL_COLOR
Color
public static final java.lang.String STYLE_WARNING_COLOR
Color
public static final java.lang.String STYLE_NORMAL_COLOR
Color
public static final java.lang.String STYLE_VALUE_COLOR
Color
public static final java.lang.String STYLE_VALUE_FONT
Font
public static final java.lang.String MODEL_CHANGED_PROPERTY
public static final java.lang.String HEIGHT_CHANGED_PROPERTY
public static final java.lang.String WIDTH_CHANGED_PROPERTY
public static final java.lang.String IMAGE_CHANGED_PROPERTY
public static final java.lang.String INSETS_CHANGED_PROPERTY
public static final java.lang.String COLORS_CHANGED_PROPERTY
public static final java.lang.String UNITS_CHANGED_PROPERTY
protected MeterModel model
protected int width
protected int height
protected nextapp.echo.ImageReference image
protected nextapp.echo.Insets insets
protected java.lang.String units
protected nextapp.echo.Color criticalColor
protected nextapp.echo.Color warningColor
protected nextapp.echo.Color normalColor
protected nextapp.echo.Color valueColor
protected nextapp.echo.Font valueFont
protected boolean needsRedraw
Constructor Detail |
public AbstractMeterComponent()
Method Detail |
public void addChangeListener(nextapp.echo.event.ChangeListener l)
ChangeListener
to the button.
l
- The ChangeListener
to be added.public void applyStyle(nextapp.echo.Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in interface MouseCursorable
applyStyle
in class EchoPointComponent
Component.applyStyle(nextapp.echo.Style)
protected abstract nextapp.echo.ImageReference drawMeterImage()
public nextapp.echo.Color getCriticalColor()
public int getHeight()
public nextapp.echo.ImageReference getImage()
drawMeterImage
to create the required image.
public nextapp.echo.Insets getInsets()
public java.lang.Number getMaximumCriticalValue()
public java.lang.Number getMaximumNormalValue()
public java.lang.Number getMaximumValue()
public java.lang.Number getMaximumWarningValue()
public java.lang.Number getMinimumCriticalValue()
public java.lang.Number getMinimumNormalValue()
public java.lang.Number getMinimumValue()
public java.lang.Number getMinimumWarningValue()
public MeterModel getModel()
public nextapp.echo.Color getNormalColor()
public java.lang.String getUnits()
public java.lang.Number getValue()
public nextapp.echo.Color getValueColor()
public nextapp.echo.Font getValueFont()
public nextapp.echo.Color getWarningColor()
public int getWidth()
public void invalidate()
protected abstract boolean isImageRepresentation()
public void removeChangeListener(nextapp.echo.event.ChangeListener l)
ChangeListener
from the button.
l
- The ChangeListener
to be removed.public void setCriticalColor(nextapp.echo.Color newCriticalColor)
newCriticalColor
- nextapp.echo.Colorpublic void setCriticalRange(java.lang.Number minCritical, java.lang.Number maxCritical)
minCritical
- the new minimum.maxCritical
- the new maximum.public void setHeight(int newValue)
newValue
- The height.public void setInsets(nextapp.echo.Insets newValue)
Thermometer
newValue
- An insets object that specifies the size of each margin
of this Thermometer
public void setModel(MeterModel newModel)
newModel
- echopoint.meter.MeterModelpublic void setNormalColor(nextapp.echo.Color newNormalColor)
newNormalColor
- nextapp.echo.Colorpublic void setNormalRange(java.lang.Number minNormal, java.lang.Number maxNormal)
minNormal
- the new minimum.maxNormal
- the new maximum.public void setRange(java.lang.Number min, java.lang.Number max)
min
- the new minimum.max
- the new maximum.public void setUnits(java.lang.String newUnits)
newUnits
- java.lang.Stringpublic void setValue(double value)
value
- the new value.public void setValue(java.lang.Number value)
value
- the new value.public void setValueColor(nextapp.echo.Color newValueColor)
newValueColor
- nextapp.echo.Colorpublic void setValueFont(nextapp.echo.Font newValueFont)
newValueFont
- nextapp.echo.Fontpublic void setWarningColor(nextapp.echo.Color newWarningColor)
newWarningColor
- nextapp.echo.Colorpublic void setWarningRange(java.lang.Number minWarning, java.lang.Number maxWarning)
minWarning
- the new minimum.maxWarning
- the new maximum.public void setWidth(int newValue)
newValue
- The width.public void validate()
validate
in class EchoPointComponent
Component.validate()
public java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
ReflectionSetter
public Object set(Field f, Object newValue) throws Exception { Object oldValue = f.get(this); f.set(this,newValue); return oldValue; }
field
- - the field to be setnewValue
- - the new value to be set
java.lang.Exception
ReflectionSetter.set(Field, Object)
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |