Packagecom.yworks.canvas.drawing
Classpublic class FixedDistanceSnapResultPaintable
InheritanceFixedDistanceSnapResultPaintable Inheritance Object
Implements IDisplayObjectCreator

This class visualizes the snapping of a moved object (target) to a 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

SnapLine


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined By
  
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
Property Detail
distanceproperty
distance:Number

The distance from the source the target has snapped to.


Implementation
    public function get distance():Number
    public function set distance(value:Number):void
distanceIndicatorFromproperty 
distanceIndicatorFrom:IPoint

The begin of the distance indicator line.


Implementation
    public function get distanceIndicatorFrom():IPoint
    public function set distanceIndicatorFrom(value:IPoint):void
distanceIndicatorToproperty 
distanceIndicatorTo:IPoint

The end of the distance indicator line.


Implementation
    public function get distanceIndicatorTo():IPoint
    public function set distanceIndicatorTo(value:IPoint):void
sourceLineFromproperty 
sourceLineFrom:IPoint

The begin of the source line segment.


Implementation
    public function get sourceLineFrom():IPoint
    public function set sourceLineFrom(value:IPoint):void
sourceLineToproperty 
sourceLineTo:IPoint

The end of the source line segment.


Implementation
    public function get sourceLineTo():IPoint
    public function set sourceLineTo(value:IPoint):void
sourcePointproperty 
sourcePoint:IPoint

A position in world coordinates representing the source of the SnapLine.


Implementation
    public function get sourcePoint():IPoint
    public function set sourcePoint(value:IPoint):void

See also

SnapLine
SnapLineSnapResult
strokeproperty 
stroke:IStroke

The stroke used in the paint method.


Implementation
    public function get stroke():IStroke
    public function set stroke(value:IStroke):void

See also

targetLineFromproperty 
targetLineFrom:IPoint

The begin of the target line segment.


Implementation
    public function get targetLineFrom():IPoint
    public function set targetLineFrom(value:IPoint):void
targetLineToproperty 
targetLineTo:IPoint

The end of the target line segment.


Implementation
    public function get targetLineTo():IPoint
    public function set targetLineTo(value:IPoint):void
targetPointproperty 
targetPoint:IPoint

The location in world coordinates where the target has snapped to the SnapLine.


Implementation
    public function get targetPoint():IPoint
    public function set targetPoint(value:IPoint):void

See also

SnapLine
SnapLineSnapResult
Method Detail
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.

Returns
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.

Returns
DisplayObject — The updated display object or a completely new display object.