Package | com.yworks.graph.input.snapLines |
Class | public class GraphSnapContext |
Inheritance | GraphSnapContext SnapContext flash.events.EventDispatcher |
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 IGraph
s.
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
Property | Defined 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 | ||
currentInputModeContext : IInputModeContext [read-only]
Gets the current input mode context. | SnapContext | ||
edgeToEdgeDistance : Number
Determines the preferred distance between edges. | GraphSnapContext | ||
enabled : 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 | ||
isInitialized : Boolean [read-only]
Whether the context is initialized. | SnapContext | ||
isInitializing : 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 | ||
originalLocation : 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 | ||
snapDistance : 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 | ||
snapResults : ICollectionModel [read-only]
The collection of SnapResults. | SnapContext | ||
snapSegmentsToSnapLines : Boolean
Determines whether this context will automatically snap orthogonal edge segments to snap lines. | GraphSnapContext | ||
stroke : IStroke
The stroke that shall be used by the created DisplayObjects to visualize the snap results. | SnapContext | ||
visualizeSnapResults : Boolean
Gets or sets a value indicating whether to visualize the snap results. | SnapContext | ||
voidInstance : SnapContext [static] [read-only]
The shared void instance. | SnapContext |
Property | Defined By | ||
---|---|---|---|
_enabled : Boolean = true | SnapContext | ||
fixedNodes : Collection [read-only]
Gets the nodes that stay fixed for the current edit. | GraphSnapContext |
Method | Defined By | ||
---|---|---|---|
Creates a new instance with default settings. | GraphSnapContext | ||
addBendToBeMoved(info:BendMovementInfo):void
Adds a bend which will be moved. | GraphSnapContext | ||
addEdgeEndToBeMoved(info:EdgeEndMovementInfo):void
Adds an edge end that will be moved
| GraphSnapContext | ||
addHorizontalSnap(snapLine:SortableSnapLine):void | GraphSnapContext | ||
addItemToBeMoved(item:IModelItem):void
Adds an item which will be moved. | GraphSnapContext | ||
addItemToBeReshaped(item:IModelItem):void
Adds an item which will be reshaped. | GraphSnapContext | ||
addNodeToBeMoved(info:NodeMovementInfo):void
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 | ||
addPortToBeMoved(info:PortMovementInfo):void
Adds a port which will be moved. | GraphSnapContext | ||
addSameHeightEntry(rect:IRectangle):void
Adds an entry for the same-height-snapping. | GraphSnapContext | ||
addSameWidthEntry(rect:IRectangle):void
Adds an entry for the same-width-snapping. | GraphSnapContext | ||
addVerticalSnap(snapLine:SortableSnapLine):void | GraphSnapContext | ||
cancelDrag():void
Called when a drag has been canceled. | SnapContext | ||
checkEnabledAccess():void | SnapContext | ||
Creates and returns a new instance of an IDisplayObjectCreator implementation that can be used to
visualize a SnapResult with the given resourceKey. | SnapContext | ||
Helper method used by createSnapResultsModelManager to create the
IModelItemInstaller for the SnapResult type. | SnapContext | ||
Helper method that creates a CollectionModelManager that can be used
to present the current SnapResults in the provided CanvasComponent. | SnapContext | ||
disableSnapping():void
This method can be called by the IInputMode while this instance is initialized
alternatively to handleMove. | SnapContext | ||
Called when a drag has been successfully finished. | SnapContext | ||
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 | ||
dragInitialized():void [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 | ||
getMovementInfos(edge:IEdge):Array
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 | ||
Handles a move. | SnapContext | ||
[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 |
Method | Defined 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 | ||
collectSameSizeEntries():void
Collects all node widths and heights in the collections findSameWidthEntries and
findSameHeightEntries. | GraphSnapContext | ||
collectVisibleNodePairs():void
Finds pairs of nodes that can see each other to create center and same distance snap lines. | GraphSnapContext | ||
onCleanedUp():void
Raises the cleanedUp event. | SnapContext | ||
onCollectSnapLines(evt:CollectSnapLinesEvent):void
Dispatches the given CollectSnapLinesEvent. | GraphSnapContext | ||
onCollectSnapResults(inputContext:IInputModeContext, originalLocation:IPoint, newLocation:IPoint, snapDistance:Number, snapResults:Collection):void
Raises the collectSnapResults event using the provided data. | SnapContext | ||
onInitialized():void
Raises the initialized event. | SnapContext | ||
onInitializing():void
Raises the initializing event. | SnapContext | ||
Chooses the current SnapResults from a temporary list. | SnapContext |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when this instance has been cleaned up. | SnapContext | |||
Occurs every time this instance has initialized a drag to collect SnapLines. | GraphSnapContext | |||
Dispatched during moving gestures to collect SnapResults for the moved objects. | SnapContext | |||
Dispatched when this instance has initialized a drag. | SnapContext | |||
Dispatched when this instance is about to initialize a drag. | SnapContext |
additionalSnapLines | property |
additionalSnapLines:Iterable
[read-only]
The collection of additional SnapLine
s.
This collection is only available if SnapContext.isInitialized
is true
.
public function get additionalSnapLines():Iterable
See also
bendGridConstraintProvider | property |
bendGridConstraintProvider:IBendGridConstraintProvider
Determines the grid constraint provider for the IBend
s.
The default value is null
.
public function get bendGridConstraintProvider():IBendGridConstraintProvider
public function set bendGridConstraintProvider(value:IBendGridConstraintProvider):void
collectEdgeSnapLines | property |
collectEdgeSnapLines:Boolean
Determines whether this instance should collect fixed snap lines for edge segments.
The default value is true
.
public function get collectEdgeSnapLines():Boolean
public function set collectEdgeSnapLines(value:Boolean):void
See also
collectNodePairCenterSnapLines | property |
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
.
public function get collectNodePairCenterSnapLines():Boolean
public function set collectNodePairCenterSnapLines(value:Boolean):void
collectNodePairSegmentSnapLines | property |
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
.
public function get collectNodePairSegmentSnapLines():Boolean
public function set collectNodePairSegmentSnapLines(value:Boolean):void
collectNodePairSnapLines | property |
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
.
public function get collectNodePairSnapLines():Boolean
public function set collectNodePairSnapLines(value:Boolean):void
collectNodeSizes | property |
collectNodeSizes:Boolean
Determines whether this instance should collect the sizes of fixed nodes.
The default value is true
.
public function get collectNodeSizes():Boolean
public function set collectNodeSizes(value:Boolean):void
See also
collectNodeSnapLines | property |
collectNodeSnapLines:Boolean
Determines whether this instance should collect fixed snap lines for nodes.
The default value is true
.
public function get collectNodeSnapLines():Boolean
public function set collectNodeSnapLines(value:Boolean):void
See also
collectPortSnapLines | property |
collectPortSnapLines:Boolean
Determines whether this instance should collect fixed snap lines for ports.
The default value is true
.
public function get collectPortSnapLines():Boolean
public function set collectPortSnapLines(value:Boolean):void
See also
cropSnapLines | property |
cropSnapLines:Boolean
Whether to crop the snap lines at obstacles.
The default value is true
.
public function get cropSnapLines():Boolean
public function set cropSnapLines(value:Boolean):void
edgeToEdgeDistance | property |
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.
.
public function get edgeToEdgeDistance():Number
public function set edgeToEdgeDistance(value:Number):void
fixedNodes | property |
fixedNodes:Collection
[read-only] Gets the nodes that stay fixed for the current edit.
protected function get fixedNodes():Collection
fixedNodeSnapLines | property |
fixedNodeSnapLines:Iterable
[read-only]
The collection of SnapLine
s for fixed nodes.
This collection is only available if SnapContext.isInitialized
is true
.
public function get fixedNodeSnapLines():Iterable
See also
fixedPortSnapLines | property |
fixedPortSnapLines:Iterable
[read-only]
The collection of SnapLine
s to which ports should be snapping.
This collection is only available if SnapContext.isInitialized
is true
.
public function get fixedPortSnapLines():Iterable
See also
fixedSegmentSnapLines | property |
fixedSegmentSnapLines:Iterable
[read-only]
The collection of SnapLine
s for fixed edge segments.
This collection is only available if SnapContext.isInitialized
is true
.
public function get fixedSegmentSnapLines():Iterable
See also
gridSnapDistance | property |
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
.
public function get gridSnapDistance():Number
public function set gridSnapDistance(value:Number):void
gridSnapType | property |
gridSnapType:uint
Determines to what grid elements an object should snap.
The default value is GridSnapType#NONE
.
public function get gridSnapType():uint
public function set gridSnapType(value:uint):void
See also
nodeGridConstraintProvider | property |
nodeGridConstraintProvider:INodeGridConstraintProvider
Determines the grid constraint provider for the INode
s.
The default value is null
.
public function get nodeGridConstraintProvider():INodeGridConstraintProvider
public function set nodeGridConstraintProvider(value:INodeGridConstraintProvider):void
nodesToBeMovedCount | property |
nodesToBeMovedCount:int
[read-only] public function get nodesToBeMovedCount():int
nodeToEdgeDistance | property |
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.
.
public function get nodeToEdgeDistance():Number
public function set nodeToEdgeDistance(value:Number):void
nodeToNodeDistance | property |
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.
.
public function get nodeToNodeDistance():Number
public function set nodeToNodeDistance(value:Number):void
portGridConstraintProvider | property |
portGridConstraintProvider:IPortGridConstraintProvider
Determines the grid constraint provider for the IPort
s.
The default value is null
.
public function get portGridConstraintProvider():IPortGridConstraintProvider
public function set portGridConstraintProvider(value:IPortGridConstraintProvider):void
snapBendAdjacentSegments | property |
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
.
public function get snapBendAdjacentSegments():Boolean
public function set snapBendAdjacentSegments(value:Boolean):void
snapBendsToSnapLines | property |
snapBendsToSnapLines:Boolean
Determines whether this context will automatically snap the bends to snap lines.
The default value is false
.
public function get snapBendsToSnapLines():Boolean
public function set snapBendsToSnapLines(value:Boolean):void
snapLineExtension | property |
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
.
public function get snapLineExtension():Number
public function set snapLineExtension(value:Number):void
snapNodesToSnapLines | property |
snapNodesToSnapLines:Boolean
Determines whether this context will automatically snap the nodes to snap lines.
The default value is true
.
public function get snapNodesToSnapLines():Boolean
public function set snapNodesToSnapLines(value:Boolean):void
snapOrthogonalMovement | property |
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
.
public function get snapOrthogonalMovement():Boolean
public function set snapOrthogonalMovement(value:Boolean):void
snapPortAdjacentSegments | property |
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
.
public function get snapPortAdjacentSegments():Boolean
public function set snapPortAdjacentSegments(value:Boolean):void
snapSegmentsToSnapLines | property |
snapSegmentsToSnapLines:Boolean
Determines whether this context will automatically snap orthogonal edge segments to snap lines.
The default value is true
.
public function get snapSegmentsToSnapLines():Boolean
public function set snapSegmentsToSnapLines(value:Boolean):void
GraphSnapContext | () | Constructor |
public function GraphSnapContext()
Creates a new instance with default settings.
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 SnapResult
s 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 SnapLine
s 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 SnapLine
s 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
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.
|
Iterable — An Iterable containing the IRectangle s 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.
|
Iterable — An Iterable containing the IRectangle s 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.
|
Iterable — An Iterable of the SnapLine s 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.
|
Iterable — An Iterable of the SnapLine s 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.
|
Iterable — An Iterable of the SnapLine s 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.
|
Iterable — An Iterable of the SnapLine s 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 IBend
s and can therefor be of a different type than BendMovementInfo
.
Parameters
edge:IEdge — The edge to obtain the movement information of.
|
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.
|
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.
|
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.
|
IllegalOperationError — If this context is already initialized.
|
See also
lineIntersectsView | () | method |
public function lineIntersectsView(p1:IPoint, p2:IPoint):Boolean
Parameters
p1:IPoint | |
p2:IPoint |
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.
|
IInputModeContext — A modified instance that yields this instance if it is queried for the SnapContext type.
|
collectSnapLines | Event |
com.yworks.graph.input.snapLines.CollectSnapLinesEvent
com.yworks.graph.input.snapLines.CollectSnapLinesEvent.COLLECT_SNAP_LINES
Occurs every time this instance has initialized a drag to collect SnapLine
s.
Event handlers should add snap lines to the caller using the methods provided by CollectSnapLinesEvent
.
See also