The Rogue Wave JViews
library provides a predefined view interactor,
IlvSelectInteractor,
for selecting and editing graphic objects in a manager. This class
allows you to:
Select an object by clicking on it.
Select or deselect several objects using
Shift-Click.
Select several objects by dragging a
rectangle around them.
Move one or several objects by selecting
them and dragging the mouse.
Edit objects by manipulating their selection
object.
The interactor can be customized to your needs, as follows:
You can enable or disable multiselection
using:
public void setMultipleSelectionMode(boolean v)
You can select the mode for selecting
objects by dragging a rectangle around them: opaque or ghost:
public void setOpaqueDragSelection(boolean o)
public boolean isOpaqueDragSelection()
You can select the mode for moving graphic
objects: opaque or ghost:
public void setOpaqueMove(boolean o)
public boolean isOpaqueMove()
You can select the mode for resizing
graphic objects: opaque or ghost:
public void setOpaqueResize(boolean o)
public boolean isOpaqueDragSelection()
You can select the mode for editing
polypoint objects: opaque or ghost:
public void setOpaquePolyPointsEdition(boolean o)
public boolean isOpaqueDragSelection()
You can specify the modifier that allows
multiple selection:
public void setMultipleSelectionModifier(int m)
public boolean getMultipleSelectionModifier()
You can specify the modifier that allows
selection by dragging a rectangle starting from a point on top of
a graphic object:
public void setSelectionModifier(int m)
public boolean getSelectionModifier()
You can allow selection of several objects
using a dragged rectangle:
public void setDragAllowed(boolean v)
public boolean isDragAllowed()
You can change the ability to move objects
by:
public void setMoveAllowed(boolean v)
public boolean isMoveAllowed()
You can change the ability to edit objects
by:
public void setEditionAllowed(boolean v)
public boolean isEditionAllowed()
Note
The ability to move, edit, or select an object
can be controlled object by object using the properties of the object.
Many other customizations can be done by subclassing
the interactor and overriding the appropriate method.
The editing of a graphic object is controlled by an object
interactor. When a graphic object is selected, the manager can dispatch
events occurring on the selection object to the
object interactor attached to the selection object. This object
interactor is created by the selection object with a call to the
getDefaultInteractor method of the class
IlvSelection
.
When creating your own selection object, you can also create an object
interactor to edit the selected object. The default object interactor
is the class
IlvReshapeSelection, which allows the user to reshape graphic objects
by pulling the handles of the objects.