Packagecom.yworks.graph.drawing
Classpublic class AbstractEdgeStyleRenderer
InheritanceAbstractEdgeStyleRenderer Inheritance AbstractStyleRenderer Inheritance Object
Implements IPathGeometry, IEdgeStyleRenderer
Subclasses PathBasedEdgeStyleRenderer

Abstract base class for IEdgeStyleRenderer



Public Properties
 PropertyDefined By
 Inheriteditem : IModelItem
[read-only] Gets the currently configured item.
AbstractStyleRenderer
 Inheritedstyle : IVisualStyle
[read-only] Gets the currently configured style.
AbstractStyleRenderer
 InheritedstyleDescriptor : ICanvasObjectDescriptor
[read-only] Gets the ICanvasObjectDescriptor to use for new installations.
AbstractStyleRenderer
Public Methods
 MethodDefined By
 Inherited
Returns a tight rectangular area where the whole rendering would fit into.
AbstractStyleRenderer
 Inherited
Creates a new DisplayObject which represents the styled model item.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, does not call configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
  
Returns a representation of the visible path of the edge in form of a GeneralPath
AbstractEdgeStyleRenderer
  
Gets an implementation of the IPathGeometry interface that can handle the provided edge and its associated style.
AbstractEdgeStyleRenderer
  
Returns the number of "segments" this edge's path consists of.
AbstractEdgeStyleRenderer
  
getSegmentTangent(segment:int, ratio:Number, c:YPoint, up:YPoint):Boolean
Calculates the tangent on the edge's path at the given segment and ratio point.
AbstractEdgeStyleRenderer
  
getTangent(ratio:Number, c:YPoint, up:YPoint):Boolean
Calculates the tangent on the edge's path at the given ratio point.
AbstractEdgeStyleRenderer
 Inherited
install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array
Installs the model in the canvas at the given group using the styleDescriptor.
AbstractStyleRenderer
 Inherited
isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean
Hit tests the item by trying to apply the flash internal hit testing.
AbstractStyleRenderer
 Inherited
Returns true if the corresponding item is considered to intersect the given rectangular box. This method may return false if the item cannot be selected using a selection marquee or optionally if the item is only partially contained within the box.
AbstractStyleRenderer
 Inherited
Calls configure and tests the item using the style for a visible intersection with the clip bounds.
AbstractStyleRenderer
 Inherited
lookup(type:Class):Object
Implements the ILookup interface.
AbstractStyleRenderer
 Inherited
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject.
AbstractStyleRenderer
Protected Methods
 MethodDefined By
 Inherited
configure():void
Prepares this instance for subsequent calls after the style and item have been initialized.
AbstractStyleRenderer
  
[override] Factory method for the StyleDescriptor property.
AbstractEdgeStyleRenderer
  
getSourceArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
Calculate and update the anchor and the source arrow's direction vector.
AbstractEdgeStyleRenderer
  
getTargetArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
Calculate and update the anchor and the target arrow's direction vector.
AbstractEdgeStyleRenderer
 Inherited
setItem(item:IModelItem):void
Called by the various descriptor getters to initialize the item.
AbstractStyleRenderer
 Inherited
Called by the various descriptor getters to initialize the style.
AbstractStyleRenderer
Method Detail
createStyleDescriptor()method
override protected function createStyleDescriptor():ICanvasObjectDescriptor

Factory method for the StyleDescriptor property. This method will be called upon first access to the styleDescriptor property.

Returns
ICanvasObjectDescriptor — An ICanvasObjectDescriptor instance that will delegate to this instance's methods
getPath()method 
public function getPath():GeneralPath

Returns a representation of the visible path of the edge in form of a GeneralPath

Returns
GeneralPath — An instance that describes the visible path or null if this is not applicable for the current geometry.
getPathGeometry()method 
public function getPathGeometry(edge:IEdge, style:IEdgeStyle):IPathGeometry

Gets an implementation of the IPathGeometry interface that can handle the provided edge and its associated style.

This method may return a flyweight implementation.

Parameters

edge:IEdge — The edge to provide an instance for.
 
style:IEdgeStyle — The style to use for the painting.

Returns
IPathGeometry — An implementation that may be used to subsequently query geometry information from. Clients should not cache this instance and must always call this method immediately before using the value returned. This enables the use of the flyweight design pattern for implementations
getSegmentCount()method 
public function getSegmentCount():int

Returns the number of "segments" this edge's path consists of.

Returns
int — the number of segments or -1 if there is no such thing as a segment for this edge.
getSegmentTangent()method 
public function getSegmentTangent(segment:int, ratio:Number, c:YPoint, up:YPoint):Boolean

Calculates the tangent on the edge's path at the given segment and ratio point.

The result is provided through the given point parameters. If the method returns false, no valid result could be calculated and the values of the point parameters should be ignored.

Parameters

segment:int — the index of the zero-based segment.
 
ratio:Number — a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path.
 
c:YPoint — A point in world-coordinate space that denotes the tangent point.
 
up:YPoint — The vector which is tangent to the edge's path at the point p. The tangent vector needs not necessarily be normalized.

Returns
Booleantrue iff the values written to the given points are valid.
getSourceArrowAnchor()method 
protected function getSourceArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean

Calculate and update the anchor and the source arrow's direction vector.

Abstract method, has to be overridden by implementations.

Parameters

arrow:IArrow — The arrow to calculate the anchor for.
 
anchorPoint:IPointSetter — The tip of the arrow.
 
arrowDirection:IPointSetter — The direction vector of the arrow.

Returns
Boolean — Whether an anchor has been successfully determined.
getTangent()method 
public function getTangent(ratio:Number, c:YPoint, up:YPoint):Boolean

Calculates the tangent on the edge's path at the given ratio point.

The result is provided through the given point parameters. If the method returns false, no valid result could be calculated and the values of the point parameters should be ignored.

Parameters

ratio:Number — a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path.
 
c:YPoint — A point in world-coordinate space that denotes the tangent point.
 
up:YPoint — The vector which is tangent to the edge's path at the point p. The tangent vector needs not necessarily be normalized.

Returns
Booleantrue iff the values written to the given points are valid.
getTargetArrowAnchor()method 
protected function getTargetArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean

Calculate and update the anchor and the target arrow's direction vector.

Abstract method, has to be overridden by implementations.

Parameters

arrow:IArrow — The arrow to calculate the anchor for.
 
anchorPoint:IPointSetter — The tip of the arrow.
 
arrowDirection:IPointSetter — The direction vector of the arrow.

Returns
Boolean — Whether an anchor has been successfully determined.