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

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



Public Properties
 PropertyDefined by
 Inheriteditem : IModelItem
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
Gets the currently configured style.
AbstractStyleRenderer
 InheritedstyleDescriptor : ICanvasObjectDescriptor
Gets the ICanvasObjectDescriptor to use for new installations.
AbstractStyleRenderer
Protected Properties
 PropertyDefined by
 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
Returns a tight rectangular area where the whole rendering would fit into.
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
This method is overridden for performance reasons.
PathBasedEdgeStyleRenderer
 Inherited
Configures the style and item parameters, calls configure and returns this.
AbstractStyleRenderer
 Inherited
Gets an implementation of the IPaintable interface that can handle the provided item and its associated style.
AbstractEdgeStyleRenderer
 Inherited
Returns a representation of the visible path of the edge in form of a GeneralPath
PathBasedEdgeStyleRenderer
 Inherited
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.
PolylineEdgeStyleRenderer
  
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.
PolylineEdgeStyleRenderer
  
getTangent(ratio:Number, p:YPoint, t:YPoint):Boolean
Calculates the tangent on the edge's path at the given ratio point.
PolylineEdgeStyleRenderer
 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
This method is overriden for performance reasons.
PathBasedEdgeStyleRenderer
 Inherited
isInBox(box:IRectangle, ctx:ICanvasContext):Boolean
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
  
isVisible(clip:IRectangle, ctx:ICanvasContext):Boolean
Calls configure and tests the item using the style for a visible intersection with the clip bounds.
PolylineEdgeStyleRenderer
  
lookup(type:Class):Object
Implements the ILookup interface.
PolylineEdgeStyleRenderer
 Inherited
paint(g:YGraphics, ctx:IPaintContext):void
Paints the path
PathBasedEdgeStyleRenderer
Protected Methods
 MethodDefined by
 Inherited
configure():void
Prepares this instance for subsequent calls after the style and item have been initialized.
PathBasedEdgeStyleRenderer
  
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
Factory method for the StyleDescriptor property.
AbstractEdgeStyleRenderer
 Inherited
cropPath(pathToCrop:GeneralPath):void
Crops the edge's path at the nodes.
PathBasedEdgeStyleRenderer
  
getSmoothing():Number
Gets the smoothing factor
PolylineEdgeStyleRenderer
 Inherited
getSourceArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
Calculate and update the anchor and the source arrow's direction vector.
PathBasedEdgeStyleRenderer
  
getStroke():IStroke
Gets the pen to use for painting the path.
PolylineEdgeStyleRenderer
 Inherited
getTargetArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):Boolean
Calculate and update the anchor and the target arrow's direction vector.
PathBasedEdgeStyleRenderer
 Inherited
paintArrows(g:YGraphics, ctx:IPaintContext):void
Paints the provided arrows using the graphics context.
AbstractEdgeStyleRenderer
 Inherited
setItem(item:IModelItem):void
Called by the various descriptor getters to initialize the item.
AbstractStyleRenderer
 Inherited
setStyle(style:IVisualStyle):void
Called by the various descriptor getters to initialize the style.
AbstractStyleRenderer
Property detail
selfLoopDistanceproperty
selfLoopDistance:Number  [read-write]

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
protected override 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 
public override 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 override 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 
protected override function getSmoothing():Number

Gets the smoothing factor

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

Gets the pen to use for painting the path.

Returns
IStroke — the stroke or null.
getTangent()method 
public override 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 
public override 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 teh item may be painted within the clip bounds.
lookup()method 
public override 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