Packagecom.yworks.graph.drawing
Classpublic class ArrowPaintable
ImplementsIBoundsProvider, IPaintable

An IPaintable implementation that paints arrowheads and provides bounds for the drawing engine.



Public Properties
 PropertyDefined by
  anchor : IPoint
[read-only]
ArrowPaintable
  arrowType : uint
[read-only] Returns the type of the arrow as defined in ArrowType.
ArrowPaintable
  direction : IPoint
[read-only] An IPoint which determines the direction of the arrow.
ArrowPaintable
  fill : IFill
The IFill the arrow is filled with.
ArrowPaintable
  length : Number
[read-only] The length of the arrow.
ArrowPaintable
  scale : Number
Defines the scale, the arrow is painted with.
ArrowPaintable
  stroke : IStroke
The IStroke the arrow's outline is drawn with.
ArrowPaintable
Public Methods
 MethodDefined by
  
ArrowPaintable(anchor:IPoint, direction:IPoint, length:Number)
Don't call the constructor directly - use the create factory method.
ArrowPaintable
  
Returns a tight rectangular area where the whole rendering would fit into.
ArrowPaintable
  
create(type:uint, anchor:IPoint, direction:IPoint, stroke:IStroke, fill:IFill):ArrowPaintable
[static] Factory method which will create an arrow of the given type and dimensions.
ArrowPaintable
  
paint(g:YGraphics, ctx:IPaintContext):void
Performs the actual painting into the given graphics context.
ArrowPaintable
Property detail
anchorproperty
anchor:IPoint  [read-only]Implementation
    public function get anchor():IPoint
arrowTypeproperty 
arrowType:uint  [read-only]

Returns the type of the arrow as defined in ArrowType.

Has to be overriden by subclass implementations.

Implementation
    public function get arrowType():uint

See also

directionproperty 
direction:IPoint  [read-only]

An IPoint which determines the direction of the arrow.

Implementation
    public function get direction():IPoint
fillproperty 
fill:IFill  [read-write]

The IFill the arrow is filled with.

Implementation
    public function get fill():IFill
    public function set fill(value:IFill):void
lengthproperty 
length:Number  [read-only]

The length of the arrow.

Implementation
    public function get length():Number
scaleproperty 
scale:Number  [read-write]

Defines the scale, the arrow is painted with.

Implementation
    public function get scale():Number
    public function set scale(value:Number):void
strokeproperty 
stroke:IStroke  [read-write]

The IStroke the arrow's outline is drawn with.

Implementation
    public function get stroke():IStroke
    public function set stroke(value:IStroke):void
Constructor detail
ArrowPaintable()constructor
public function ArrowPaintable(anchor:IPoint, direction:IPoint, length:Number)

Don't call the constructor directly - use the create factory method.

Parameters
anchor:IPoint
 
direction:IPoint
 
length:Number
Method detail
calculateBounds()method
public function calculateBounds(scratch:IMutableRectangle, ctx:ICanvasContext):IRectangle

Returns a tight rectangular area where the whole rendering would fit into.

Implementations can use the scratch rectangle to put their results in and return it as the result of the operation. Client has to always provide a non-null instance as a parameter. They may however decide to return an internally cached or dynamically created IRectangle implementation and disregard the scratch parameter. If calculating the bounds is too expensive or the painting is not bound to a certain area, this method may return null. If nothing is painted, this method should return an empty rectangle, where either or both the width and height is non-positive or ImmutableRectangle.Empty.

Parameters
scratch:IMutableRectangle — An instance that can optionally be used to fill with the corresponding values and be returned
 
ctx:ICanvasContext — The context to calculate the bounds for (currently not used)

Returns
IRectangle — The bounds or null to indicate an unbound area
create()method 
public static function create(type:uint, anchor:IPoint, direction:IPoint, stroke:IStroke, fill:IFill):ArrowPaintable

Factory method which will create an arrow of the given type and dimensions.

Parameters
type:uint — Type of the arrow as defined in ArrowType
 
anchor:IPoint — The point the arrow is anchored to by reference.
 
direction:IPoint — The direction of the arrow by reference.
 
stroke:IStroke — The stroke the arrow is painted with.
 
fill:IFill — The fill the arrow is filled with.

Returns
ArrowPaintable — An arrow Paintable specified by the above parameters.

See also

paint()method 
public function paint(g:YGraphics, ctx:IPaintContext):void

Performs the actual painting into the given graphics context.

Parameters
g:YGraphics — The graphics context to paint into
 
ctx:IPaintContext — Currently not used