| Package | com.yworks.graph.input.snapLines |
| Class | public class SnapLineSnapResult |
| Inheritance | SnapLineSnapResult SnapResult flash.events.EventDispatcher |
SnapLine to which the current moved item will potentially snap.
See also
| Property | Defined 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 | ||
![]() | nullResult : 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 | ||
![]() | tag : Object [read-only]
The tag associated with this result. | SnapResult | |
![]() | weight : Number [read-only]
Yields the weight of this result, the higher the weight, the more important it is. | SnapResult | |
| Method | Defined By | ||
|---|---|---|---|
SnapLineSnapResult(weight:Number, delta:Number, tag:Object, snapLine:SnapLine, snappedCoordinates:IPoint, movedObject:Object)
Creates a new instance of SnapLineSnapResult. | SnapLineSnapResult | ||
![]() | compareTo(snapResultA:Object, snapResultB:Object):int [static]
Compares the weights of the two SnapResults. | SnapResult | |
![]() | 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 | |
![]() | 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 | ||
[override]
Checks whether this instance is still snapped given the final mouse coordinates. | SnapLineSnapResult | ||
[override]
Core method that performs the actual snapping. | SnapLineSnapResult | ||
![]() | valueOf():Object
Returns the weight of this result. | SnapResult | |
| delta | property |
delta:Number [read-only] The value to add to the mouse coordinates to snap to that result.
public function get delta():Number| movedObject | property |
movedObject:Object [read-only]
The object that is moved and would be snapped with this SnapLineSnapResult.
public function get movedObject():Object| snapLine | property |
snapLine:SnapLine [read-only] The SnapLine associated with this result.
public function get snapLine():SnapLine| snappedCoordinates | property |
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.
public function get snappedCoordinates():IPointSee also
| SnapLineSnapResult | () | Constructor |
public function SnapLineSnapResult(weight:Number, delta:Number, tag:Object, snapLine:SnapLine, snappedCoordinates:IPoint, movedObject:Object)
Creates a new instance of SnapLineSnapResult.
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
| 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:
FixedLinePaintableFixedDistanceSnapResultPaintableCenterBetweenBoundsPaintableCenterBetweenCenterPaintableEqualDistanceBetweenBoundsPaintableEqualDistanceBetweenCentersPaintableParameters
snapContext:SnapContext |
IDisplayObjectCreator |
See also
| 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.
|
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