Class adf.Action
Defined in: Action.js.
Constructor Attributes | Constructor Name and Description |
---|---|
A base class that handles user interaction with the mouse, keyboard or any other input
device.
|
Field Attributes | Field Name and Description |
---|---|
The value applied to the CSS
cursor property of the HTML element that is the target
of the action. |
|
A string description of this adf.Action.
|
|
The default adf.GraphicsSymbol used when drawing to the adf.graphics.Element
|
Method Attributes | Method Name and Description |
---|---|
activate()
Each implementation of adf.Action should use this function to register event handlers
for the user interaction it is trying to capture.
|
|
Each implementation of adf.Action should use this function to remove event handlers that
may have been registered in adf.Action#activate.
|
|
Each implementation of adf.Action should use this function to re-register event handlers,
given that this adf.Action#activate was called previously and adf.Action#deactivate
was never called afterwards to clean up any event handlers.
|
Class Detail
adf.Action()
A base class that handles user interaction with the mouse, keyboard or any other input
device. The user interaction can be either a single event like pressing a key, or a series of
logical events like clicking-and-dragging an HTML element. Subclasses of Action define
different types of user interaction that are handled out-of-the-box.
As a base class, adf.Action defines three functions
activate()
,
deactivate()
and reactivate()
to be used by consumers of
this adf.Action to start, stop handling the interaction respectively. Consumers
of adf.Action are typically implementations of adf.ToolItem.
Field Detail
cursor
The value applied to the CSS
cursor
property of the HTML element that is the target
of the action. For example, an Action that drags an element may want to change the cursor to
one that looks like a hand.
- Default Value:
- crosshair
{Integer}
graphicsZIndex
The CSS
z-index
property value for the adf.graphics.Element created by this
adf.Action. This value is used only when a adf.graphics.Element is created
internally in this action, as opposed to having one passed as a parameter.
This property is only relevant for those Action implementations that draw graphics.
- Default Value:
- 49
{String}
name
A string description of this adf.Action.
- Default Value:
- "adf.Action"
{adf.graphics.Element
This property is only relevant for those Action implementations that draw graphics.}
symbol
The default adf.GraphicsSymbol used when drawing to the adf.graphics.Element
- Default Value:
-
{ lineColor: "#f00", lineOpacity: 1, lineWidth: 2, fillColor: "#fff", fillOpacity: 0 }
Method Detail
activate()
Each implementation of adf.Action should use this function to register event handlers
for the user interaction it is trying to capture.
It is neccessary to unregister each one of these handlers in adf.Action#deactivate.
The default implementation contains no functionality (just an empty function).
deactivate()
Each implementation of adf.Action should use this function to remove event handlers that
may have been registered in adf.Action#activate. The default implementation contains no
functionality (just an empty function).
reactivate()
Each implementation of adf.Action should use this function to re-register event handlers,
given that this adf.Action#activate was called previously and adf.Action#deactivate
was never called afterwards to clean up any event handlers. The default implementation contains
no functionality (just an empty function).