Packagecom.yworks.graph.input.snapLines
Classpublic class SnapLineSnapResult
InheritanceSnapLineSnapResult Inheritance SnapResult Inheritance flash.events.EventDispatcher

This snap result represents a SnapLine to which the current moved item will potentially snap.

See also

SnapLine


Public Properties
 PropertyDefined By
  delta : Number
[read-only] The value to add to the mouse coordinates to snap to that result.
SnapLineSnapResult
  movedObject : Object
[read-only] The object that is moved and would be snapped with this SnapLineSnapResult.
SnapLineSnapResult
 InheritednullResult : SnapResult
[static] [read-only] A SnapResult representing that there is no snapping of the x or y coordinate.
SnapResult
  snapLine : SnapLine
[read-only] The SnapLine associated with this result.
SnapLineSnapResult
  snappedCoordinates : IPoint
[read-only] The coordinates of the end point of the snap line.
SnapLineSnapResult
 Inheritedtag : Object
[read-only] The tag associated with this result.
SnapResult
 Inheritedweight : Number
[read-only] Yields the weight of this result, the higher the weight, the more important it is.
SnapResult
Protected Properties
 PropertyDefined By
 Inherited_tag : Object
The tag associated with this result.
SnapResult
 Inherited_weight : Number
Yields the weight of this result, the higher the weight, the more important it is.
SnapResult
Public Methods
 MethodDefined By
  
SnapLineSnapResult(weight:Number, delta:Number, tag:Object, snapLine:SnapLine, snappedCoordinates:IPoint, movedObject:Object)
Creates a new instance of SnapLineSnapResult.
SnapLineSnapResult
 Inherited
compareTo(snapResultA:Object, snapResultB:Object):int
[static] Compares the weights of the two SnapResults.
SnapResult
 Inherited
createPointSnapResult(location:IPoint, weight:Number, tag:Object, creator:IDisplayObjectCreator, snapType:uint):SnapResult
[static] Factory method that creates a SnapResult that snaps to a given location.
SnapResult
 Inherited
createResizeSnapResult(weight:Number, delta:Number, tag:Object, rectangles:Iterable, size:Number, orientation:SnapLineOrientation, resourceKey:ResourceKey):SnapResult
[static] Factory method that creates a SnapResult that snaps to a given size.
SnapResult
  
[override] Returns a display object creator to visualize this snap result.
SnapLineSnapResult
  
isSnapped(unsnappedCoordinates:IPoint, finalSnapState:SnapState):Boolean
[override] Checks whether this instance is still snapped given the final mouse coordinates.
SnapLineSnapResult
  
snap(unsnappedCoordinates:IPoint, currentSnapState:SnapState):void
[override] Core method that performs the actual snapping.
SnapLineSnapResult
 Inherited
valueOf():Object
Returns the weight of this result.
SnapResult
Property Detail
deltaproperty
delta:Number  [read-only]

The value to add to the mouse coordinates to snap to that result.


Implementation
    public function get delta():Number
movedObjectproperty 
movedObject:Object  [read-only]

The object that is moved and would be snapped with this SnapLineSnapResult.


Implementation
    public function get movedObject():Object
snapLineproperty 
snapLine:SnapLine  [read-only]

The SnapLine associated with this result.


Implementation
    public function get snapLine():SnapLine
snappedCoordinatesproperty 
snappedCoordinates:IPoint  [read-only]

The coordinates of the end point of the snap line. A visual representation of a snap line is usually drawn from the center to these coordinates. This may, however, depend on the implementation.


Implementation
    public function get snappedCoordinates():IPoint

See also

SnapLine.coordinates
Constructor Detail
SnapLineSnapResult()Constructor
public function SnapLineSnapResult(weight:Number, delta:Number, tag:Object, snapLine:SnapLine, snappedCoordinates:IPoint, movedObject:Object)

Creates a new instance of SnapLineSnapResult.

Parameters
weight:Number — Yields the weight of this result, the higher the weight, the more important it is.
 
delta:Number — The value to add to the mouse coordinates to snap to that result.
 
tag:Object — The tag associated with this result. If more than one result uses the same tag (not null), only the one with the highest weight will be rendered.
 
snapLine:SnapLine — The SnapLine this SnapLineSnapResult would snap to.
 
snappedCoordinates:IPoint — The coordinates at the moved item at which the drawn snap line should end.
 
movedObject:Object — The moved object for which this result is created.

See also

SnapResult.weight
Method Detail
getDisplayObjectCreator()method
override public function getDisplayObjectCreator(snapContext:SnapContext):IDisplayObjectCreator

Returns a display object creator to visualize this snap result. The createDisplayObjectCreator method of snapContext is used to create an IDisplayObjectCreator matching the snapLine's resourceKey. If the returned display object creator is of one of the following supported class type, its properties are set accordingly:

Parameters

snapContext:SnapContext

Returns
IDisplayObjectCreator

See also

SnapContext.createDisplayObjectCreator
SnapLine.resourceKey
FixedLinePaintable
FixedDistanceSnapResultPaintable
CenterBetweenBoundsPaintable
CenterBetweenCenterPaintable
EqualDistanceBetweenBoundsPaintable
EqualDistanceBetweenCentersPaintable
isSnapped()method 
override public function isSnapped(unsnappedCoordinates:IPoint, finalSnapState:SnapState):Boolean

Checks whether this instance is still snapped given the final mouse coordinates. This implementation performs the snapping according to the delta and orientation.

Parameters

unsnappedCoordinates:IPoint — The unsnapped coordinates.
 
finalSnapState:SnapState — The final snap state that has been used by the client.

Returns
Boolean — Whether the coordinates are still snapped for this instance.
snap()method 
override public function snap(unsnappedCoordinates:IPoint, currentSnapState:SnapState):void

Core method that performs the actual snapping. This implementation performs the snapping according to the delta and orientation.

Parameters

unsnappedCoordinates:IPoint — The coordinates prior to the snapping.
 
currentSnapState:SnapState — The currently snapped coordinates and the state of the snapping. This instance can be modified by subclasses.

See also

delta
SnapLine.orientation