Package | com.yworks.canvas.drawing |
Class | public class FixedDistanceSnapResultPaintable |
Inheritance | FixedDistanceSnapResultPaintable Object |
Implements | IDisplayObjectCreator |
SnapLine
(target line)
that has a fixed distance
to a non-moved object (source).
The source line is the line induced by the source to which the target shall keep the fixed distance.
The sourceLineFrom
and sourceLineTo
resp. targetLineFrom
and
targetLineTo
positions mark significant segments of the source and target line for the
SnapResult
at hand.
The fixed distance
can be visualized by a line between distanceIndicatorFrom
and distanceIndicatorTo
which is orthogonal to the source and target lines.
A line between sourceLineFrom
and sourceLineTo
as well as a
double-pointed arrow between distanceIndicatorFrom
and distanceIndicatorTo
is
drawn in the created display object.
The source point is further marked with a cross.
See also
Property | Defined By | ||
---|---|---|---|
distance : Number
The distance from the source the target has snapped to. | FixedDistanceSnapResultPaintable | ||
distanceIndicatorFrom : IPoint
The begin of the distance indicator line. | FixedDistanceSnapResultPaintable | ||
distanceIndicatorTo : IPoint
The end of the distance indicator line. | FixedDistanceSnapResultPaintable | ||
sourceLineFrom : IPoint
The begin of the source line segment. | FixedDistanceSnapResultPaintable | ||
sourceLineTo : IPoint
The end of the source line segment. | FixedDistanceSnapResultPaintable | ||
sourcePoint : IPoint
A position in world coordinates representing the source of the SnapLine. | FixedDistanceSnapResultPaintable | ||
stroke : IStroke
The stroke used in the paint method. | FixedDistanceSnapResultPaintable | ||
targetLineFrom : IPoint
The begin of the target line segment. | FixedDistanceSnapResultPaintable | ||
targetLineTo : IPoint
The end of the target line segment. | FixedDistanceSnapResultPaintable | ||
targetPoint : IPoint
The location in world coordinates where the target has snapped to the SnapLine. | FixedDistanceSnapResultPaintable |
Method | Defined By | ||
---|---|---|---|
createDisplayObject(context:IDisplayObjectContext):DisplayObject
Creates a new DisplayObject from scratch. | FixedDistanceSnapResultPaintable | ||
Draws a line between sourceLineFrom and sourceLineTo as well as a double-pointed arrow
between distanceIndicatorFrom and distanceIndicatorTo. | FixedDistanceSnapResultPaintable | ||
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject or creates a new one. | FixedDistanceSnapResultPaintable |
distance | property |
distance:Number
The distance from the source the target has snapped to.
public function get distance():Number
public function set distance(value:Number):void
distanceIndicatorFrom | property |
distanceIndicatorFrom:IPoint
The begin of the distance indicator line.
public function get distanceIndicatorFrom():IPoint
public function set distanceIndicatorFrom(value:IPoint):void
distanceIndicatorTo | property |
distanceIndicatorTo:IPoint
The end of the distance indicator line.
public function get distanceIndicatorTo():IPoint
public function set distanceIndicatorTo(value:IPoint):void
sourceLineFrom | property |
sourceLineFrom:IPoint
The begin of the source line segment.
public function get sourceLineFrom():IPoint
public function set sourceLineFrom(value:IPoint):void
sourceLineTo | property |
sourceLineTo:IPoint
The end of the source line segment.
public function get sourceLineTo():IPoint
public function set sourceLineTo(value:IPoint):void
sourcePoint | property |
sourcePoint:IPoint
A position in world coordinates representing the source of the SnapLine
.
public function get sourcePoint():IPoint
public function set sourcePoint(value:IPoint):void
See also
stroke | property |
stroke:IStroke
The stroke used in the paint
method.
public function get stroke():IStroke
public function set stroke(value:IStroke):void
See also
targetLineFrom | property |
targetLineFrom:IPoint
The begin of the target line segment.
public function get targetLineFrom():IPoint
public function set targetLineFrom(value:IPoint):void
targetLineTo | property |
targetLineTo:IPoint
The end of the target line segment.
public function get targetLineTo():IPoint
public function set targetLineTo(value:IPoint):void
targetPoint | property |
targetPoint:IPoint
The location in world coordinates where the target has snapped to the SnapLine
.
public function get targetPoint():IPoint
public function set targetPoint(value:IPoint):void
See also
createDisplayObject | () | method |
public function createDisplayObject(context:IDisplayObjectContext):DisplayObject
Creates a new DisplayObject
from scratch.
Parameters
context:IDisplayObjectContext — The context for which the display object is created.
|
DisplayObject — A DisplayObject .
|
paint | () | method |
public function paint(g:YGraphics, ctx:IPaintContext):void
Draws a line between sourceLineFrom
and sourceLineTo
as well as a double-pointed arrow
between distanceIndicatorFrom
and distanceIndicatorTo
.
The sourcePoint
is further marked with a cross.
Parameters
g:YGraphics — The graphics object to paint upon.
| |
ctx:IPaintContext — The paint context.
|
See also
updateDisplayObject | () | method |
public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject
or creates a new one.
Implementors can decide whether they update the given display object or create a new one. Updating can mean re-rendering or updating size and/or coordinates.
Parameters
oldDisplayObject:DisplayObject — The display object to update.
| |
context:IDisplayObjectContext — The context for which the display object should be updated.
|
DisplayObject — The updated display object or a completely new display object.
|