An interactor is a Java™ class that manages the behavior of
an object in response to an event. Rogue Wave® JViews Diagrammer
supplies various predefined interactors.
There are two types of interactor: view and
object. You can control the default interactor settings through the
style sheet.
![UML diagram
of the class relationships of the system-defined interactors.](../../JViews_Diagrammer/usrextdiag/_media/dia_predefined_interactors_default.png)
Predefined Interactors Class
Relationships
View interactors
View interactors affect the display in general. The view
interactors of JViews Framework are available in Rogue Wave
JViews Diagrammer to manage the zoom and pan facilities, and the
selection and creation of general nodes and general links. These
interactors are in the ilog.views.interactor package.
There are two object creation interactors
for SDM objects:
- IlvMakeSDMLinkInteractor, creates a new link in the data model.
These interactors create an object as a copy of a supplied
“model” object. For JViews Diagrammer applications, you can use
the palette bar class ( IlvDiagrammerPaletteBar ) to set up a
palette of model objects from which to create objects in a
diagram.
There is also another interactor for new
SDM objects:
- IlvEditSDMLabelInteractor allows you to edit the label of a new object as soon as it is created.
Object interactors
An object interactor is local to the graphic object. That means
it is possible to specify this type of interactor in the style sheet. There is a renderer called
Interactor
which fetches the
Interactor
graphic property from the style sheet to attach an
object interactor to the graphic object. The value of this
graphic property is the name of a class that subclasses IlvObjectInteractor. The object interactor
is then free to do whatever it wants, starting from the graphic
object. For example, the
InfoBalloon
renderer subclasses the
Interactor
renderer to display an enhanced tooltip.
Declaring a default interactor
You can enable the
Interactor
renderer in the style sheet. You can also define a default object
interactor for all nodes and links, see the following code
example:
The Interactor renderer and a default
interactor in the style sheet
SDM { Interactor : true ; } Interactor { interactor : "MyDefaultInteractor" ; }