public class IlvSegmentedHyperEdgeEdition extends IlvHyperEdgeEdition
IlvSegmentedHyperEdge
.
The interactor allows you to move segments, to select segments, and
to split and join segments.
While the edge is selected, the following operations are implemented:
IlvHyperGrapher.getMinHyperEdgeEndCount()
), then the
end is not removed.
IlvHyperEdgeConnector
controls the end point of the hyperedge, it snaps to the closest point
allowed for this end by the hyperedge connector.
IlvSegmentedHyperEdge.splitSegment(IlvSegmentedHyperEdge.Segment, double, double, IlvTransformer)
,
IlvSegmentedHyperEdge.splitSegment(IlvSegmentedHyperEdge.Segment, IlvSegmentedHyperEdge.Segment, IlvTransformer)
,
IlvSegmentedHyperEdge.parallelSplitSegment(ilog.views.hypergraph.IlvSegmentedHyperEdge.Segment, double, double, ilog.views.IlvTransformer)
,
IlvSegmentedHyperEdge.joinSegments(ilog.views.hypergraph.IlvSegmentedHyperEdge.Segment, ilog.views.hypergraph.IlvSegmentedHyperEdge.Segment, ilog.views.IlvTransformer)
,
Serialized FormConstructor and Description |
---|
IlvSegmentedHyperEdgeEdition()
Creates and initializes the interactor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doChangeEndOrientation(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Changes the orientation of an end segment when clicked on or near the
end of the hyperedge.
|
protected void |
doCornerJoin(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Removes a corner when clicking at or near the corner, by joining two
segments incident to the corner.
|
protected void |
doDeSelection(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Deselects all selected segments.
|
protected void |
doInnerHandleSplitSegment(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Splits a segment at a join point when clicked on or near the join point
of two segments of a hyperedge.
|
protected void |
doMiddleSplitSegment(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Splits the segment under the mouse in the middle like a perpendicular
split.
|
protected void |
doMultiSelection(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Selects the segment under the mouse additionally, or deselects it when it
was selected.
|
protected void |
doParallelSplitSegment(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Splits the segment under the mouse in the middle like a parallel
split.
|
protected void |
doSelectedJoin(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Joins the two selected segments.
|
protected void |
doSingleSelection(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Selects the segment under the mouse exclusively, or deselects it when it
was selected.
|
Cursor |
getHorizontalSegmentCursor()
Returns the cursor when the mouse is on top of a horizontal segment
but not dragging.
|
Cursor |
getVariableSegmentCursor()
Returns the cursor when the mouse is on top of a variable segment
but not dragging.
|
Cursor |
getVerticalSegmentCursor()
Returns the cursor when the mouse is on top of a vertical segment
but not 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. |
boolean |
isDragInnerHandleAllowed(IlvSegmentedHyperEdge.Segment segment1,
IlvSegmentedHyperEdge.Segment segment2)
Returns whether it is allowed to drag inner handles.
|
boolean |
isDragSegmentAllowed(IlvSegmentedHyperEdge.Segment segment)
Returns whether it is allowed to drag this segment.
|
protected void |
onDrag(IlvSegmentedHyperEdge.Segment seg1,
IlvSegmentedHyperEdge.Segment seg2,
IlvHyperEdgeEnd end)
Called when we are about to drag a segment or an 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 |
setHorizontalSegmentCursor(Cursor cursor)
Sets the cursor when the mouse is on top of a horizontal segment
but not dragging.
|
void |
setVariableSegmentCursor(Cursor cursor)
Sets the cursor when the mouse is on top of a variable segment
but not dragging.
|
void |
setVerticalSegmentCursor(Cursor cursor)
Sets the cursor when the mouse is on top of a vertical segment
but not dragging.
|
protected boolean |
triggerChangeEndOrientation(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if the orientation of an end point
should change when clicking on the end point of the hyperedge. |
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 |
triggerCornerJoin(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if a corner should be removed by joining two
segments incident to the corner when clicking on the corner of the
hyperedge. |
protected boolean |
triggerDeSelection(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if clicking somewhere deselects all selected
segments. |
protected boolean |
triggerInnerHandleSplitSegment(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if a segment should be split when clicking
on a inner handle of the hyperedge. |
protected boolean |
triggerMiddleSplitSegment(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if clicking on a segment should split the
segment in the middle, like in a perpendicular split. |
protected boolean |
triggerMultiSelection(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if clicking on a segment selects this segment
additionally, or deselects it when it was selected. |
protected boolean |
triggerParallelSplitSegment(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if clicking on a segment should split the
segment like a parallel split. |
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. |
protected boolean |
triggerSelectedJoin(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if clicking on something should join the two
selected segments. |
protected boolean |
triggerSingleSelection(IlvSegmentedHyperEdgeSelection s,
MouseEvent event,
IlvObjectInteractorContext context)
Returns
true if clicking on a segment selects this segment
exclusively, or deselects it when it was selected. |
afterDrop, doRemoveEnd, getConnectionPointCursor, getDragCursor, handleMouseMoved, isDragEndAllowed, isDragging, onDrag, setConnectionPointCursor, setDragCursor, setDragging, triggerChangeConnectionPoint
Get, handleExpose, Put
public IlvSegmentedHyperEdgeEdition()
public Cursor getHorizontalSegmentCursor()
IlvSegmentedHyperEdge.Segment.getAngle()
public void setHorizontalSegmentCursor(Cursor cursor)
IlvSegmentedHyperEdge.Segment.getAngle()
public Cursor getVerticalSegmentCursor()
IlvSegmentedHyperEdge.Segment.getAngle()
public void setVerticalSegmentCursor(Cursor cursor)
IlvSegmentedHyperEdge.Segment.getAngle()
public Cursor getVariableSegmentCursor()
public void setVariableSegmentCursor(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 IlvHyperEdgeEdition
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)
,
IlvHyperEdgeEdition.handleMouseMoved(ilog.views.hypergraph.IlvHyperEdgeSelection, java.awt.event.MouseEvent, ilog.views.IlvObjectInteractorContext)
protected boolean handleButtonDown(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
MOUSE_PRESSED
events.handleButtonDown
in class IlvHyperEdgeEdition
true
if the event has been processed,
false
otherwise.protected boolean triggerChangeEndOrientation(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if the orientation of an end point
should change when clicking on the end point of the hyperedge.protected void doChangeEndOrientation(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerInnerHandleSplitSegment(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if a segment should be split when clicking
on a inner handle of the hyperedge.protected void doInnerHandleSplitSegment(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerMiddleSplitSegment(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if clicking on a segment should split the
segment in the middle, like in a perpendicular split.protected void doMiddleSplitSegment(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerParallelSplitSegment(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if clicking on a segment should split the
segment like a parallel split.protected void doParallelSplitSegment(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerSelectedJoin(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if clicking on something should join the two
selected segments.protected void doSelectedJoin(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerCornerJoin(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if a corner should be removed by joining two
segments incident to the corner when clicking on the corner of the
hyperedge.protected void doCornerJoin(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerSingleSelection(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if clicking on a segment selects this segment
exclusively, or deselects it when it was selected.protected void doSingleSelection(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerMultiSelection(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if clicking on a segment selects this segment
additionally, or deselects it when it was selected.protected void doMultiSelection(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
protected boolean triggerDeSelection(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
true
if clicking somewhere deselects all selected
segments.protected void doDeSelection(IlvSegmentedHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
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 boolean handleButtonDragged(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
MOUSE_DRAGGED
events.handleButtonDragged
in class IlvHyperEdgeEdition
true
if the event has been processed,
false
otherwise.protected void onDrag(IlvSegmentedHyperEdge.Segment seg1, IlvSegmentedHyperEdge.Segment seg2, IlvHyperEdgeEnd end)
null
.seg1
- The one segment to be affected by the dragging.
Can be null
.seg2
- The other segment to be affected by the dragging.
Can be null
.end
- The hyperedge end to be dragged.
Can be null
.protected boolean handleButtonUp(IlvHyperEdgeSelection s, MouseEvent event, IlvObjectInteractorContext context)
MOUSE_RELEASED
events.handleButtonUp
in class IlvHyperEdgeEdition
true
if the event has been processed,
false
otherwise.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.triggerChangeNode
in class IlvHyperEdgeEdition
public boolean isDragSegmentAllowed(IlvSegmentedHyperEdge.Segment segment)
true
.segment
- The segment to be dragged.public boolean isDragInnerHandleAllowed(IlvSegmentedHyperEdge.Segment segment1, IlvSegmentedHyperEdge.Segment segment2)
true
.segment1
- The one segment incident to the handle.segment2
- The other segment incident to the handle.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 IlvHyperEdgeEdition
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 IlvHyperEdgeEdition
sel
- The selection object.context
- The context for the object interactor.IlvSelection.onExit(ilog.views.IlvObjectInteractorContext)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.