public class IlvHyperEdgeEdition extends IlvObjectInteractor
IlvHyperEdge
.
The interactor allows you to move the ends of the hyperedge or to
remove ends of the hyperedge.
While the edge is selected, the following operations are implemented:
IlvHyperEdgeConnector
controls the end point of the hyperedge, it snaps to the closest point
allowed for this end by the hyperedge connector.
IlvHyperGrapher.getMinHyperEdgeEndCount()
), then the
end is not removed.
Constructor and Description |
---|
IlvHyperEdgeEdition()
Creates and initializes the interactor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterDrop(IlvHyperEdgeEnd end)
Called after we have dropped a hyperedge end.
|
protected void |
doRemoveEnd(IlvHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Removes an end of the hyperedge.
|
Cursor |
getConnectionPointCursor()
Returns the cursor when the mouse is on top of a connection point
but not dragging.
|
Cursor |
getDragCursor()
Returns the cursor used for dragging.
|
protected boolean |
handleButtonDown(IlvHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Handles
MOUSE_PRESSED events. |
protected boolean |
handleButtonDragged(IlvHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Handles
MOUSE_DRAGGED events. |
protected boolean |
handleButtonUp(IlvHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Handles
MOUSE_RELEASED events. |
protected boolean |
handleMouseMoved(IlvHyperEdgeSelection obj,
MouseEvent event,
IlvObjectInteractorContext context)
Handles
MOUSE_MOVED events. |
boolean |
isDragEndAllowed(IlvHyperEdgeEnd end)
Returns whether it is allowed to drag the hyperedge end.
|
static boolean |
isDragging(IlvManager manager)
Returns true if a segment of a hyperedge is currently dragged in the
manager.
|
protected void |
onDrag(IlvHyperEdgeEnd end)
Called when we are about to drag a hyperedge end.
|
void |
onEnter(IlvGraphic sel,
IlvObjectInteractorContext context)
Called when the selection is entered.
|
void |
onExit(IlvGraphic sel,
IlvObjectInteractorContext context)
Called when the selection is exited.
|
boolean |
processEvent(IlvGraphic obj,
AWTEvent event,
IlvObjectInteractorContext context)
Processes the events.
|
void |
setConnectionPointCursor(Cursor cursor)
Sets the cursor when the mouse is on top of a connection point
but not dragging.
|
void |
setDragCursor(Cursor cursor)
Sets the cursor used for dragging.
|
static void |
setDragging(IlvManager manager,
boolean flag)
Sets whether a segment of a hyperedge is currently dragged in the
manager.
|
protected boolean |
triggerChangeConnectionPoint(IlvHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if the end point of the hyperedge is allowed
to move while staying connected at the same node. |
protected boolean |
triggerChangeNode(IlvHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if the end point of the hyperedge should be
connected to a different node than the current node. |
protected boolean |
triggerRemoveEnd(IlvHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if the end point of the hyperedge should be
removed when clicking on the end point of the hyperedge. |
Get, handleExpose, Put
public IlvHyperEdgeEdition()
public Cursor getDragCursor()
public void setDragCursor(Cursor cursor)
public Cursor getConnectionPointCursor()
public void setConnectionPointCursor(Cursor cursor)
public boolean processEvent(IlvGraphic obj, AWTEvent event, IlvObjectInteractorContext context)
handleButtonDown
for a MOUSE_PRESSED event,
handleButtonUp
for a MOUSE_RELEASED event, or
handleButtonDragged
for a MOUSE_DRAGGED event.
handleMouseMoved
for a MOUSE_MOVED event.processEvent
in class IlvObjectInteractor
obj
- The graphic object.event
- The event to process.context
- The context in which the event occurred.true
if the event was handled
by this processEvent
invocation,
false
otherwise.handleButtonDown(ilog.views.hypergraph.IlvHyperEdgeSelection, java.awt.event.MouseEvent, ilog.views.IlvObjectInteractorContext)
,
handleButtonUp(ilog.views.hypergraph.IlvHyperEdgeSelection, java.awt.event.MouseEvent, ilog.views.IlvObjectInteractorContext)
,
handleButtonDragged(ilog.views.hypergraph.IlvHyperEdgeSelection, java.awt.event.MouseEvent, ilog.views.IlvObjectInteractorContext)
,
handleMouseMoved(ilog.views.hypergraph.IlvHyperEdgeSelection, java.awt.event.MouseEvent, ilog.views.IlvObjectInteractorContext)
protected boolean handleButtonDown(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
MOUSE_PRESSED
events.true
if the event has been processed,
false
otherwise.protected boolean triggerRemoveEnd(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if the end point of the hyperedge should be
removed when clicking on the end point of the hyperedge.
By default, it returns true if the control key and the shift key are
pressed simultaneously.protected void doRemoveEnd(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean handleButtonDragged(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
MOUSE_DRAGGED
events.true
if the event has been processed,
false
otherwise.protected void onDrag(IlvHyperEdgeEnd end)
end
- The hyperedge end to be dragged.protected boolean handleButtonUp(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
MOUSE_RELEASED
events.true
if the event has been processed,
false
otherwise.protected void afterDrop(IlvHyperEdgeEnd end)
protected boolean triggerChangeNode(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if the end point of the hyperedge should be
connected to a different node than the current node.
By default, it returns true if the control key is pressed.protected boolean triggerChangeConnectionPoint(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if the end point of the hyperedge is allowed
to move while staying connected at the same node.
By default, it returns true if the control key is pressed.protected boolean handleMouseMoved(IlvHyperEdgeSelection obj, MouseEvent event, IlvObjectInteractorContext context)
MOUSE_MOVED
events.true
if the event has been processed,
false
otherwise.public boolean isDragEndAllowed(IlvHyperEdgeEnd end)
end
- The hyperedge end to be dragged.public void onEnter(IlvGraphic sel, IlvObjectInteractorContext context)
IlvSelection.onEnter(ilog.views.IlvObjectInteractorContext)
).
The selection is entered if the select interactor moves the mouse over
the selection so that mouse events are dispatched to the object interactor
of this selection.
onEnter
in class IlvObjectInteractor
sel
- The selection object.context
- The context for the object interactor.IlvSelection.onEnter(ilog.views.IlvObjectInteractorContext)
public void onExit(IlvGraphic sel, IlvObjectInteractorContext context)
IlvSelection.onExit(ilog.views.IlvObjectInteractorContext)
).
The selection is exited if the select interactor moves the mouse to
a blanc area of the view, or to another selection so that mouse events
are not anymore dispatched to the object interactor of this selection.
onExit
in class IlvObjectInteractor
sel
- The selection object.context
- The context for the object interactor.IlvSelection.onExit(ilog.views.IlvObjectInteractorContext)
public static void setDragging(IlvManager manager, boolean flag)
public static boolean isDragging(IlvManager manager)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.