abstract class %ZEN.SVGComponent.meter
extends svgComponent, %ZEN.Component.dataView
Base class for SVG meter components.
A meter is analogous to a control: it has a value
as well as upper and lower ranges and thresholds. The
display of the value is implemented by subclasses.
parameter DEFAULTVIEWBOXHEIGHT = 100;
Default viewBoxHeight of this component.
This is set to 100 to provide a fixed coordinate system for meters.
parameter DEFAULTVIEWBOXWIDTH = 100;
Default viewBoxWidth of this component.
This is set to 100 to provide a default, fixed coordinate system for meters.
property animate
as %ZEN.Datatype.boolean [ InitialExpression = 1 ];
If this meter supports animation, then this controls whether the animation
is on or off.
property dataBinding
as %ZEN.Datatype.string;
Optional. If this meter is associated with
a %ZEN.Auxiliary.dataController, this specifies the name of the property within the dataController
that will provide the value for this control.
property disabled
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, disable this meter.
property label
as %ZEN.Datatype.caption;
Label displayed by the meter.
property labelStyle
as %ZEN.Datatype.svgStyle;
Optional: CSS style applied to the meter label.
property onchange
as %ZEN.Datatype.eventHandler;
onchange event handler:
For meters that allow user actions to modify their value,
this event handler is called when the user changes the value of the slider.
property rangeLower
as %ZEN.Datatype.string;
Represents the lower value of the meter range.
If this value is numeric, then it is used as the value.
If it is a string, then it is used as the name of a property within the
data source connected to this meter.
property rangeUpper
as %ZEN.Datatype.string;
Represents the upper value of the meter range.
If this value is numeric, then it is used as the value.
If it is a string, then it is used as the name of a property within the
data source connected to this meter.
property scaleFactor
as %ZEN.Datatype.float [ InitialExpression = 1 ];
The displayed value is determined by multiplying the actual
value and this scaling factor.
property showConditionally
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, hide this meter if it is bound to a non-existant data property.
property targetValue
as %ZEN.Datatype.string;
If defined, this is the target value for the meter.
If this value is numeric, then it is used as the target value.
If it is a string, then it is used as the name of a property within the
data source connected to this meter.
Certain meters may display this value.
property thresholdLower
as %ZEN.Datatype.string;
Represents the lower threshold level for the meter.
If this value is numeric, then it is used as the value.
If it is a string, then it is used as the name of a property within the
data source connected to this meter.
property thresholdUpper
as %ZEN.Datatype.string;
Represents the upper threshold level for the meter.
If this value is numeric, then it is used as the value.
If it is a string, then it is used as the name of a property within the
data source connected to this meter.
property value
as %ZEN.Datatype.string [ InitialExpression = 0 ];
Current value of the meter.
method acquireData()
[ Language = javascript ]
Acquire data for this meter.
If the meter is connected to a dataController, then set the
value of the meter to the current value of the dataController
property specified by dataBinding.
method getLabelText()
[ Language = javascript ]
Return the resolved label to display for this meter.
method getValue()
[ Language = javascript ]
Short-cut method to get the current value of this meter.
method notifyViewHandler(reason, data1, data2, data3)
[ Language = javascript ]
Notification that the dataController associated with this dataView
has raised an event.
method onchangeHandler()
[ Language = javascript ]
This built-in event handler is called by meters that allow user
interaction. It raises notification that the meter's value has changed.
final method renderContents()
[ Language = javascript ]
Render the inner SVG contents of this component.
method renderLabel(x, y)
[ Language = javascript ]
Create the label displayed by this meter.
Subclasses should call this from their renderx and y specify the midpoint of the label.
method renderMeter()
[ Language = javascript ]
Render the inner SVG contents of this component.
Subclasses should implement this method.
method setProperty(property, value, value2)
[ Language = javascript ]
Set the value of a named property.
method setValue(value)
[ Language = javascript ]
Short-cut method to set the current value of this meter.