Package | com.yworks.graph.model |
Class | public class DefaultArrow |
Inheritance | DefaultArrow Object |
Implements | IArrow |
IArrow
that provides a number of convenience factory methods
and singleton instances for default arrow types.
Instances should only be created using the create()
method.
See also
Property | Defined By | ||
---|---|---|---|
cropLength : Number [read-only]
Gets the cropping length associated with this instance. | DefaultArrow | ||
length : Number [read-only]
Returns the length of the arrow, i.e. | DefaultArrow | ||
none : IArrow [static] [read-only]
A singleton IArrow instance that paints no arrow at all. | DefaultArrow | ||
scale : Number
The scale factor. | DefaultArrow | ||
type : uint [read-only]
Returns the type of the arrow as defined in ArrowType
| DefaultArrow |
Method | Defined By | ||
---|---|---|---|
DefaultArrow(length:Number, cropLength:Number, scale:Number = 1.0)
Initializes a new instance of the DefaultArrow class
using the given length, cropping length, and scale values. | DefaultArrow | ||
create(arrowType:uint, stroke:IStroke = null, fill:IFill = null, cropLength:Number = 0.0, scale:Number = 1.0):IArrow [static]
Factory method that creates an arrow of the given type using the provided stroke, fill and and crop length. | DefaultArrow | ||
createDefault(arrowType:uint):IArrow [static]
Factory method that creates an arrow of the given type using a black stroke and fill. | DefaultArrow | ||
Gets an IBoundsProvider implementation that can yield
this arrow's bounds if painted the given location using the
given direction for the given edge. | DefaultArrow | ||
getDisplayObjectCreator(edge:IEdge, atSource:Boolean, anchor:IPoint, direction:IPoint):IDisplayObjectCreator
Gets an implementation of IDisplayObjectCreator that will create
the display object for the arrow. | DefaultArrow |
cropLength | property |
cropLength:Number
[read-only] Gets the cropping length associated with this instance.
This value is used by IEdgeStyle
implementations to let the
edge appear to end shortly before it's actual target.
public function get cropLength():Number
length | property |
length:Number
[read-only] Returns the length of the arrow, i.e. the distance from the arrows tip to the position where the visual representation of the edge's path should begin.
public function get length():Number
none | property |
none:IArrow
[read-only]
A singleton IArrow
instance that paints no arrow at all.
public static function get none():IArrow
scale | property |
scale:Number
The scale factor.
public function get scale():Number
public function set scale(value:Number):void
type | property |
type:uint
[read-only]
Returns the type of the arrow as defined in ArrowType
public function get type():uint
See also
DefaultArrow | () | Constructor |
public function DefaultArrow(length:Number, cropLength:Number, scale:Number = 1.0)
Initializes a new instance of the DefaultArrow
class
using the given length, cropping length, and scale values.
Programmers should never use this constructor to create new instances
but use the create()
method instead
length:Number — The length of the arrow.
| |
cropLength:Number — The length by which an edge's path needs to be cropped.
| |
scale:Number (default = 1.0 ) — The scale factor to apply.
|
create | () | method |
public static function create(arrowType:uint, stroke:IStroke = null, fill:IFill = null, cropLength:Number = 0.0, scale:Number = 1.0):IArrow
Factory method that creates an arrow of the given type using the provided stroke, fill and and crop length.
Parameters
arrowType:uint — The type of the arrow.
| |
stroke:IStroke (default = null ) — The stroke to draw the outline with or null .
| |
fill:IFill (default = null ) — The fill to fill the interior with or null .
| |
cropLength:Number (default = 0.0 ) — Length of the crop.
| |
scale:Number (default = 1.0 )
|
IArrow — An arrow.
|
See also
createDefault | () | method |
public static function createDefault(arrowType:uint):IArrow
Factory method that creates an arrow of the given type using a black stroke and fill.
Parameters
arrowType:uint — The type of the arrow.
|
IArrow — An arrow.
|
See also
getBoundsProvider | () | method |
public function getBoundsProvider(edge:IEdge, atSource:Boolean, anchor:IPoint, direction:IPoint):IBoundsProvider
Gets an IBoundsProvider
implementation that can yield
this arrow's bounds if painted the given location using the
given direction for the given edge.
Parameters
edge:IEdge — The edge this arrow belongs to
| |
atSource:Boolean — Whether this will be the source arrow
| |
anchor:IPoint — The anchor point for the tip of the arrow
| |
direction:IPoint — The direction the arrow is pointing in
|
IBoundsProvider — An implementation of the IBoundsProvider
interface that can
subsequently be used to query the bounds. Clients will always call
this method before using the implementation and may not cache the instance returned.
This allows for applying the flyweight design pattern to implementations.
|
getDisplayObjectCreator | () | method |
public function getDisplayObjectCreator(edge:IEdge, atSource:Boolean, anchor:IPoint, direction:IPoint):IDisplayObjectCreator
Gets an implementation of IDisplayObjectCreator
that will create
the display object for the arrow.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called.
This contract enables the use of the fly-weight design pattern. Implementations of this class can always return the same instance and configure this instance upon each call to this method.
Parameters
edge:IEdge — The edge this arrow belongs to
| |
atSource:Boolean — Whether this will be the source arrow
| |
anchor:IPoint — The anchor point for the tip of the arrow
| |
direction:IPoint — The direction the arrow is pointing in
|
IDisplayObjectCreator — An implementation of the IDisplayObjectCreator interface that can
subsequently be used to perform the actual painting.
|