Packagecom.yworks.canvas.drawing
Classpublic class EqualSizePaintable
InheritanceEqualSizePaintable Inheritance Object
Implements IDisplayObjectCreator
Subclasses EqualHeightPaintable, EqualWidthPaintable

This abstract class contains some common properties that are used to visualize resize snap results.



Public Properties
 PropertyDefined By
  rectangles : Iterable
An Iterable of IRectangles containing the bounds of the resized objects as well as the bounds of the (non-resizing) rectangular objects the snapped size was based upon.
EqualSizePaintable
  size : Number
The size the resized object snapped to.
EqualSizePaintable
  stroke : IStroke
The stroke used in the paint method.
EqualSizePaintable
Public Methods
 MethodDefined By
  
Creates a new DisplayObject from scratch.
EqualSizePaintable
  
This implementation does nothing and has to be overridden by its subclasses.
EqualSizePaintable
  
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject or creates a new one.
EqualSizePaintable
Property Detail
rectanglesproperty
rectangles:Iterable

An Iterable of IRectangles containing the bounds of the resized objects as well as the bounds of the (non-resizing) rectangular objects the snapped size was based upon.


Implementation
    public function get rectangles():Iterable
    public function set rectangles(value:Iterable):void
sizeproperty 
size:Number

The size the resized object snapped to.


Implementation
    public function get size():Number
    public function set size(value:Number):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

This implementation does nothing and has to be overridden by its subclasses.

Parameters

g:YGraphics
 
ctx:IPaintContext

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.