Search this API

y.view
Class MoveSnapContext

java.lang.Object
  extended by y.view.AbstractSnapContext
      extended by y.view.MoveSnapContext

public class MoveSnapContext
extends AbstractSnapContext

A class that provides the context for mouse snapping during move operations. This class supports the moving of nodes and bends (both single bends, as well as orthogonal segments). Instances of this class are used in MoveSelectionMode, OrthogonalMoveBendsMode, and DropSupport.

 

Nested Class Summary
static class MoveSnapContext.MovingBendInfo
          Concrete subclass of MoveSnapContext.MovingInfo that describes the movement of a Bend.
static class MoveSnapContext.MovingInfo
          The abstract base class of the classes that describe items that will be moved in the context of the move operation that is described by the MoveSnapContext.
static class MoveSnapContext.MovingPortInfo
          Concrete subclass of MoveSnapContext.MovingInfo that describes the movement of a Port.
static class MoveSnapContext.MovingSegment
          A helper class that describes a moving segment.
 
Field Summary
static byte FIXED
          Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item stays fixed at its current location.
static byte MOVE_X
          Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item is moved in the direction of the x axis according to the interactive movement.
static byte MOVE_XY
          Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item is moved according to the interactive movement.
static byte MOVE_Y
          Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item is moved in the direction of the y axis according to the interactive movement.
 
Constructor Summary
MoveSnapContext()
          Creates a new instance of this class using no initial view.
MoveSnapContext(Graph2DView view)
          Creates a new instance of this class using the provided view for the initial view.
 
Method Summary
protected  void addFixedSnapLines(Node node, java.util.Collection snapLines, java.util.Collection fixedSegmentSnapLines)
          Callback method that collects SnapLines that are induced by a given node.
protected  void addNodeSnapLines(Node node, NodeRealizer realizer, java.util.Collection nodeSnapLines, java.util.Collection edgeSnapLines)
          Callback method that collects snap lines for fixed nodes that are currently visible.
 MoveSnapContext.MovingSegment addSegment(MoveSnapContext.MovingInfo segStart, MoveSnapContext.MovingInfo segEnd)
          Tries to add another segment to this instance based on two MoveSnapContext.MovingInfos.
 void addSegment(MoveSnapContext.MovingSegment segment)
          Adds another segment to this instance that should be considered during the adjustMouseCoordinates(y.geom.YPoint) This method can be used to provide this class with segments that cannot be easily obtained from the graph structure.
protected  void addTableGroupNodeSnapLines(Node node, TableGroupNodeRealizer realizer, java.util.Collection result, java.util.Collection edgeSnapLines)
          A specialized variant of addNodeSnapLines(y.base.Node, NodeRealizer, java.util.Collection, java.util.Collection) that will be used if the realizer of the node is a TableGroupNodeRealizer.
 YPoint adjustMouseCoordinates(YPoint newMouseCoordinates)
          Main method that can be called after initialization and before cleanUp() that will snap the coordinates and update the Drawables.
 void cleanUp()
          Needs to be called after the move operation has been finalized.
protected  void collectSnapLines(java.util.Collection fixedNodeSnapLines, java.util.Collection fixedSegmentSnapLines)
          This method will be called to collect all snap lines for the nodes and edges that will be used during the processing of adjustMouseCoordinates(y.geom.YPoint).
protected  SnapResult createGridSnapResult(YPoint initialMouseCoordinates, java.util.Collection nodesToBeMoved, java.util.Collection movingBendInfos, java.util.Collection movingPortInfos, DataProvider nodeLocations)
          Returns a snap result to be used for grid snapping.
 double getBendToBendDistance()
          Determines the distance for bends to snap to other bends.
 double getEdgeToEdgeDistance()
          Gets the preferred distance between edges.
 double getGridSnapDistance()
          Determines the snap distance for grid snapping.
 double getNodeToEdgeDistance()
          Gets the preferred distance between node borders and edge segments.
 double getNodeToNodeDistance()
          Gets the preferred distance between node borders.
 double getSnapLineExtension()
          Yields the amount by which snap lines that are induced by existing edge segments and node borders are being extended.
 void initializeMove(YPoint initialMouseCoordinates, java.util.Collection nodesToBeMoved, java.util.Collection movingBendInfos, java.util.Collection movingPortInfos, DataProvider nodeLocations)
          Prepares this instance to perform subsequent adjustments of the mouse coordinates during a move operation.
 boolean isInitialized()
          Checks whether this instance has been initializeMove(y.geom.YPoint, java.util.Collection, java.util.Collection, java.util.Collection, y.base.DataProvider) but not yet cleaned up.
 boolean isSnappingBendsToSnapLines()
          Whether this context will automatically snap the bends to snap lines.
 boolean isSnappingSegmentsToSnapLines()
          Determines whether this context will automatically snap orthogonal edge segments to snap lines.
 boolean isUsingCenterSnapLines()
          Determines whether this instance will try to align the centers of adjacent nodes so that their centers are equally far away from each other.
 boolean isUsingEquidistantSnapLines()
          Determines whether this instance will try to align moved nodes with adjacent nodes so that there is the same spacing between their borders.
 boolean isUsingFixedNodeSnapLines()
          Determines whether this context will use snap lines for the sides and centers of the fixed nodes.
 boolean isUsingGridSnapping()
          Determines whether this instance will try snap the centers of moved graph elements to the grid.
 boolean isUsingOrthogonalBendSnapping()
          Whether this context will automatically snap the movements of bends so that the two adjacent segments become horizontally or vertically oriented.
 boolean isUsingOrthogonalMovementConstraints()
          Whether this context will automatically snap the movement in such a way that the overall move gesture is constrained to the horizontal or vertical axis.
 boolean isUsingOrthogonalPortSnapping()
          Whether this context will automatically snap the movements of bends or nodes so that the first and last segments of edges become orthogonal.
 boolean isUsingSegmentSnapLines()
          Determines whether this mode should create snap lines for fixed orthogonal edge segments.
 void removeSegment(MoveSnapContext.MovingSegment tag)
          Removes a previously added segment from this instance.
 void setBendToBendDistance(double d)
          Specifies the distance for bends to snap to other bends.
 void setEdgeToEdgeDistance(double edgeToEdgeDistance)
          Sets the preferred distance between edges.
 void setGridSnapDistance(double gridSnapDistance)
          Sets the snap distance for grid snapping.
 void setNodeToEdgeDistance(double nodeToEdgeDistance)
          Sets the preferred distance between node borders and edge segments.
 void setNodeToNodeDistance(double nodeToNodeDistance)
          Sets the preferred distance between node borders.
 void setSnapLineExtension(double snapLineExtension)
          Sets the amount by which snap lines that are induced by existing edge segments and node borders are being extended.
 void setSnappingBendsToSnapLines(boolean snappingBendsToSnapLines)
          Determines whether this context will automatically snap the bends to snap lines.
 void setSnappingSegmentsToSnapLines(boolean snappingSegmentsToSnapLines)
          Determines whether this context will automatically snap orthogonal edge segments to snap lines.
 void setUsingCenterSnapLines(boolean usingCenterSnapLines)
          Sets whether this instance will try to align the centers of adjacent nodes so that their centers are equally far away from each other.
 void setUsingEquidistantSnapLines(boolean usingEquidistantSnapLines)
          Sets whether this instance will try to align moved nodes with adjacent nodes so that there is the same spacing between their borders.
 void setUsingFixedNodeSnapLines(boolean usingFixedNodeSnapLines)
          Sets whether this context will use snap lines for the sides and centers of the fixed nodes.
 void setUsingGridSnapping(boolean usingGridSnapping)
          Sets whether this instance will try snap the centers of moved graph elements to the grid.
 void setUsingOrthogonalBendSnapping(boolean usingOrthogonalBendSnapping)
          Determines whether this context will automatically snap the movements of bends so that the two adjacent segments become horizontally or vertically oriented.
 void setUsingOrthogonalMovementConstraints(boolean usingOrthogonalMovementConstraints)
          Determines whether this context will automatically snap the movement in such a way that the overall move gesture is constrained to the horizontal or vertical axis.
 void setUsingOrthogonalPortSnapping(boolean usingOrthogonalPortSnapping)
          Determines whether this context will automatically snap the movements of bends or nodes so that the first and last segments of edges become orthogonal.
 void setUsingSegmentSnapLines(boolean usingSegmentSnapLines)
          Determines whether this mode should create snap lines for fixed orthogonal edge segments.
 
Methods inherited from class y.view.AbstractSnapContext
addSnapLine, addSnapResult, clearAdditionalSnapLines, clearAdditionalSnapResults, collectFixedNodes, getAdditionalSnapLines, getDrawable, getInitialCoordinates, getSnapDistance, getSnapLineColor, getView, initialize, intersectsView, intersectsView, isRenderingSnapLines, processSnapResults, removeSnapResult, resetResults, setInitialCoordinates, setRenderingSnapLines, setSnapDistance, setSnapLineColor, setView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIXED

public static final byte FIXED
Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item stays fixed at its current location.

See Also:
MOVE_X, MOVE_Y, MOVE_XY, Constant Field Values

MOVE_X

public static final byte MOVE_X
Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item is moved in the direction of the x axis according to the interactive movement. This constant can be bitwise combined with MOVE_Y

See Also:
MOVE_Y, MOVE_XY, Constant Field Values

MOVE_Y

public static final byte MOVE_Y
Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item is moved in the direction of the y axis according to the interactive movement. This constant can be bitwise combined with MOVE_X

See Also:
MOVE_X, MOVE_XY, Constant Field Values

MOVE_XY

public static final byte MOVE_XY
Constant for use in MoveSnapContext.MovingInfo and its subclasses that indicates that an item is moved according to the interactive movement. This constant is a bitwise combination of MOVE_X and MOVE_Y.

See Also:
MOVE_X, MOVE_Y, Constant Field Values
Constructor Detail

MoveSnapContext

public MoveSnapContext()
Creates a new instance of this class using no initial view. The view needs to be set before this context can be initialized.


MoveSnapContext

public MoveSnapContext(Graph2DView view)
Creates a new instance of this class using the provided view for the initial view.

Parameters:
view - the view to use.
See Also:
initializeMove(y.geom.YPoint, java.util.Collection, java.util.Collection, java.util.Collection, y.base.DataProvider)
Method Detail

isInitialized

public boolean isInitialized()
Checks whether this instance has been initializeMove(y.geom.YPoint, java.util.Collection, java.util.Collection, java.util.Collection, y.base.DataProvider) but not yet cleaned up. Only initialized instances will perform useful tasks in adjustMouseCoordinates(y.geom.YPoint)


getSnapLineExtension

public double getSnapLineExtension()
Yields the amount by which snap lines that are induced by existing edge segments and node borders are being extended. The default is 40.0d

Returns:
The amount by which snap lines should be extended into the direction of both ends.

setSnapLineExtension

public void setSnapLineExtension(double snapLineExtension)
Sets the amount by which snap lines that are induced by existing edge segments and node borders are being extended. The default is 40.0d

Parameters:
snapLineExtension - The positive amount by which snap lines should be extended into the direction of both ends.

isUsingOrthogonalPortSnapping

public boolean isUsingOrthogonalPortSnapping()
Whether this context will automatically snap the movements of bends or nodes so that the first and last segments of edges become orthogonal. The default is true.


setUsingOrthogonalPortSnapping

public void setUsingOrthogonalPortSnapping(boolean usingOrthogonalPortSnapping)
Determines whether this context will automatically snap the movements of bends or nodes so that the first and last segments of edges become orthogonal. The default is true.


isSnappingSegmentsToSnapLines

public boolean isSnappingSegmentsToSnapLines()
Determines whether this context will automatically snap orthogonal edge segments to snap lines. The default is false.


setSnappingSegmentsToSnapLines

public void setSnappingSegmentsToSnapLines(boolean snappingSegmentsToSnapLines)
Determines whether this context will automatically snap orthogonal edge segments to snap lines. The default is false.


isUsingOrthogonalBendSnapping

public boolean isUsingOrthogonalBendSnapping()
Whether this context will automatically snap the movements of bends so that the two adjacent segments become horizontally or vertically oriented. The default is true.


setUsingOrthogonalBendSnapping

public void setUsingOrthogonalBendSnapping(boolean usingOrthogonalBendSnapping)
Determines whether this context will automatically snap the movements of bends so that the two adjacent segments become horizontally or vertically oriented. The default is true.


getBendToBendDistance

public double getBendToBendDistance()
Determines the distance for bends to snap to other bends.

The default is 0.0d which disables bend-to-bend snapping.

Returns:
the distance for bends to snap to other bends.
See Also:
setBendToBendDistance(double)

setBendToBendDistance

public void setBendToBendDistance(double d)
Specifies the distance for bends to snap to other bends.

The default is 0.0d which disables bend-to-bend snapping.

Parameters:
d - the distance for bends to snap to other bends.
See Also:
getBendToBendDistance()

isSnappingBendsToSnapLines

public boolean isSnappingBendsToSnapLines()
Whether this context will automatically snap the bends to snap lines. The default is false.


setSnappingBendsToSnapLines

public void setSnappingBendsToSnapLines(boolean snappingBendsToSnapLines)
Determines whether this context will automatically snap the bends to snap lines. The default is false.


isUsingOrthogonalMovementConstraints

public boolean isUsingOrthogonalMovementConstraints()
Whether this context will automatically snap the movement in such a way that the overall move gesture is constrained to the horizontal or vertical axis. The default is false.


setUsingOrthogonalMovementConstraints

public void setUsingOrthogonalMovementConstraints(boolean usingOrthogonalMovementConstraints)
Determines whether this context will automatically snap the movement in such a way that the overall move gesture is constrained to the horizontal or vertical axis. The default is false.


isUsingFixedNodeSnapLines

public boolean isUsingFixedNodeSnapLines()
Determines whether this context will use snap lines for the sides and centers of the fixed nodes. The default is true.

See Also:
addFixedSnapLines(y.base.Node, java.util.Collection, java.util.Collection)

setUsingFixedNodeSnapLines

public void setUsingFixedNodeSnapLines(boolean usingFixedNodeSnapLines)
Sets whether this context will use snap lines for the sides and centers of the fixed nodes. The default is true.

See Also:
addFixedSnapLines(y.base.Node, java.util.Collection, java.util.Collection)

isUsingSegmentSnapLines

public boolean isUsingSegmentSnapLines()
Determines whether this mode should create snap lines for fixed orthogonal edge segments. The default is false.


setUsingSegmentSnapLines

public void setUsingSegmentSnapLines(boolean usingSegmentSnapLines)
Determines whether this mode should create snap lines for fixed orthogonal edge segments. The default is false.


getEdgeToEdgeDistance

public double getEdgeToEdgeDistance()
Gets the preferred distance between edges. This will influence the creation of the segment snap lines. For each orthogonally oriented fixed segment there will be snap lines on the segment itself and to both sides of the segment at the specified distance. The default is 0.0d which disables parallel snap lines.


setEdgeToEdgeDistance

public void setEdgeToEdgeDistance(double edgeToEdgeDistance)
Sets the preferred distance between edges. This will influence the creation of the segment snap lines. For each orthogonally oriented fixed segment there will be snap lines on the segment itself and to both sides of the segment at the specified distance. A value of 0.0d disables snap lines parallel to edge segments.


getNodeToNodeDistance

public double getNodeToNodeDistance()
Gets the preferred distance between node borders. This will influence the creation of the node snap lines. For each fixed node there will be snap lines on the borders of the node itself and around the node at the specified distance. The default is 0.0d which disables distant snap lines around the nodes.


setNodeToNodeDistance

public void setNodeToNodeDistance(double nodeToNodeDistance)
Sets the preferred distance between node borders. This will influence the creation of the node snap lines. For each fixed node there will be snap lines on the borders of the node itself and around the node at the specified distance. The default is 0.0d which disables distant snap lines around the nodes.


getNodeToEdgeDistance

public double getNodeToEdgeDistance()
Gets the preferred distance between node borders and edge segments. This will influence the creation of the node snap lines. For each fixed node there will be snap lines on the borders of the node itself and around the node at the specified distance to which orthogonal edge segments can snap. The default is 0.0d which disables distant snap lines around the nodes for edge segments.


setNodeToEdgeDistance

public void setNodeToEdgeDistance(double nodeToEdgeDistance)
Sets the preferred distance between node borders and edge segments. This will influence the creation of the node snap lines. For each fixed node there will be snap lines on the borders of the node itself and around the node at the specified distance to which orthogonal edge segments can snap. The default is -1.0d which disables distant snap lines around the nodes for edge segments.


isUsingCenterSnapLines

public boolean isUsingCenterSnapLines()
Determines whether this instance will try to align the centers of adjacent nodes so that their centers are equally far away from each other. By default this feature is turned off. Note that there is another setting for distributing nodes evenly, so that there is the same spacing between their borders, not between their centers. This only makes a difference, if the nodes are not equally sized.


setUsingCenterSnapLines

public void setUsingCenterSnapLines(boolean usingCenterSnapLines)
Sets whether this instance will try to align the centers of adjacent nodes so that their centers are equally far away from each other. By default this feature is turned off. Note that there is another setting for distributing nodes evenly, so that there is the same spacing between their borders, not between their centers. This only makes a difference, if the nodes are not equally sized.


isUsingEquidistantSnapLines

public boolean isUsingEquidistantSnapLines()
Determines whether this instance will try to align moved nodes with adjacent nodes so that there is the same spacing between their borders. By default this feature is turned on. Note that there is another setting for distributing nodes evenly, so that there is the same spacing between their centers, not between their borders. This only makes a difference, if the nodes are not equally sized.


setUsingEquidistantSnapLines

public void setUsingEquidistantSnapLines(boolean usingEquidistantSnapLines)
Sets whether this instance will try to align moved nodes with adjacent nodes so that there is the same spacing between their borders. By default this feature is turned on. Note that there is another setting for distributing nodes evenly, so that there is the same spacing between their centers, not between their borders. This only makes a difference, if the nodes are not equally sized.


isUsingGridSnapping

public boolean isUsingGridSnapping()
Determines whether this instance will try snap the centers of moved graph elements to the grid. The grid width is determined by the view. The default is false.

See Also:
getGridSnapDistance()

setUsingGridSnapping

public void setUsingGridSnapping(boolean usingGridSnapping)
Sets whether this instance will try snap the centers of moved graph elements to the grid. The grid width is determined by the view. The default is false.

See Also:
setGridSnapDistance(double)

getGridSnapDistance

public double getGridSnapDistance()
Determines the snap distance for grid snapping. The default is 10.0d. Note: this is not the grid width, but a separate snap distance for grid snapping.

See Also:
isUsingGridSnapping()

setGridSnapDistance

public void setGridSnapDistance(double gridSnapDistance)
Sets the snap distance for grid snapping. The default is 10.0d. Note: this is not the grid width, but a separate snap distance for grid snapping.

See Also:
setUsingGridSnapping(boolean)

initializeMove

public void initializeMove(YPoint initialMouseCoordinates,
                           java.util.Collection nodesToBeMoved,
                           java.util.Collection movingBendInfos,
                           java.util.Collection movingPortInfos,
                           DataProvider nodeLocations)
Prepares this instance to perform subsequent adjustments of the mouse coordinates during a move operation.

Parameters:
initialMouseCoordinates - The mouse coordinates at the beginning of the operation.
nodesToBeMoved - The nodes that will be moved during the operation according to the movement of the mouse.
movingBendInfos - A collection of MoveSnapContext.MovingBendInfo instances that describe the movement of the bends that will be moved.
movingPortInfos - A collection of MoveSnapContext.MovingPortInfo instances that describe the movement of the ports that will be moved.
nodeLocations - The original location of the nodes in nodesToBeMoved. This DataProvider needs to yield for each node in the collection a Rectangle2D that describes the initial bounds of the node.

cleanUp

public void cleanUp()
Needs to be called after the move operation has been finalized. This cleans up internal data structures that have been initialized during the call to initializeMove(y.geom.YPoint, java.util.Collection, java.util.Collection, java.util.Collection, y.base.DataProvider).

Overrides:
cleanUp in class AbstractSnapContext

createGridSnapResult

protected SnapResult createGridSnapResult(YPoint initialMouseCoordinates,
                                          java.util.Collection nodesToBeMoved,
                                          java.util.Collection movingBendInfos,
                                          java.util.Collection movingPortInfos,
                                          DataProvider nodeLocations)
Returns a snap result to be used for grid snapping. This method is called during initialization for a move, if this snap context uses the grid. If the result is not null it is added to the list of snap results to be considered subsequently during the move. This method can be customized in subclasses.

Parameters:
initialMouseCoordinates - The mouse coordinates at the beginning of the operation.
nodesToBeMoved - The nodes that will be moved during the operation according to the movement of the mouse.
movingBendInfos - A collection of MoveSnapContext.MovingBendInfo instances that describe the movement of the bends that will be moved.
movingPortInfos - A collection of MoveSnapContext.MovingPortInfo instances that describe the movement of the ports that will be moved.
nodeLocations - The original location of the nodes in nodesToBeMoved. This DataProvider needs to yield for each node in the collection a Rectangle2D that describes the initial bounds of the node.
Returns:
a snap result or null
See Also:
initializeMove(YPoint, Collection, Collection, Collection, DataProvider), isUsingGridSnapping()

addSegment

public void addSegment(MoveSnapContext.MovingSegment segment)
Adds another segment to this instance that should be considered during the adjustMouseCoordinates(y.geom.YPoint) This method can be used to provide this class with segments that cannot be easily obtained from the graph structure. This method therefor will only be used for special purposes.

Parameters:
segment - a segment that will be moved by this instance.

addSegment

public MoveSnapContext.MovingSegment addSegment(MoveSnapContext.MovingInfo segStart,
                                                MoveSnapContext.MovingInfo segEnd)
Tries to add another segment to this instance based on two MoveSnapContext.MovingInfos.

See Also:
addSegment(y.view.MoveSnapContext.MovingSegment)

removeSegment

public void removeSegment(MoveSnapContext.MovingSegment tag)
Removes a previously added segment from this instance.

Parameters:
tag - a segment that has been added using addSegment(y.view.MoveSnapContext.MovingSegment) or addSegment(y.view.MoveSnapContext.MovingInfo, y.view.MoveSnapContext.MovingInfo), previously.

addNodeSnapLines

protected void addNodeSnapLines(Node node,
                                NodeRealizer realizer,
                                java.util.Collection nodeSnapLines,
                                java.util.Collection edgeSnapLines)
Callback method that collects snap lines for fixed nodes that are currently visible.

Parameters:
node - The node which will stay at its position during the move operation and for which snap lines shall be calculated.
realizer - The realizer of the node.
nodeSnapLines - The collection to which SnapLine instances should be added that will be used to test moving nodes against.
edgeSnapLines - The collection to which SnapLine instances should be added that will be used to test moving orthogonal segments against.

addTableGroupNodeSnapLines

protected void addTableGroupNodeSnapLines(Node node,
                                          TableGroupNodeRealizer realizer,
                                          java.util.Collection result,
                                          java.util.Collection edgeSnapLines)
A specialized variant of addNodeSnapLines(y.base.Node, NodeRealizer, java.util.Collection, java.util.Collection) that will be used if the realizer of the node is a TableGroupNodeRealizer.


collectSnapLines

protected void collectSnapLines(java.util.Collection fixedNodeSnapLines,
                                java.util.Collection fixedSegmentSnapLines)
This method will be called to collect all snap lines for the nodes and edges that will be used during the processing of adjustMouseCoordinates(y.geom.YPoint). This method is called by initializeMove(y.geom.YPoint, java.util.Collection, java.util.Collection, java.util.Collection, y.base.DataProvider) during initialization.

Parameters:
fixedNodeSnapLines - The collection to add all SnapLine instances to, that will be used by the moving nodes to snap to.
fixedSegmentSnapLines - The collection to add all SnapLine instances to, that will be used by the moving orthogonal edge segments to snap to.

adjustMouseCoordinates

public YPoint adjustMouseCoordinates(YPoint newMouseCoordinates)
Main method that can be called after initialization and before cleanUp() that will snap the coordinates and update the Drawables. This method should be called for each update in the mouse coordinates to determine the new coordinates. If snapping is temporarily disabled, AbstractSnapContext.resetResults() should be called, instead.

Parameters:
newMouseCoordinates - The coordinates of the mouse
Returns:
The snapped coordinates.
See Also:
AbstractSnapContext.resetResults()

addFixedSnapLines

protected void addFixedSnapLines(Node node,
                                 java.util.Collection snapLines,
                                 java.util.Collection fixedSegmentSnapLines)
Callback method that collects SnapLines that are induced by a given node. This method delegates to addNodeSnapLines(y.base.Node, NodeRealizer, java.util.Collection, java.util.Collection) if the corresponding node realizer intersects with the current view.

Parameters:
node - The node to collect snaplines for. This node will not be moved for the current context.
snapLines - The collection to add SnapLine instances to that will be used to snap other node borders against.
fixedSegmentSnapLines - The collection to add SnapLine instances to that will be used to snap orthogonal edge segments to.

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.