| Package | com.yworks.graph.drawing |
| Class | public class ArrowPaintable |
| Implements | IBoundsProvider, IPaintable |
IPaintable implementation that paints arrowheads and provides
bounds for the drawing engine.
| Property | Defined 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 | ||
| Method | Defined by | ||
|---|---|---|---|
|
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 | ||
|
[static]
Factory method which will create an arrow of the given type and dimensions.
| ArrowPaintable | ||
|
Performs the actual painting into the given graphics context.
| ArrowPaintable | ||
| anchor | property |
| arrowType | property |
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
| direction | property |
direction:IPoint [read-only]
An IPoint which determines the direction of the arrow.
public function get direction():IPoint
| fill | property |
fill:IFill [read-write]
The IFill the arrow is filled with.
public function get fill():IFill
public function set fill(value:IFill):void
| length | property |
length:Number [read-only]The length of the arrow.
Implementation public function get length():Number
| scale | property |
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
| stroke | property |
stroke:IStroke [read-write]
The IStroke the arrow's outline is drawn with.
public function get stroke():IStroke
public function set stroke(value:IStroke):void
| ArrowPaintable | () | constructor |
public function ArrowPaintable(anchor:IPoint, direction:IPoint, length:Number)
Don't call the constructor directly - use the create factory method.
anchor:IPoint |
|
direction:IPoint |
|
length:Number |
| calculateBounds | () | method |
public function calculateBounds(scratch:IMutableRectangle, ctx:ICanvasContext):IRectangleReturns 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.
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)
|
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):ArrowPaintableFactory method which will create an arrow of the given type and dimensions.
Parameterstype: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.
|
ArrowPaintable —
An arrow Paintable specified by the above parameters.
|
See also
| paint | () | method |
public function paint(g:YGraphics, ctx:IPaintContext):voidPerforms the actual painting into the given graphics context.
Parametersg:YGraphics — The graphics context to paint into
|
|
ctx:IPaintContext — Currently not used
|