public class IlvSDMLinkReconnector extends Object implements IlvSDMConstants, Serializable
IlvSDMLinkReconnector
lets
users interactively reconnect links to different
nodes in a manager view associated with an SDM
engine.ANCHOR_TAG
Constructor and Description |
---|
IlvSDMLinkReconnector(IlvSDMEngine engine,
IlvManagerView view)
Creates a new link reconnector associated with the specified
engine and the specified view.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptDestination(Object link,
Object destination)
This method is called to verify that an object is a
valid destination for the link.
|
protected boolean |
acceptOrigin(Object link,
Object origin)
This method is called to verify that an object is a
valid origin for the link.
|
protected void |
beginReconnection()
This method is called at the beginning of a reconnection
interaction.
|
protected void |
drawLineGhost(Graphics g)
This method draws the temporary line representing
the link during the interaction.
|
protected void |
endReconnection()
This method is called at the end of a reconnection
interaction.
|
IlvPoint |
getCurrentPoint()
Returns the current point where the user has dragged
the origin or the destination of the link.
|
IlvPoint |
getDestinationPoint()
Returns the destination connection point of the link.
|
IlvSDMEngine |
getEngine()
Returns the SDM engine with which this link reconnector
is associated.
|
Object |
getLink()
Returns the link that is being reconnected.
|
IlvPoint |
getOriginPoint()
Returns the origin connection point of the link.
|
IlvManagerView |
getView()
Returns the manager view with which this link reconnector
is associated.
|
protected void |
highlight(Object node)
This method is called to highlight a node when
the mouse pointer is over it.
|
boolean |
isEnabled()
Returns the flag indicating whether the link reconnector is enabled.
|
boolean |
isReconnectingOrigin()
Returns
true if the origin of the link
is being reconnected, or false if the
destination of the link is being reconnected. |
protected void |
reconnect(Object node)
This method reconnects the link to a new node.
|
void |
setEnabled(boolean enabled)
Enables or disables the link reconnector.
|
protected void |
unHighlight(Object node)
This method is called to dehighlight a node when
the mouse pointer is no longer over it.
|
public IlvSDMLinkReconnector(IlvSDMEngine engine, IlvManagerView view)
engine
- The SDM engine.view
- The manager view in which the reconnection of links
will be allowed.public IlvSDMEngine getEngine()
public IlvManagerView getView()
public void setEnabled(boolean enabled)
enabled
- If true
,
the link reconnector is enabled. Otherwise, links cannot
be reconnected in the associated view.public boolean isEnabled()
protected boolean acceptOrigin(Object link, Object origin)
If the method returns true
, the origin object
is accepted and the link can be connected to it.
Otherwise, the link cannot be connected to the origin object.
The default implementation always returns true
.
protected boolean acceptDestination(Object link, Object destination)
If the method returns true
, the destination object
is accepted and the link can be connected to it.
Otherwise, the link cannot be connected to the destination object.
The default implementation always returns true
.
protected void highlight(Object node)
node
- The node to highlight.protected void unHighlight(Object node)
node
- The node to dehighlight.protected void beginReconnection()
protected void endReconnection()
protected void reconnect(Object node)
setFrom
or
setTo
method
of the SDM data model, depending on the result of
isReconnectingOrigin()
.node
- The node to which the link is reconnected.protected void drawLineGhost(Graphics g)
g
- The graphic context.public Object getLink()
public boolean isReconnectingOrigin()
true
if the origin of the link
is being reconnected, or false
if the
destination of the link is being reconnected.public IlvPoint getOriginPoint()
public IlvPoint getDestinationPoint()
public IlvPoint getCurrentPoint()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.