You have seen that symbols have the ability to alter
their visual aspect using parameters and conditions. This ability
is useful for creating rich graphic objects such as dials or meters,
for monitoring activities. Another useful aspect of GUI objects is
to be able to respond to user actions using interactors. An interactor
is used to create interactive objects by specifying how user actions
can alter the value of a symbol parameter.
This mechanism works as a loop. A user interaction modifies
the value of a parameter, this new value is processed by the symbol
in order to give the appropriate visual feedback. Both actions in
this loop are completely independent, that is, the interaction does
not need to 'know' what the visual effect is.
A symbol interactor detects and processes input done
by the user on a symbol. This is in the form of mouse events on the
graphical representation of a symbol.
An interactor does one of the following:
Uses the mouse event to change the value
of a parameter in the symbol. Objects bound to the parameter are transformed
according to this change in value.
Passes the event to the object as a
condition. This is used for Push and Discrete interactors.
The different kinds of interactions available are:
Discrete: Increments or decrements the
value of a parameter by a specific amount on a mouse click event.
Parameter change is limited by maximum and minimum values.
Push: Reacts to mouse BUTTON_UP, BUTTON_DOWN,
and BUTTON_CLICKED events on a symbol. It sets the value of a string
parameter in order to indicate the new state that the symbol could
display.
Horizontal: Changes the value of a parameter
when an object is clicked and dragged horizontally. The change in
parameter value depends on the distance the object is dragged. Parameter
change is limited by maximum and minimum values.
Vertical: Changes the value of a parameter
when an object is clicked and dragged vertically. The change in parameter
value depends on the distance the object is dragged. Parameter change
is limited by maximum and minimum values.
Rotation: Changes the value of a parameter
when an object is clicked and rotated. The change in parameter value
depends on the distance the object is dragged. Parameter change is
limited by maximum and minimum values.
Discrete, Horizontal, Vertical, and Rotation interactors
work in the same way. They respond to a mouse event by changing the
value of a symbol parameter. This means that, although the interactor
is applied to a specific object, the change occurs to any object bound
to the parameter. Push interactors use conditions to transform the
object clicked. When a condition has been created for a push interactor,
it can be used to make simultaneous changes in multiple objects.