Packagecom.yworks.graph.input.snapLines
Classpublic class GraphSnapContext
InheritanceGraphSnapContext Inheritance SnapContext Inheritance flash.events.EventDispatcher

Concrete SnapContext implementation which handles snapping movement for IGraph items. This class provides a set of properties that determine the way snapping operations are being performed in the context of IGraphs. IPositionHandler implementations and the like can use the following idiom to retrieve instances of this class:
     var snapContext:GraphSnapContext = inputModeContext.lookup(SnapContext) as GraphSnapContext;
     if (snapContext != null && snapContext.isInitializing) {
     ...
     

See also

com.yworks.canvas.input.snapLines.SnapContext
IGraph
IPositionHandler
GraphEditorInputMode
MainInputMode.snapContext


Public Properties
 PropertyDefined By
  additionalSnapLines : Iterable
[read-only] The collection of additional SnapLines.
GraphSnapContext
  bendGridConstraintProvider : IBendGridConstraintProvider
Determines the grid constraint provider for the IBends.
GraphSnapContext
  collectEdgeSnapLines : Boolean
Determines whether this instance should collect fixed snap lines for edge segments.
GraphSnapContext
  collectNodePairCenterSnapLines : Boolean
Determines whether this instance will try to align the centers of adjacent nodes so that their centers are equally far away from each other.
GraphSnapContext
  collectNodePairSegmentSnapLines : Boolean
Determines whether this instance will collect pairs of adjacent nodes and add snapping logic so that moved edge segments will snap so that the distances to the adjacent nodes are equal.
GraphSnapContext
  collectNodePairSnapLines : Boolean
Determines whether this instance will collect pairs of adjacent nodes and add snapping logic so that moved nodes will snap so that the distances to the adjacent nodes are equal.
GraphSnapContext
  collectNodeSizes : Boolean
Determines whether this instance should collect the sizes of fixed nodes.
GraphSnapContext
  collectNodeSnapLines : Boolean
Determines whether this instance should collect fixed snap lines for nodes.
GraphSnapContext
  collectPortSnapLines : Boolean
Determines whether this instance should collect fixed snap lines for ports.
GraphSnapContext
  cropSnapLines : Boolean
Whether to crop the snap lines at obstacles.
GraphSnapContext
 InheritedcurrentInputModeContext : IInputModeContext
[read-only] Gets the current input mode context.
SnapContext
  edgeToEdgeDistance : Number
Determines the preferred distance between edges.
GraphSnapContext
 Inheritedenabled : Boolean
Gets or sets a value indicating whether this SnapContext is enabled.
SnapContext
  fixedNodeSnapLines : Iterable
[read-only] The collection of SnapLines for fixed nodes.
GraphSnapContext
  fixedPortSnapLines : Iterable
[read-only] The collection of SnapLines to which ports should be snapping.
GraphSnapContext
  fixedSegmentSnapLines : Iterable
[read-only] The collection of SnapLines for fixed edge segments.
GraphSnapContext
  gridSnapDistance : Number
Gets or sets the global grid snap distance, which is the maximum distance between the current mouse coordinates and the coordinates to which the mouse will snap.
GraphSnapContext
  gridSnapType : uint
Determines to what grid elements an object should snap.
GraphSnapContext
 InheritedisInitialized : Boolean
[read-only] Whether the context is initialized.
SnapContext
 InheritedisInitializing : Boolean
[read-only] Gets a value indicating whether this instance is currently initializing.
SnapContext
  nodeGridConstraintProvider : INodeGridConstraintProvider
Determines the grid constraint provider for the INodes.
GraphSnapContext
  nodesToBeMovedCount : int
[read-only]
GraphSnapContext
  nodeToEdgeDistance : Number
Determines the preferred distance between node borders and edge segments.
GraphSnapContext
  nodeToNodeDistance : Number
Determines the preferred distance between node borders.
GraphSnapContext
 InheritedoriginalLocation : IPoint
[read-only] Gets the original location of the mouse at the time the gesture was initialized.
SnapContext
  portGridConstraintProvider : IPortGridConstraintProvider
Determines the grid constraint provider for the IPorts.
GraphSnapContext
  snapBendAdjacentSegments : Boolean
Whether this context will automatically snap the movements of bends so that the two adjacent segments become horizontally or vertically oriented.
GraphSnapContext
  snapBendsToSnapLines : Boolean
Determines whether this context will automatically snap the bends to snap lines.
GraphSnapContext
 InheritedsnapDistance : Number
Gets or sets the global snap distance, which is the maximum distance between the current mouse coordinates and the coordinates to which the mouse will snap.
SnapContext
  snapLineExtension : Number
The amount by which snap lines that are induced by existing edge segments and node borders are being extended.
GraphSnapContext
  snapNodesToSnapLines : Boolean
Determines whether this context will automatically snap the nodes to snap lines.
GraphSnapContext
  snapOrthogonalMovement : Boolean
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.
GraphSnapContext
  snapPortAdjacentSegments : Boolean
Whether this context will automatically snap the movements of nodes so that the first and last segments of edges become orthogonal.
GraphSnapContext
 InheritedsnapResults : ICollectionModel
[read-only] The collection of SnapResults.
SnapContext
  snapSegmentsToSnapLines : Boolean
Determines whether this context will automatically snap orthogonal edge segments to snap lines.
GraphSnapContext
 Inheritedstroke : IStroke
The stroke that shall be used by the created DisplayObjects to visualize the snap results.
SnapContext
 InheritedvisualizeSnapResults : Boolean
Gets or sets a value indicating whether to visualize the snap results.
SnapContext
 InheritedvoidInstance : SnapContext
[static] [read-only] The shared void instance.
SnapContext
Protected Properties
 PropertyDefined By
 Inherited_enabled : Boolean = true
SnapContext
  fixedNodes : Collection
[read-only] Gets the nodes that stay fixed for the current edit.
GraphSnapContext
Public Methods
 MethodDefined By
  
Creates a new instance with default settings.
GraphSnapContext
  
Adds a bend which will be moved.
GraphSnapContext
  
Adds an edge end that will be moved
GraphSnapContext
  
addHorizontalSnap(snapLine:SortableSnapLine):void
GraphSnapContext
  
Adds an item which will be moved.
GraphSnapContext
  
Adds an item which will be reshaped.
GraphSnapContext
  
Adds a node which will be moved.
GraphSnapContext
  
Adds an orthogonally moved segment to this context for which this instance will automatically collect SnapResults and provide a default visualization.
GraphSnapContext
  
Adds a port which will be moved.
GraphSnapContext
  
Adds an entry for the same-height-snapping.
GraphSnapContext
  
Adds an entry for the same-width-snapping.
GraphSnapContext
  
addVerticalSnap(snapLine:SortableSnapLine):void
GraphSnapContext
 Inherited
cancelDrag():void
Called when a drag has been canceled.
SnapContext
 Inherited
SnapContext
 Inherited
Creates and returns a new instance of an IDisplayObjectCreator implementation that can be used to visualize a SnapResult with the given resourceKey.
SnapContext
 Inherited
Helper method used by createSnapResultsModelManager to create the IModelItemInstaller for the SnapResult type.
SnapContext
 Inherited
Helper method that creates a CollectionModelManager that can be used to present the current SnapResults in the provided CanvasComponent.
SnapContext
 Inherited
This method can be called by the IInputMode while this instance is initialized alternatively to handleMove.
SnapContext
 Inherited
Called when a drag has been successfully finished.
SnapContext
 Inherited
dragged(mouseLocation:IPoint, finalSnapState:SnapState):void
This method needs to be called by the client IInputMode that initialized this instance after it has performed the actual move operation with the adjusted coordinates after a call to handleMove.
SnapContext
  
[override] Collects a list of snap lines.
GraphSnapContext
  
findSameHeightEntries(size:Number, maxSize:Number, minSize:Number):Iterable
Finds the entries that have been registered using the addSameHeightEntry previously that best match the given constraints.
GraphSnapContext
  
findSameWidthEntries(size:Number, maxSize:Number, minSize:Number):Iterable
Finds the entries that have been registered using the addSameWidthEntry previously that best match the given constraints.
GraphSnapContext
  
Gets a subset of additionalSnapLines that matches the given orientation and snapTypes and intersects with the provided area.
GraphSnapContext
  
Gets a subset of fixedSegmentSnapLines that matches the given orientation and snapTypes and intersects with the provided area.
GraphSnapContext
  
Gets a subset of fixedPortSnapLines that matches the given orientation and snapTypes and intersects with the provided area.
GraphSnapContext
  
Gets a subset of fixedNodeSnapLines that matches the given orientation and snapTypes and intersects with the provided area.
GraphSnapContext
  
Gets the movement information for the provided edge.
GraphSnapContext
  
Gets the movement info for the given node.
GraphSnapContext
  
Gets the movement info for the given port.
GraphSnapContext
 Inherited
Handles a move.
SnapContext
  
initializeDrag(context:IInputModeContext, originalLocation:IPoint):void
[override] Called by IInputMode implementations when an interactive drag is started.
GraphSnapContext
  
GraphSnapContext
  
[override] Helper method that wraps the given context so that a ILookup.lookup query on the wrapped context for the SnapContext type yields this instance.
GraphSnapContext
Protected Methods
 MethodDefined By
  
cleanUp():void
[override] Disposes of all previously temporarily collected state and clears the SnapContext.snapResults collection.
GraphSnapContext
  
Collects the SnapLines for the nodes which are not moving.
GraphSnapContext
  
Collects the SnapLines for the ports which are not moving.
GraphSnapContext
  
Collects snap lines for edge segments.
GraphSnapContext
  
Collects all node widths and heights in the collections findSameWidthEntries and findSameHeightEntries.
GraphSnapContext
  
Finds pairs of nodes that can see each other to create center and same distance snap lines.
GraphSnapContext
 Inherited
Raises the cleanedUp event.
SnapContext
  
Dispatches the given CollectSnapLinesEvent.
GraphSnapContext
 Inherited
onCollectSnapResults(inputContext:IInputModeContext, originalLocation:IPoint, newLocation:IPoint, snapDistance:Number, snapResults:Collection):void
Raises the collectSnapResults event using the provided data.
SnapContext
 Inherited
Raises the initialized event.
SnapContext
 Inherited
Raises the initializing event.
SnapContext
 Inherited
processSnapResults(snapResults:List, originalLocation:IPoint, newLocation:IPoint):SnapState
Chooses the current SnapResults from a temporary list.
SnapContext
Events
 Event Summary Defined By
 InheritedDispatched when this instance has been cleaned up.SnapContext
  Occurs every time this instance has initialized a drag to collect SnapLines.GraphSnapContext
 InheritedDispatched during moving gestures to collect SnapResults for the moved objects.SnapContext
 InheritedDispatched when this instance has initialized a drag.SnapContext
 InheritedDispatched when this instance is about to initialize a drag.SnapContext
Property Detail
additionalSnapLinesproperty
additionalSnapLines:Iterable  [read-only]

The collection of additional SnapLines. This collection is only available if SnapContext.isInitialized is true.


Implementation
    public function get additionalSnapLines():Iterable

See also

bendGridConstraintProviderproperty 
bendGridConstraintProvider:IBendGridConstraintProvider

Determines the grid constraint provider for the IBends.

The default value is null.


Implementation
    public function get bendGridConstraintProvider():IBendGridConstraintProvider
    public function set bendGridConstraintProvider(value:IBendGridConstraintProvider):void
collectEdgeSnapLinesproperty 
collectEdgeSnapLines:Boolean

Determines whether this instance should collect fixed snap lines for edge segments.

The default value is true.


Implementation
    public function get collectEdgeSnapLines():Boolean
    public function set collectEdgeSnapLines(value:Boolean):void

See also

collectNodePairCenterSnapLinesproperty 
collectNodePairCenterSnapLines:Boolean

Determines whether this instance will try to align the centers of adjacent nodes so that their centers are equally far away from each other. Note that this will only make a difference for differently sized nodes. By default this feature is turned off, so that the instance will try to distribute nodes evenly, so that there is the same spacing between their borders, not between their centers.

The default value is false.


Implementation
    public function get collectNodePairCenterSnapLines():Boolean
    public function set collectNodePairCenterSnapLines(value:Boolean):void
collectNodePairSegmentSnapLinesproperty 
collectNodePairSegmentSnapLines:Boolean

Determines whether this instance will collect pairs of adjacent nodes and add snapping logic so that moved edge segments will snap so that the distances to the adjacent nodes are equal.

The default value is true.


Implementation
    public function get collectNodePairSegmentSnapLines():Boolean
    public function set collectNodePairSegmentSnapLines(value:Boolean):void
collectNodePairSnapLinesproperty 
collectNodePairSnapLines:Boolean

Determines whether this instance will collect pairs of adjacent nodes and add snapping logic so that moved nodes will snap so that the distances to the adjacent nodes are equal.

The default value is true.


Implementation
    public function get collectNodePairSnapLines():Boolean
    public function set collectNodePairSnapLines(value:Boolean):void
collectNodeSizesproperty 
collectNodeSizes:Boolean

Determines whether this instance should collect the sizes of fixed nodes.

The default value is true.


Implementation
    public function get collectNodeSizes():Boolean
    public function set collectNodeSizes(value:Boolean):void

See also

collectNodeSnapLinesproperty 
collectNodeSnapLines:Boolean

Determines whether this instance should collect fixed snap lines for nodes.

The default value is true.


Implementation
    public function get collectNodeSnapLines():Boolean
    public function set collectNodeSnapLines(value:Boolean):void

See also

collectPortSnapLinesproperty 
collectPortSnapLines:Boolean

Determines whether this instance should collect fixed snap lines for ports.

The default value is true.


Implementation
    public function get collectPortSnapLines():Boolean
    public function set collectPortSnapLines(value:Boolean):void

See also

cropSnapLinesproperty 
cropSnapLines:Boolean

Whether to crop the snap lines at obstacles.

The default value is true.


Implementation
    public function get cropSnapLines():Boolean
    public function set cropSnapLines(value:Boolean):void
edgeToEdgeDistanceproperty 
edgeToEdgeDistance:Number

Determines 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 value is 0.0 which disables parallel snap lines..


Implementation
    public function get edgeToEdgeDistance():Number
    public function set edgeToEdgeDistance(value:Number):void
fixedNodesproperty 
fixedNodes:Collection  [read-only]

Gets the nodes that stay fixed for the current edit.


Implementation
    protected function get fixedNodes():Collection
fixedNodeSnapLinesproperty 
fixedNodeSnapLines:Iterable  [read-only]

The collection of SnapLines for fixed nodes. This collection is only available if SnapContext.isInitialized is true.


Implementation
    public function get fixedNodeSnapLines():Iterable

See also

fixedPortSnapLinesproperty 
fixedPortSnapLines:Iterable  [read-only]

The collection of SnapLines to which ports should be snapping. This collection is only available if SnapContext.isInitialized is true.


Implementation
    public function get fixedPortSnapLines():Iterable

See also

fixedSegmentSnapLinesproperty 
fixedSegmentSnapLines:Iterable  [read-only]

The collection of SnapLines for fixed edge segments. This collection is only available if SnapContext.isInitialized is true.


Implementation
    public function get fixedSegmentSnapLines():Iterable

See also

gridSnapDistanceproperty 
gridSnapDistance:Number

Gets or sets the global grid snap distance, which is the maximum distance between the current mouse coordinates and the coordinates to which the mouse will snap. The distance is interpreted in view coordinates.

The default value is 10.0.


Implementation
    public function get gridSnapDistance():Number
    public function set gridSnapDistance(value:Number):void
gridSnapTypeproperty 
gridSnapType:uint

Determines to what grid elements an object should snap.

The default value is GridSnapType#NONE.


Implementation
    public function get gridSnapType():uint
    public function set gridSnapType(value:uint):void

See also

IGridConstraintProvider
nodeGridConstraintProviderproperty 
nodeGridConstraintProvider:INodeGridConstraintProvider

Determines the grid constraint provider for the INodes.

The default value is null.


Implementation
    public function get nodeGridConstraintProvider():INodeGridConstraintProvider
    public function set nodeGridConstraintProvider(value:INodeGridConstraintProvider):void
nodesToBeMovedCountproperty 
nodesToBeMovedCount:int  [read-only]


Implementation
    public function get nodesToBeMovedCount():int
nodeToEdgeDistanceproperty 
nodeToEdgeDistance:Number

Determines 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 value is -1.0 which disables distant snap lines around the nodes for edge segments..


Implementation
    public function get nodeToEdgeDistance():Number
    public function set nodeToEdgeDistance(value:Number):void
nodeToNodeDistanceproperty 
nodeToNodeDistance:Number

Determines 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 value is 0.0 which disables distant snap lines around the nodes..


Implementation
    public function get nodeToNodeDistance():Number
    public function set nodeToNodeDistance(value:Number):void
portGridConstraintProviderproperty 
portGridConstraintProvider:IPortGridConstraintProvider

Determines the grid constraint provider for the IPorts.

The default value is null.


Implementation
    public function get portGridConstraintProvider():IPortGridConstraintProvider
    public function set portGridConstraintProvider(value:IPortGridConstraintProvider):void
snapBendAdjacentSegmentsproperty 
snapBendAdjacentSegments:Boolean

Whether this context will automatically snap the movements of bends so that the two adjacent segments become horizontally or vertically oriented.

The default value is true.


Implementation
    public function get snapBendAdjacentSegments():Boolean
    public function set snapBendAdjacentSegments(value:Boolean):void
snapBendsToSnapLinesproperty 
snapBendsToSnapLines:Boolean

Determines whether this context will automatically snap the bends to snap lines.

The default value is false.


Implementation
    public function get snapBendsToSnapLines():Boolean
    public function set snapBendsToSnapLines(value:Boolean):void
snapLineExtensionproperty 
snapLineExtension:Number

The amount by which snap lines that are induced by existing edge segments and node borders are being extended. This value will be used to prolongate the ends of the snap lines.

The default value is 40.0.


Implementation
    public function get snapLineExtension():Number
    public function set snapLineExtension(value:Number):void
snapNodesToSnapLinesproperty 
snapNodesToSnapLines:Boolean

Determines whether this context will automatically snap the nodes to snap lines.

The default value is true.


Implementation
    public function get snapNodesToSnapLines():Boolean
    public function set snapNodesToSnapLines(value:Boolean):void
snapOrthogonalMovementproperty 
snapOrthogonalMovement:Boolean

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 value is false.


Implementation
    public function get snapOrthogonalMovement():Boolean
    public function set snapOrthogonalMovement(value:Boolean):void
snapPortAdjacentSegmentsproperty 
snapPortAdjacentSegments:Boolean

Whether this context will automatically snap the movements of nodes so that the first and last segments of edges become orthogonal.

The default value is true.


Implementation
    public function get snapPortAdjacentSegments():Boolean
    public function set snapPortAdjacentSegments(value:Boolean):void
snapSegmentsToSnapLinesproperty 
snapSegmentsToSnapLines:Boolean

Determines whether this context will automatically snap orthogonal edge segments to snap lines.

The default value is true.


Implementation
    public function get snapSegmentsToSnapLines():Boolean
    public function set snapSegmentsToSnapLines(value:Boolean):void
Constructor Detail
GraphSnapContext()Constructor
public function GraphSnapContext()

Creates a new instance with default settings.

Method Detail
addBendToBeMoved()method
public function addBendToBeMoved(info:BendMovementInfo):void

Adds a bend which will be moved.

Parameters

info:BendMovementInfo — The BendMovementInfo which represents the bend to be moved.

See also

addEdgeEndToBeMoved()method 
public function addEdgeEndToBeMoved(info:EdgeEndMovementInfo):void

Adds an edge end that will be moved

Parameters

info:EdgeEndMovementInfo — The EdgeEndMovementInfo which represents the edge end to be moved.

See also

addHorizontalSnap()method 
public function addHorizontalSnap(snapLine:SortableSnapLine):void

Parameters

snapLine:SortableSnapLine

addItemToBeMoved()method 
public function addItemToBeMoved(item:IModelItem):void

Adds an item which will be moved. Items should be added using the type specific methods addNodeToBeMoved, addBendToBeMoved and addPortToBeMoved rather than using this method.

Parameters

item:IModelItem — The item to be added.

See also

addItemToBeReshaped()method 
public function addItemToBeReshaped(item:IModelItem):void

Adds an item which will be reshaped.

Parameters

item:IModelItem — The item to be reshaped.

addNodeToBeMoved()method 
public function addNodeToBeMoved(info:NodeMovementInfo):void

Adds a node which will be moved.

Parameters

info:NodeMovementInfo — The NodeMovementInfo which represents the node to be moved.

See also

addOrthogonalSegment()method 
public function addOrthogonalSegment(segStart:MovementInfo, segEnd:MovementInfo):void

Adds an orthogonally moved segment to this context for which this instance will automatically collect SnapResults and provide a default visualization. This method can be called during initialization to collect orthogonal segments that should be tested against fixedSegmentSnapLines and additionalSnapLines.

Parameters

segStart:MovementInfo — The starting point of the manipulated segment.
 
segEnd:MovementInfo — The end point of the manipulated segment.

See also

addPortToBeMoved()method 
public function addPortToBeMoved(info:PortMovementInfo):void

Adds a port which will be moved.

Parameters

info:PortMovementInfo — The PortMovementInfo which represents the port to be moved.

See also

addSameHeightEntry()method 
public function addSameHeightEntry(rect:IRectangle):void

Adds an entry for the same-height-snapping. During initialization this method can be used to register entries that can later be retrieved using the findSameHeightEntries method. The rectangle will be used to obtain the height value and will also be used for the visualization of the snap result.

Parameters

rect:IRectangle — The rectangle to obtain the height value from. This rectangle will be used for the snap result visualization.

See also

addSameWidthEntry()method 
public function addSameWidthEntry(rect:IRectangle):void

Adds an entry for the same-width-snapping. During initialization this method can be used to register entries that can later be retrieved using the findSameWidthEntries method. The rectangle will be used to obtain the width value and will also be used for the visualization of the snap result.

Parameters

rect:IRectangle — The rectangle to obtain the width value from. This rectangle will be used for the snap result visualization.

See also

addVerticalSnap()method 
public function addVerticalSnap(snapLine:SortableSnapLine):void

Parameters

snapLine:SortableSnapLine

cleanUp()method 
override protected function cleanUp():void

Disposes of all previously temporarily collected state and clears the SnapContext.snapResults collection. Subclasses should make sure to call the base implementation as their last operation.

See also

collectFixedNodeSnapLines()method 
protected function collectFixedNodeSnapLines(evt:CollectSnapLinesEvent):void

Collects the SnapLines for the nodes which are not moving. Delegates to the ISnapLineProvider implementation in the lookup of the INode.

Parameters

evt:CollectSnapLinesEvent — The event to add the snap lines to.

See also

collectFixedPortSnapLines()method 
protected function collectFixedPortSnapLines(evt:CollectSnapLinesEvent):void

Collects the SnapLines for the ports which are not moving. Delegates to the ISnapLineProvider implementation in the lookup of the IPort.

Parameters

evt:CollectSnapLinesEvent — The event to add the snap lines to.

See also

collectFixedSegmentSnapLines()method 
protected function collectFixedSegmentSnapLines(evt:CollectSnapLinesEvent):void

Collects snap lines for edge segments. Delegates to the ISnapLineProvider implementation in the lookup of the IEdge. This implementation should then make us of getMovementInfos to determine what segments are fixed.

Parameters

evt:CollectSnapLinesEvent — The event to add the snap lines to.

See also

collectSameSizeEntries()method 
protected function collectSameSizeEntries():void

Collects all node widths and heights in the collections findSameWidthEntries and findSameHeightEntries.

This method will only be called if collectNodeSizes is enabled and delegates to addSameHeightEntry and addSameWidthEntry.

See also

collectVisibleNodePairs()method 
protected function collectVisibleNodePairs():void

Finds pairs of nodes that can see each other to create center and same distance snap lines.

See also

CollectNodePairCenterSnapLines
CollectNodePairSnapLines
dragInitialized()method 
override public function dragInitialized():void

Collects a list of snap lines. This method has been overridden to collect the snap lines for all fixed graph elements and crops them after collection.

See also

findSameHeightEntries()method 
public function findSameHeightEntries(size:Number, maxSize:Number, minSize:Number):Iterable

Finds the entries that have been registered using the addSameHeightEntry previously that best match the given constraints.

Parameters

size:Number — The size to find the closest set of identical sizes.
 
maxSize:Number — The maximum allowed size.
 
minSize:Number — The minimum allowed size.

Returns
Iterable — An Iterable containing the IRectangles that have been added previously using addSameHeightEntry.

See also

findSameWidthEntries()method 
public function findSameWidthEntries(size:Number, maxSize:Number, minSize:Number):Iterable

Finds the entries that have been registered using the addSameWidthEntry previously that best match the given constraints.

Parameters

size:Number — The size to find the closest set of identical sizes.
 
maxSize:Number — The maximum allowed size.
 
minSize:Number — The minimum allowed size.

Returns
Iterable — An Iterable containing the IRectangles that have been added previously using addSameWidthEntry.

See also

getAdditionalSnapLines()method 
public function getAdditionalSnapLines(orientation:SnapLineOrientation, snapTypes:uint, area:IRectangle):Iterable

Gets a subset of additionalSnapLines that matches the given orientation and snapTypes and intersects with the provided area.

Parameters

orientation:SnapLineOrientation — The orientation of the lines to return. One of those declared in SnapLineOrientation.
 
snapTypes:uint — The snap types to be included. One of those declared in SnapLineSnapType.
 
area:IRectangle — The area to test for intersection.

Returns
Iterable — An Iterable of the SnapLines that match the provided criteria.

See also

getFixedNodeSnapLines()method 
public function getFixedNodeSnapLines(orientation:SnapLineOrientation, snapTypes:uint, area:IRectangle):Iterable

Gets a subset of fixedSegmentSnapLines that matches the given orientation and snapTypes and intersects with the provided area.

Parameters

orientation:SnapLineOrientation — The orientation of the lines to return. One of those declared in SnapLineOrientation.
 
snapTypes:uint — The snap types to be included. One of those declared in SnapLineSnapType.
 
area:IRectangle — The area to test for intersection.

Returns
Iterable — An Iterable of the SnapLines that match the provided criteria.

See also

getFixedPortSnapLines()method 
public function getFixedPortSnapLines(orientation:SnapLineOrientation, snapTypes:uint, area:IRectangle):Iterable

Gets a subset of fixedPortSnapLines that matches the given orientation and snapTypes and intersects with the provided area.

Parameters

orientation:SnapLineOrientation — The orientation of the lines to return. One of those declared in SnapLineOrientation.
 
snapTypes:uint — The snap types to be included. One of those declared in SnapLineSnapType.
 
area:IRectangle — The area to test for intersection.

Returns
Iterable — An Iterable of the SnapLines that match the provided criteria.

See also

getFixedSegmentSnapLines()method 
public function getFixedSegmentSnapLines(orientation:SnapLineOrientation, snapTypes:uint, area:IRectangle):Iterable

Gets a subset of fixedNodeSnapLines that matches the given orientation and snapTypes and intersects with the provided area.

Parameters

orientation:SnapLineOrientation — The orientation of the lines to return. One of those declared in SnapLineOrientation.
 
snapTypes:uint — The snap types to be included. One of those declared in SnapLineSnapType.
 
area:IRectangle — The area to test for intersection.

Returns
Iterable — An Iterable of the SnapLines that match the provided criteria.

See also

getMovementInfos()method 
public function getMovementInfos(edge:IEdge):Array

Gets the movement information for the provided edge. The result describes the shape of the edge and the reshaping behavior of the geometry. The first element in the array is the source end of the edge, followed by bend like elements and the target side. Note that it cannot in general be assumed that the exact runtime type of the first and last element is either PortMovementInfo or EdgeEndMovementInfo, also items in between may not necessarily be bound to IBends and can therefor be of a different type than BendMovementInfo.

Parameters

edge:IEdge — The edge to obtain the movement information of.

Returns
Array — An array of MovementInfo items that describe the geometry of the edge being modified.

See also

getNodeMovementInfo()method 
public function getNodeMovementInfo(node:INode):NodeMovementInfo

Gets the movement info for the given node. This is either the info passed to addNodeToBeMoved or another, dynamically created instance, if no specific one had been registered.

Parameters

node:INode — The node to obtain the info for.

Returns
NodeMovementInfo — An instance of NodeMovementInfo that describes the movement of the node.

See also

getPortMovementInfo()method 
public function getPortMovementInfo(port:IPort):PortMovementInfo

Gets the movement info for the given port. This is either the info passed to addNodeToBeMoved or another, dynamically created instance, if no specific one had been registered.

Parameters

port:IPort — The port to obtain the info for.

Returns
PortMovementInfo — An instance of PortMovementInfo that describes the movement of the port.

See also

initializeDrag()method 
override public function initializeDrag(context:IInputModeContext, originalLocation:IPoint):void

Called by IInputMode implementations when an interactive drag is started. Initializes the list of nodes to be moved. Called by the wrapping position handler on initialization of a drag action.

Parameters

context:IInputModeContext — The context in which the interactive drag is started.
 
originalLocation:IPoint — The original location of the mouse.


Throws
IllegalOperationError — If this context is already initialized.

See also

IInputMode
com.yworks.canvas.input.snapLines.SnapContext.isInitialized
lineIntersectsView()method 
public function lineIntersectsView(p1:IPoint, p2:IPoint):Boolean

Parameters

p1:IPoint
 
p2:IPoint

Returns
Boolean
onCollectSnapLines()method 
protected function onCollectSnapLines(evt:CollectSnapLinesEvent):void

Dispatches the given CollectSnapLinesEvent.

Parameters

evt:CollectSnapLinesEvent — The event to dispatch.

wrapContext()method 
override public function wrapContext(context:IInputModeContext):IInputModeContext

Helper method that wraps the given context so that a ILookup.lookup query on the wrapped context for the SnapContext type yields this instance.

Parameters

context:IInputModeContext — The context to wrap and delegate all calls to.

Returns
IInputModeContext — A modified instance that yields this instance if it is queried for the SnapContext type.
Event Detail
collectSnapLines Event
Event Object Type: com.yworks.graph.input.snapLines.CollectSnapLinesEvent
CollectSnapLinesEvent.type property = com.yworks.graph.input.snapLines.CollectSnapLinesEvent.COLLECT_SNAP_LINES

Occurs every time this instance has initialized a drag to collect SnapLines. Event handlers should add snap lines to the caller using the methods provided by CollectSnapLinesEvent.

See also