public class IltMakePolyLinkInteractor extends IltMakeLinkInteractor
By default, this interactor creates multiple point links between the two nodes. To create multiple point links:
from
node
will become selected.
to
node to end the interaction.
Please note that as JTGO uses link layout algorithms to route links, multiple point links are set as fixed links, so that the layout algorithm does not reshape the link afterwards.
The following configuration is also available:
IltMakeLinkInteractor.setSelfLinkAllowed(boolean)
you
can specify that self-links can be created by this interactor.
Self-links are links where the from
and
to
nodes are the same. Please note that with
some link layout algorithms, such as IltShortLinkLayout
,
self-links are not well displayed.setAllowingMultiplePoints(boolean)
you
can specify that straight links will be created by this
interactor. Straight links are not marked as fixed by the layout.
You must select the nodes where the link will start and end by
pressing the mouse button on the from
node and releasing
it on the to
node. Straight links are laid out according to
the current link layout configuration.
When this interactor is set in a Network or Equipment component, the configuration
for the links created by this interactor will be stored in the component through a mutable
style sheet. Methods getStyleSheet(ilog.views.IlvManagerView)
,
attachStyleSheet(ilog.views.IlvManagerView)
and
detachStyleSheet(ilog.views.IlvManagerView)
are used to define the mutable
style sheet that will be used for the given view. By default, the mutable style
sheet used is the one specified for the component view (See IlpGraphView.getMutableStyleSheet()
.
This mutable style sheet is appended to the list of style sheets currently set in the
component. If later on, method setStyleSheets
is called, attention must be
taken to not erase any changes performed by this interactor.
While the interactor is attached to the view, method getStyleSheet()
can be used
to retrieve the current mutable style sheet and save it for future use.
IltMakeLinkInteractor.Gesture
Constructor and Description |
---|
IltMakePolyLinkInteractor()
Creates the interactor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
attach(IlvManagerView view)
Called when the interactor is attached to the manager view.
|
protected void |
attachStyleSheet(IlvManagerView view)
Initializes a mutable style sheet to the given view.
|
protected void |
detach()
Called when the interactor is detached from the view.
|
protected void |
detachStyleSheet(IlvManagerView view)
Ends the style sheet edition.
|
protected boolean |
endOnDoubleClick()
Returns
true if the interactor will stop
requesting points when the user performs a double-click. |
double |
getMinPointsDistance()
Returns the minimum distance between two created
points.
|
protected IlpMutableStyleSheet |
getStyleSheet()
Returns the mutable style sheet that is being used by this
interactor to save the modifications in the current attached
Network or Equipment components.
|
IlpMutableStyleSheet |
getStyleSheet(IlvManagerView view)
Returns the mutable style sheet used to store changes in
link port configuration for the given view.
|
boolean |
isAllowingMultiplePoints()
Returns
true if the interactor allows
more than two points to be entered. |
protected boolean |
isEnoughDistance(IlvPoint p1,
IlvPoint p2)
Checks the distance between two consecutive points that are created.
|
protected boolean |
numberOfPointsReached()
Returns
true if the number of desired points is reached. |
void |
setAllowingMultiplePoints(boolean allow)
Changes the number of points the user can select
with the interactor.
|
void |
setMinPointsDistance(double minDist)
Sets the minimum distance between two consecutive points.
|
protected void |
setStyleSheet(IlpMutableStyleSheet css)
Sets the mutable style sheet that is being used by this
interactor to save the modifications in the Network and
Equipment components.
|
accept, acceptDestination, acceptOrigin, drawGhost, getPortsColor, handleExpose, isLinkConnectionPortMode, isPermanent, isSelfLinkAllowed, processMouseEvent, processMouseMotionEvent, react, setLinkConnectionPortMode, setPermanent, setPortsColor, setSelfLinkAllowed, trigger, trigger
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, isXORGhost, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
public IltMakePolyLinkInteractor()
public boolean isAllowingMultiplePoints()
true
if the interactor allows
more than two points to be entered.
The default value is true
.setAllowingMultiplePoints(boolean)
public void setAllowingMultiplePoints(boolean allow)
allow
- If true
then the interactor allows
selecting several points; otherwise only two points are allowed.isAllowingMultiplePoints()
public final void setMinPointsDistance(double minDist)
The value of the parameter is in manager view (screen) coordinates.
This parameter does not apply to the distance between the first and the last point.
The default value is 5
.
getMinPointsDistance()
public final double getMinPointsDistance()
The default value is 5
.
setMinPointsDistance(double)
protected boolean isEnoughDistance(IlvPoint p1, IlvPoint p2)
isEnoughDistance
in class IltMakeLinkInteractor
IltMakePolyLinkInteractor
protected boolean numberOfPointsReached()
true
if the number of desired points is reached.
This method returns true
if the interactor allows only two
points to be selected (see the isAllowingMultiplePoints
member
function) and two points have been selected.numberOfPointsReached
in class IltMakeLinkInteractor
isAllowingMultiplePoints()
protected boolean endOnDoubleClick()
true
if the interactor will stop
requesting points when the user performs a double-click.
The default implementation returns true
when the interactor
allows more than two points to be entered; otherwise it returns
false
.
endOnDoubleClick
in class IltMakeLinkInteractor
protected void attach(IlvManagerView view)
IlvManagerViewInteractor
attach
in class IlvManagerViewInteractor
view
- The manager view.IlvManagerViewInteractor.detach()
protected void detach()
IlvManagerViewInteractor
detach
in class IlvManagerViewInteractor
IlvManagerViewInteractor.attach(ilog.views.IlvManagerView)
public IlpMutableStyleSheet getStyleSheet(IlvManagerView view)
view
- Manager viewnull
if the view has never been
edited before or is not able to use style sheet customization.IlpGraphView.getMutableStyleSheet()
protected IlpMutableStyleSheet getStyleSheet()
null
otherwise.protected void setStyleSheet(IlpMutableStyleSheet css)
This method must be called only when attaching this interactor to the view.
attachStyleSheet(ilog.views.IlvManagerView view)
protected void attachStyleSheet(IlvManagerView view)
view
- Manager viewprotected void detachStyleSheet(IlvManagerView view)
view
- Manager view© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.