A RectangularRangeIndicator is used to represent a range of values on a scale. For adding this kind of indicator instance to the gauge, use the addIndicator method of RectangularScale.
See the dojox/dgauges/RectangularRangeIndicator reference documentation for more information.
Used across all instances a hash to cache attribute names and their getter and setter names.
The duration of the value change animation in milliseconds. Default is 0. The animation occurs on both user interactions and programmatic value changes. Set this property to 0 to disable animation.
The easer function of the value change animation. Default is fx._defaultEasing.
The thickness in pixels of the shape at the position defined by the value property. Default is 10.
A fill object that will be passed to the setFill method of GFX.
How to interact with the indicator using mouse or touch interactions. Can be "indicator", "gauge", "area" or "none". The default value is "gauge". If set to "indicator", the indicator shape reacts to mouse and touch events. If set to "gauge", the whole gauge reacts to mouse and touch events. If set to "area", the whole bounding box of the widget reacts to mouse and touch events. If "none", interactions are disabled.
The bottom padding. Not used for vertical gauges.
The left padding. Not used for horizontal gauges.
The right padding. Not used for horizontal gauges.
The top padding. Not used for vertical gauges.
The start value of the range. Default is 0.
The thickness in pixels of the shape at the position defined by the start property. Default is 10.
A stroke object that will be passed to the setStroke method of GFX.
Internal helper for directly changing an attribute value.
Directly change the value of an attribute on an object, bypassing any accessor setter. Also handles the calling of watch and emitting events. It is designed to be used by descendant class when there are two values of attributes that are linked, but calling .set() is not appropriate.
Parameter | Type | Description |
---|---|---|
name | String | The property to set. |
value | Mixed | The value to set in the property. |
Internal helper for directly changing an attribute value.
Internal method.
Parameter | Type | Description |
---|---|---|
target | undefined |
Internal method.
Parameter | Type | Description |
---|---|---|
indicator | undefined | |
group | undefined | |
scale | undefined | |
startX | undefined | |
startY | undefined | |
endPosition | undefined | |
startThickness | undefined | |
endThickness | undefined | |
fill | undefined | |
stroke | undefined |
Internal method.
Parameter | Type | Description |
---|---|---|
indicator | undefined | |
group | undefined | |
scale | undefined | |
startX | undefined | |
startY | undefined | |
endPosition | undefined | |
startThickness | undefined | |
endThickness | undefined | |
fill | undefined | |
stroke | undefined |
Private function that does a get based off a hash of names
Parameter | Type | Description |
---|---|---|
name | undefined | |
names | undefined | Hash of names of custom attributes |
Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.
Parameter | Type | Description |
---|---|---|
name | undefined |
Internal method.
Parameter | Type | Description |
---|---|---|
indicator | undefined | |
group | undefined | |
scale | undefined | |
startX | undefined | |
startY | undefined | |
endPosition | undefined | |
startThickness | undefined | |
endThickness | undefined | |
fill | undefined | |
stroke | undefined |
Internal method.
Parameter | Type | Description |
---|---|---|
prop | undefined | |
oldValue | undefined | |
newValue | undefined |
Add properties to the watched properties to trigger invalidation. This method must be called in the constructor. It is typically used by subclasses of a _Invalidating class to add more properties to watch for.
Parameter | Type | Description |
---|---|---|
properties | String[] | The list of properties to watch for. |
Get a property on a Stateful instance.
Get a named property on a Stateful object. The property may potentially be retrieved via a getter method in subclasses. In the base class this just retrieves the object's property.
Parameter | Type | Description |
---|---|---|
name | String | The property to get. |
The property value on this Stateful instance.
require(["dojo/Stateful", function(Stateful) { var stateful = new Stateful({foo: 3}); stateful.get("foo") // returns 3 stateful.foo // returns 3 });
Invalidating the rendering for the next executation frame.
Set a property on a Stateful instance
Sets named properties on a stateful object and notifies any watchers of the property. A programmatic setter may be defined in subclasses.
Parameter | Type | Description |
---|---|---|
name | String | The property to set. |
value | Object | The value to set in the property. |
The function returns this dojo.Stateful instance.
require(["dojo/Stateful", function(Stateful) { var stateful = new Stateful(); stateful.watch(function(name, oldValue, value){ // this will be called on the set below } stateful.set(foo, 5);
set() may also be called with a hash of name/value pairs, ex:
stateful.set({ foo: "Howdy", bar: 3 }); });
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
Immediately validate the rendering if it has been invalidated. You generally do not call that method yourself.
Invoked when the value of the indicator changes. User can connect an listener on this function:
theIndicator.on("valueChanged", lang.hitch(this, function(){ //do something }));
Parameter | Type | Description |
---|---|---|
indicator | undefined |
Watches a property for changes
Parameter | Type | Description |
---|---|---|
name | String |
Optional Indicates the property to watch. This is optional (the callback may be the only parameter), and if omitted, all the properties will be watched |
callback | Function | The function to execute when the property changes. This will be called after the property has been changed. The callback will be called with the |this| set to the instance, the first argument as the name of the property, the second argument as the old value and the third argument as the new value. |
An object handle for the watch. The unwatch method of this object can be used to discontinue watching this property:
var watchHandle = obj.watch("foo", callback); watchHandle.unwatch(); // callback won't be called now
Internal method.
Parameter | Type | Description |
---|---|---|
event | undefined |
require(["dojo/Stateful", function(Stateful) { var stateful = new Stateful(); stateful.watch(function(name, oldValue, value){ // this will be called on the set below } stateful.set(foo, 5);
set() may also be called with a hash of name/value pairs, ex:
stateful.set({ foo: "Howdy", bar: 3 }); });
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
Internal method.
Parameter | Type | Description |
---|---|---|
event | undefined |
require(["dojo/Stateful", function(Stateful) { var stateful = new Stateful(); stateful.watch(function(name, oldValue, value){ // this will be called on the set below } stateful.set(foo, 5);
set() may also be called with a hash of name/value pairs, ex:
stateful.set({ foo: "Howdy", bar: 3 }); });
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
Internal method.
Parameter | Type | Description |
---|---|---|
event | undefined |
require(["dojo/Stateful", function(Stateful) { var stateful = new Stateful(); stateful.watch(function(name, oldValue, value){ // this will be called on the set below } stateful.set(foo, 5);
set() may also be called with a hash of name/value pairs, ex:
stateful.set({ foo: "Howdy", bar: 3 }); });
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)