Packagecom.yworks.canvas.drawing
Classpublic class AbstractInBetweenSnapResultPaintable
InheritanceAbstractInBetweenSnapResultPaintable Inheritance Object
Implements IDisplayObjectCreator
Subclasses CenterBetweenBoundsPaintable, CenterBetweenCenterPaintable, EqualDistanceBetweenBoundsPaintable, EqualDistanceBetweenCentersPaintable

This class contains properties to visualize the snapping of a moved object to a SnapLine induced by two non-moved objects so that all three are positioned in a line and have an equal distance either between their centers or their bounds. The outer lines are positioned at the inner bounds or the centers of the outer two of these three objects while the inner lines belong to the inner object and are either at it's outer bounds or at it's center (In the latter case both inner lines are identical). The equal distance can be visualized by the two distance indicator lines which span between their corresponding outer and inner line. In the created DisplayObject, four lines between outer/innerLine1/2From and outer/innerLine1/2To as well as two double-pointed arrows between distanceIndicator1/2From and distanceIndicator1/2To are painted.



Public Properties
 PropertyDefined By
  distance : Number
The distance either between the bounds or the centers of the three objects.
AbstractInBetweenSnapResultPaintable
  distanceIndicator1From : IPoint
The begin of the first distance indicator line between the first outer and inner lines.
AbstractInBetweenSnapResultPaintable
  distanceIndicator1To : IPoint
The end of the first distance indicator line between the first outer and inner lines.
AbstractInBetweenSnapResultPaintable
  distanceIndicator2From : IPoint
The begin of the second distance indicator line between the second outer and inner lines.
AbstractInBetweenSnapResultPaintable
  distanceIndicator2To : IPoint
The end of the second distance indicator line between the second outer and inner lines.
AbstractInBetweenSnapResultPaintable
  innerLine1From : IPoint
The begin of the first inner line segment.
AbstractInBetweenSnapResultPaintable
  innerLine1To : IPoint
The end of the first inner line segment.
AbstractInBetweenSnapResultPaintable
  innerLine2From : IPoint
The begin of the second inner line segment.
AbstractInBetweenSnapResultPaintable
  innerLine2To : IPoint
The end of the second inner line segment.
AbstractInBetweenSnapResultPaintable
  outerLine1From : IPoint
The begin of the first outer line segment.
AbstractInBetweenSnapResultPaintable
  outerLine1To : IPoint
The end of the first outer line segment.
AbstractInBetweenSnapResultPaintable
  outerLine2From : IPoint
The begin of the second outer line segment.
AbstractInBetweenSnapResultPaintable
  outerLine2To : IPoint
The end of the second outer line segment.
AbstractInBetweenSnapResultPaintable
  stroke : IStroke
The stroke used in the paint method.
AbstractInBetweenSnapResultPaintable
Public Methods
 MethodDefined By
  
Creates a new DisplayObject from scratch.
AbstractInBetweenSnapResultPaintable
  
Draws lines between: outerLine1From and outerLine1To outerLine2From and outerLine2To innerLine1From and innerLine1To innerLine2From and innerLine2To as well as double-pointed arrows between distanceIndicator1From and distanceIndicator1To resp.
AbstractInBetweenSnapResultPaintable
  
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject or creates a new one.
AbstractInBetweenSnapResultPaintable
Property Detail
distanceproperty
distance:Number

The distance either between the bounds or the centers of the three objects.


Implementation
    public function get distance():Number
    public function set distance(value:Number):void
distanceIndicator1Fromproperty 
distanceIndicator1From:IPoint

The begin of the first distance indicator line between the first outer and inner lines.


Implementation
    public function get distanceIndicator1From():IPoint
    public function set distanceIndicator1From(value:IPoint):void
distanceIndicator1Toproperty 
distanceIndicator1To:IPoint

The end of the first distance indicator line between the first outer and inner lines.


Implementation
    public function get distanceIndicator1To():IPoint
    public function set distanceIndicator1To(value:IPoint):void
distanceIndicator2Fromproperty 
distanceIndicator2From:IPoint

The begin of the second distance indicator line between the second outer and inner lines.


Implementation
    public function get distanceIndicator2From():IPoint
    public function set distanceIndicator2From(value:IPoint):void
distanceIndicator2Toproperty 
distanceIndicator2To:IPoint

The end of the second distance indicator line between the second outer and inner lines.


Implementation
    public function get distanceIndicator2To():IPoint
    public function set distanceIndicator2To(value:IPoint):void
innerLine1Fromproperty 
innerLine1From:IPoint

The begin of the first inner line segment.


Implementation
    public function get innerLine1From():IPoint
    public function set innerLine1From(value:IPoint):void
innerLine1Toproperty 
innerLine1To:IPoint

The end of the first inner line segment.


Implementation
    public function get innerLine1To():IPoint
    public function set innerLine1To(value:IPoint):void
innerLine2Fromproperty 
innerLine2From:IPoint

The begin of the second inner line segment.


Implementation
    public function get innerLine2From():IPoint
    public function set innerLine2From(value:IPoint):void
innerLine2Toproperty 
innerLine2To:IPoint

The end of the second inner line segment.


Implementation
    public function get innerLine2To():IPoint
    public function set innerLine2To(value:IPoint):void
outerLine1Fromproperty 
outerLine1From:IPoint

The begin of the first outer line segment.


Implementation
    public function get outerLine1From():IPoint
    public function set outerLine1From(value:IPoint):void
outerLine1Toproperty 
outerLine1To:IPoint

The end of the first outer line segment.


Implementation
    public function get outerLine1To():IPoint
    public function set outerLine1To(value:IPoint):void
outerLine2Fromproperty 
outerLine2From:IPoint

The begin of the second outer line segment.


Implementation
    public function get outerLine2From():IPoint
    public function set outerLine2From(value:IPoint):void
outerLine2Toproperty 
outerLine2To:IPoint

The end of the second outer line segment.


Implementation
    public function get outerLine2To():IPoint
    public function set outerLine2To(value:IPoint):void
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

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 lines between:

as well as double-pointed arrows between distanceIndicator1From and distanceIndicator1To resp. distanceIndicator2From and distanceIndicator2To.

Parameters

g:YGraphics — The graphics object to paint upon.
 
ctx:IPaintContext — The paint context.

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.