Packagecom.yworks.graph.drawing
Classpublic class PolylineEdgeStyleRenderer
InheritancePolylineEdgeStyleRenderer Inheritance PathBasedEdgeStyleRenderer Inheritance AbstractEdgeStyleRenderer Inheritance AbstractStyleRenderer Inheritance Object

A style renderer that can be used together with a PolylineEdgeStyle.



Public Properties
 PropertyDefined By
 Inheriteditem : IModelItem
[read-only] Gets the currently configured item.
AbstractStyleRenderer
  selfLoopDistance : Number
Gets or sets the distance between the node's layout and its self loop control points.
PolylineEdgeStyleRenderer
 Inheritedstyle : IVisualStyle
[read-only] Gets the currently configured style.
AbstractStyleRenderer
 InheritedstyleDescriptor : ICanvasObjectDescriptor
[read-only] Gets the ICanvasObjectDescriptor to use for new installations.
AbstractStyleRenderer
Protected Properties
 PropertyDefined By
 InheritedaddBridges : Boolean
[read-only] Determines whether the rendered path should use the BridgeManager to add bridges to it.
PathBasedEdgeStyleRenderer
 Inheritedpath : GeneralPath
The path instance that this instance is working with.
PathBasedEdgeStyleRenderer
  stroke : IStroke
[read-only] Gets the pen to use for painting the path.
PolylineEdgeStyleRenderer
Public Methods
 MethodDefined By
 Inherited
[override] Returns a tight rectangular area where the whole rendering would fit into.
PathBasedEdgeStyleRenderer
 Inherited
[override]
PathBasedEdgeStyleRenderer
  
createRectangleSelfLoop(sx:Number, sy:Number, oppositeX:Number, oppositeY:Number, tx:Number, ty:Number):GeneralPath
[static] Static utility method that creates a rectangular self loop path.
PolylineEdgeStyleRenderer
 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
[override] This method is overridden for performance reasons.
PathBasedEdgeStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Yield the obstacles that the item that provided this instance would add to the scene for the given IPaintContext.
PathBasedEdgeStyleRenderer
 Inherited
[override] Returns a representation of the visible path of the edge in form of a GeneralPath
PathBasedEdgeStyleRenderer
 Inherited
Returns an IDisplayObjectCreator for the given path and stroke.
PathBasedEdgeStyleRenderer
 Inherited
Gets an implementation of the IPathGeometry interface that can handle the provided edge and its associated style.
AbstractEdgeStyleRenderer
  
[override] Returns the number of "segments" this edge's path consists of.
PolylineEdgeStyleRenderer
  
getSegmentTangent(segment:int, ratio:Number, p:YPoint, t:YPoint):Boolean
[override] Calculates the tangent on the edge's path at the given segment and ratio point.
PolylineEdgeStyleRenderer
 Inherited
getSourceArrowAnchor(path:GeneralPath, arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
[static]
PathBasedEdgeStyleRenderer
  
getTangent(ratio:Number, p:YPoint, t:YPoint):Boolean
[override] Calculates the tangent on the edge's path at the given ratio point.
PolylineEdgeStyleRenderer
 Inherited
getTargetArrowAnchor(path:GeneralPath, arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
[static]
PathBasedEdgeStyleRenderer
 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
[override] This method is overridden for performance reasons.
PathBasedEdgeStyleRenderer
 Inherited
[override] 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.
PathBasedEdgeStyleRenderer
  
[override] Calls configure and tests the item using the style for a visible intersection with the clip bounds.
PolylineEdgeStyleRenderer
  
lookup(type:Class):Object
[override] Implements the ILookup interface.
PolylineEdgeStyleRenderer
 Inherited
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
[override]
PathBasedEdgeStyleRenderer
 Inherited
Updates the given IDisplayObjectCreator for the given path and stroke.
PathBasedEdgeStyleRenderer
Protected Methods
 MethodDefined By
 Inherited
configure():void
[override] Prepares this instance for subsequent calls after the style and item have been initialized.
PathBasedEdgeStyleRenderer
  
[override] create simple path using straight lines from the sourceport to the targetport via the bends.
PolylineEdgeStyleRenderer
  
Special implementation that will create a self loop path.
PolylineEdgeStyleRenderer
 Inherited
[override] Factory method for the StyleDescriptor property.
AbstractEdgeStyleRenderer
 Inherited
cropPath(pathToCrop:GeneralPath):void
Crops the edge's path at the nodes.
PathBasedEdgeStyleRenderer
 Inherited
Yields the IAddBridgesCallback to use for adding bridges to the created path.
PathBasedEdgeStyleRenderer
  
getSmoothing():Number
[override] Gets the smoothing factor
PolylineEdgeStyleRenderer
 Inherited
getSourceArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
[override] Calculate and update the anchor and the source arrow's direction vector.
PathBasedEdgeStyleRenderer
  
getStroke():IStroke
[override] Gets the pen to use for painting the path.
PolylineEdgeStyleRenderer
 Inherited
getTargetArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
[override] Calculate and update the anchor and the target arrow's direction vector.
PathBasedEdgeStyleRenderer
 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
Property Detail
selfLoopDistanceproperty
selfLoopDistance:Number

Gets or sets the distance between the node's layout and its self loop control points.


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

Gets the pen to use for painting the path.


Implementation
    protected function get stroke():IStroke
Method Detail
createPath()method
override protected function createPath():GeneralPath

create simple path using straight lines from the sourceport to the targetport via the bends.

Returns
GeneralPath — the created path
createRectangleSelfLoop()method 
public static function createRectangleSelfLoop(sx:Number, sy:Number, oppositeX:Number, oppositeY:Number, tx:Number, ty:Number):GeneralPath

Static utility method that creates a rectangular self loop path.

Parameters

sx:Number — The x coordinate of the source port.
 
sy:Number — The y coordinate of the source port.
 
oppositeX:Number — The x coordinate of the single control point.
 
oppositeY:Number — The y coordinate of the single control point.
 
tx:Number — The x coordinate of the target port.
 
ty:Number — The y coordinate of the target port.

Returns
GeneralPath — A path that describes a rectangular self loop.

See also

createSelfLoopPath
createSelfLoopPath()method 
protected function createSelfLoopPath():GeneralPath

Special implementation that will create a self loop path.

Returns
GeneralPath — edge path as GeneralPath
getSegmentCount()method 
override 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 
override public function getSegmentTangent(segment:int, ratio:Number, p:YPoint, t: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.
 
p:YPoint — A point in world-coordinate space that denotes the tangent point.
 
t: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.
getSmoothing()method 
override protected function getSmoothing():Number

Gets the smoothing factor

Returns
Number — The smoothing factor
getStroke()method 
override protected function getStroke():IStroke

Gets the pen to use for painting the path.

Returns
IStroke — the stroke or null.
getTangent()method 
override public function getTangent(ratio:Number, p:YPoint, t: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.
 
p:YPoint — A point in world-coordinate space that denotes the tangent point.
 
t: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.
isVisible()method 
override public function isVisible(clip:IRectangle, ctx:ICanvasContext):Boolean

Calls configure and tests the item using the style for a visible intersection with the clip bounds.

This simple implementation uses calculateBounds to determine the visibility. Subclasses may choose to override this behavior for improved performance but need to make sure to call configure if they depend on a configured instance.

Parameters

clip:IRectangle — The clip bounds
 
ctx:ICanvasContext — The current canvas context

Returns
Booleantrue if the item may be painted within the clip bounds.
lookup()method 
override public function lookup(type:Class):Object

Implements the ILookup interface.

This method will be used by default if getContext has been queried for a lookup implementation. Note that it cannot be assumed that configure has already been invoked. However, normally item and style will be correctly configured if invoked directly after getContext. Subclass implementations should make sure to configure this instance before they return this as a result of a successful lookup.

Parameters

type:Class — The type to query for

Returns
Object — An implementation of the given type or null