Package | com.yworks.canvas.input.snapLines |
Class | public class SnapLine |
Inheritance | SnapLine Object |
Subclasses | NodeBasedSnapLine, NodePairBasedSnapLine, PointBasedSnapLine |
GraphSnapContext
makes use of this class to interactively snap moving elements to snap lines.
See also
Property | Defined By | ||
---|---|---|---|
coordinates : IPoint [read-only]
The coordinates of the center point of the snap line. | SnapLine | ||
from : Number
The smaller value of the coordinate that delimits this snap line. | SnapLine | ||
orientation : SnapLineOrientation [read-only]
The orientation of the snap line as defined in SnapLineOrientation. | SnapLine | ||
resourceKey : ResourceKey [read-only]
The resource key which determines the visual appearance of the snap line. | SnapLine | ||
snapType : uint [read-only]
The type of the line that describes how other items will snap to this line. | SnapLine | ||
tag : Object [read-only]
The tag that is associated with this snap line. | SnapLine | ||
to : Number
The greater value of the coordinate that delimits this snap line. | SnapLine | ||
weight : Number [read-only]
The weight/importance of this snap line. | SnapLine |
Method | Defined By | ||
---|---|---|---|
SnapLine(orientation:SnapLineOrientation, snapType:uint, resourceKey:ResourceKey, coordinates:IPoint, tag:Object, weight:Number, from:Number, to:Number)
Creates a new snap line using the provided attributes. | SnapLine |
Constant | Defined By | ||
---|---|---|---|
SNAP_LINE_BLANK_VARIABLE_LINE_KEY : ResourceKey [static]
Determines a blank line between the SnapLine.coordinates
and the SnapLineSnapResult.snappedCoordinates
| SnapLine | ||
SNAP_LINE_CENTER_BETWEEN_BOUNDS_KEY : ResourceKey [static]
Determines a snap line which lets an item snap in the center between two bounds of other items. | SnapLine | ||
SNAP_LINE_CENTER_BETWEEN_CENTERS_KEY : ResourceKey [static]
Determines a snap line which lets an item snap in the center between two centers of other items. | SnapLine | ||
SNAP_LINE_EQUAL_DISTANCE_BETWEEN_BOUNDS_KEY : ResourceKey [static]
Determines a snap line which lets an item snap if it has an equal distance to two other items. | SnapLine | ||
SNAP_LINE_EQUAL_DISTANCE_BETWEEN_CENTERS_KEY : ResourceKey [static]
Determines a snap line which lets an item snap if it's center has an equal distance to the centers'
of two other items. | SnapLine | ||
SNAP_LINE_EQUAL_HEIGHT_KEY : ResourceKey [static]
Determines the snapping of a resized item if it's new height is equal to another item. | SnapLine | ||
SNAP_LINE_EQUAL_WIDTH_KEY : ResourceKey [static]
Determines the snapping of a resized item if it's new width is equal to another item. | SnapLine | ||
SNAP_LINE_EXTENDED_VARIABLE_LINE_KEY : ResourceKey [static]
Determines a decorated line between the SnapLine.coordinates
and the SnapLineSnapResult.snappedCoordinates that is extended on both sides. | SnapLine | ||
SNAP_LINE_FIXED_DISTANCE_KEY : ResourceKey [static]
Determines a snap line which snaps to a distance between different graph items. | SnapLine | ||
SNAP_LINE_FIXED_LINE_KEY : ResourceKey [static]
Determines a snap line having a fixed visualization independent of the SnapLineSnapResult. | SnapLine | ||
SNAP_LINE_VARIABLE_LINE_KEY : ResourceKey [static]
Determines a decorated line between the SnapLine.coordinates
and the SnapLineSnapResult.snappedCoordinates
| SnapLine | ||
SNAP_TO_GRID_KEY : ResourceKey [static] | SnapLine |
coordinates | property |
coordinates:IPoint
[read-only] The coordinates of the center point of the snap line.
public function get coordinates():IPoint
from | property |
from:Number
The smaller value of the coordinate that delimits this snap line. This is the x coordinate in case of a horizontally oriented snap line, otherwise the y coordinate.
public function get from():Number
public function set from(value:Number):void
See also
orientation | property |
orientation:SnapLineOrientation
[read-only]
The orientation of the snap line as defined in SnapLineOrientation
.
public function get orientation():SnapLineOrientation
See also
resourceKey | property |
resourceKey:ResourceKey
[read-only] The resource key which determines the visual appearance of the snap line.
public function get resourceKey():ResourceKey
snapType | property |
snapType:uint
[read-only] The type of the line that describes how other items will snap to this line. This is one of SnapLineSnapType.TOP, SnapLineSnapType.BOTTOM, SnapLineSnapType.LEFT, SnapLineSnapType.RIGHT, or SnapLineSnapType.CENTER.
public function get snapType():uint
See also
tag | property |
tag:Object
[read-only] The tag that is associated with this snap line. The tag is most commonly used for the snap result tag.
public function get tag():Object
See also
to | property |
to:Number
The greater value of the coordinate that delimits this snap line. This is the x coordinate in case of a horizontally oriented snap line, otherwise the y coordinate.
public function get to():Number
public function set to(value:Number):void
See also
weight | property |
weight:Number
[read-only] The weight/importance of this snap line. Greater values indicate greater importance.
public function get weight():Number
SnapLine | () | Constructor |
public function SnapLine(orientation:SnapLineOrientation, snapType:uint, resourceKey:ResourceKey, coordinates:IPoint, tag:Object, weight:Number, from:Number, to:Number)
Creates a new snap line using the provided attributes.
Parametersorientation:SnapLineOrientation — The orientation of the snap line. This is one of SnapLineOrientation.Horizontal or SnapLineOrientation.Vertical.
| |
snapType:uint — The type of the line that describes how other items will snap to this line.
This is one of SnapLineSnapType.TOP, SnapLineSnapType.BOTTOM, SnapLineSnapType.LEFT, SnapLineSnapType.RIGHT
or SnapLineSnapType.CENTER.
| |
resourceKey:ResourceKey — A resource key which determines the visual representation of this snap line.
| |
coordinates:IPoint — The coordinates of the center point of the snap line.
| |
tag:Object — A tag that is associated with this snap line
| |
weight:Number — The weight (importance) of this snap line. If more than one snap line is snapped to, the one
with the greater weight will be used.
| |
from:Number (default = NaN ) — The smaller value of the coordinate that delimits this snap line.
| |
to:Number (default = NaN ) — The greater value of the coordinate that delimits this snap line.
|
See also
SNAP_LINE_BLANK_VARIABLE_LINE_KEY | Constant |
public static const SNAP_LINE_BLANK_VARIABLE_LINE_KEY:ResourceKey
Determines a blank line between the SnapLine.coordinates
and the SnapLineSnapResult.snappedCoordinates
See also
SNAP_LINE_CENTER_BETWEEN_BOUNDS_KEY | Constant |
public static const SNAP_LINE_CENTER_BETWEEN_BOUNDS_KEY:ResourceKey
Determines a snap line which lets an item snap in the center between two bounds of other items.
SNAP_LINE_CENTER_BETWEEN_CENTERS_KEY | Constant |
public static const SNAP_LINE_CENTER_BETWEEN_CENTERS_KEY:ResourceKey
Determines a snap line which lets an item snap in the center between two centers of other items.
SNAP_LINE_EQUAL_DISTANCE_BETWEEN_BOUNDS_KEY | Constant |
public static const SNAP_LINE_EQUAL_DISTANCE_BETWEEN_BOUNDS_KEY:ResourceKey
Determines a snap line which lets an item snap if it has an equal distance to two other items.
SNAP_LINE_EQUAL_DISTANCE_BETWEEN_CENTERS_KEY | Constant |
public static const SNAP_LINE_EQUAL_DISTANCE_BETWEEN_CENTERS_KEY:ResourceKey
Determines a snap line which lets an item snap if it's center has an equal distance to the centers' of two other items.
SNAP_LINE_EQUAL_HEIGHT_KEY | Constant |
public static const SNAP_LINE_EQUAL_HEIGHT_KEY:ResourceKey
Determines the snapping of a resized item if it's new height is equal to another item.
SNAP_LINE_EQUAL_WIDTH_KEY | Constant |
public static const SNAP_LINE_EQUAL_WIDTH_KEY:ResourceKey
Determines the snapping of a resized item if it's new width is equal to another item.
SNAP_LINE_EXTENDED_VARIABLE_LINE_KEY | Constant |
public static const SNAP_LINE_EXTENDED_VARIABLE_LINE_KEY:ResourceKey
Determines a decorated line between the SnapLine.coordinates
and the SnapLineSnapResult.snappedCoordinates
that is extended on both sides.
See also
SNAP_LINE_FIXED_DISTANCE_KEY | Constant |
public static const SNAP_LINE_FIXED_DISTANCE_KEY:ResourceKey
Determines a snap line which snaps to a distance between different graph items.
SNAP_LINE_FIXED_LINE_KEY | Constant |
public static const SNAP_LINE_FIXED_LINE_KEY:ResourceKey
Determines a snap line having a fixed visualization independent of the SnapLineSnapResult.
See also
SNAP_LINE_VARIABLE_LINE_KEY | Constant |
public static const SNAP_LINE_VARIABLE_LINE_KEY:ResourceKey
Determines a decorated line between the SnapLine.coordinates
and the SnapLineSnapResult.snappedCoordinates
See also
SNAP_TO_GRID_KEY | Constant |
public static const SNAP_TO_GRID_KEY:ResourceKey