public class IlvSDMPaletteConnector extends Object implements Serializable
IlvSDMPaletteConnector
connects two manager
views associated with two SDM engines, so that the first view can be
used as a palette to create new objects in the second view.
To create new objects, the user clicks an object of the palette (without dragging the mouse). If the object is a node, the user clicks again in the editor view to create the node. If the object is a link, the user must first click the source node, and then the destination node.
In point-and-click mode, the user can double-click the object in the palette to make the creation interactor persistent. This allows the creation of a series of objects of the same type without reclicking each time in the palette. To stop creating objects, the user clicks the palette background, or single-clicks another object.
By default, the palette connector uses instances of the classes
IlvMakeSDMNodeInteractor
and
IlvMakeSDMLinkInteractor
to
create nodes and links in the target view. If you want to use your own
subclasses of these interactors instead, you can use the methods
setMakeNodeInteractor(ilog.views.sdm.interactor.IlvMakeSDMNodeInteractor)
and setMakeLinkInteractor(ilog.views.sdm.interactor.IlvMakeSDMLinkInteractor)
.
Alternately, you can set a factory on the target SDM view using the
method IlvSDMView.setUtilitiesFactory(ilog.views.sdm.util.IlvSDMUtilitiesFactory)
.
IlvMakeSDMNodeInteractor
,
IlvMakeSDMLinkInteractor
,
Serialized FormConstructor and Description |
---|
IlvSDMPaletteConnector(IlvSDMEngine paletteEngine,
IlvManagerView paletteView,
IlvManagerView targetView)
Creates a new palette connector associated with the specified
engine, the specified palette view, and the specified target view.
|
Modifier and Type | Method and Description |
---|---|
IlvMakeSDMLinkInteractor |
getMakeLinkInteractor()
Returns the interactor that creates SDM links in the target view.
|
IlvMakeSDMNodeInteractor |
getMakeNodeInteractor()
Returns the interactor that creates SDM nodes in the target view.
|
IlvSDMEngine |
getPaletteEngine()
Returns the SDM engine containing the objects of the palette.
|
IlvManagerView |
getPaletteView()
Returns the manager view displaying the palette.
|
IlvManagerView |
getTargetView()
Returns the target manager view with which this palette is associated.
|
boolean |
isEnabled()
Returns the flag indicating whether the drag source is enabled.
|
void |
setEnabled(boolean enabled)
Enables or disables the palette interactors.
|
void |
setMakeLinkInteractor(IlvMakeSDMLinkInteractor interactor)
Changes the interactor that creates SDM links in the target view.
|
void |
setMakeNodeInteractor(IlvMakeSDMNodeInteractor interactor)
Changes the interactor that creates SDM nodes in the target view.
|
void |
setTargetView(IlvManagerView targetView)
Sets the target manager view with which this palette is associated.
|
void |
setTargetView(IlvManagerView targetView,
AWTEvent event)
Sets the target manager view with which this palette is associated.
|
public IlvSDMPaletteConnector(IlvSDMEngine paletteEngine, IlvManagerView paletteView, IlvManagerView targetView)
paletteEngine
- The SDM engine containing the palette objects.paletteView
- The manager view used as a palette.targetView
- The manager view with which this palette is associated.
The target view can be initially null
, and it can be changed
later by calling setTargetView(ilog.views.IlvManagerView)
.public IlvSDMEngine getPaletteEngine()
public IlvManagerView getPaletteView()
public void setEnabled(boolean enabled)
enabled
- If true
,
the creation interactors are enabled. Otherwise, no
objects can be created using the palette.public boolean isEnabled()
public void setMakeNodeInteractor(IlvMakeSDMNodeInteractor interactor)
IlvMakeSDMNodeInteractor
.
By default, an instance of IlvMakeSDMNodeInteractor
is used.interactor
- The new interactor.public IlvMakeSDMNodeInteractor getMakeNodeInteractor()
public void setMakeLinkInteractor(IlvMakeSDMLinkInteractor interactor)
IlvMakeSDMLinkInteractor
.
By default, an instance of IlvMakeSDMLinkInteractor
is used.interactor
- The new interactor.public IlvMakeSDMLinkInteractor getMakeLinkInteractor()
public void setTargetView(IlvManagerView targetView)
When the user clicks an object in the palette, an
IlvMakeSDMNodeInteractor
or a
IlvMakeSDMLinkInteractor
will be set on the target view to create a new node or a new
link, depending on the object selected in the palette.
If the palette connector was previously attached to another target view, and if the old target view had an SDM object creation interactor active, the interactor is reattached to the new target view.
targetView
- The manager view with which this palette is associated.public void setTargetView(IlvManagerView targetView, AWTEvent event)
This method is similar to setTargetView(ilog.views.IlvManagerView)
,
except that it has an additional event argument. This event is typically
a mouse click that caused the target view to become active in a multidocument
application. The event will be dispatched right away to the new SDM object
creation interactor, so that you can change the active view and create
the object in a single click.
targetView
- The manager view with which this palette is associated.event
- An AWT event that will be dispatched right away to the
new SDM object creation interactor.public IlvManagerView getTargetView()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.