| Package | com.yworks.graph.drawing |
| Class | public class PathBasedEdgeStyleRenderer |
| Inheritance | PathBasedEdgeStyleRenderer AbstractEdgeStyleRenderer AbstractStyleRenderer |
| Subclasses | PolylineEdgeStyleRenderer |
IEdgeStyleRenderer implementations that are based on
the calculation of a GeneralPath.
See also
| Property | Defined by | ||
|---|---|---|---|
| path : GeneralPath
The path instance that this instance is working with.
| PathBasedEdgeStyleRenderer | ||
| Method | Defined by | ||
|---|---|---|---|
|
Returns a tight rectangular area where the whole rendering
would fit into.
| PathBasedEdgeStyleRenderer | ||
![]() |
Configures the
style and item parameters,
calls configure and returns this. | AbstractStyleRenderer | |
![]() |
Configures the
style and item parameters,
does not call configure and returns this. | AbstractStyleRenderer | |
|
This method is overridden for performance reasons.
| PathBasedEdgeStyleRenderer | ||
![]() |
Configures the
style and item parameters,
calls configure and returns this. | AbstractStyleRenderer | |
![]() |
Gets an implementation of the
IPaintable interface that can
handle the provided item and its associated style. | AbstractEdgeStyleRenderer | |
|
Returns a representation of the visible path of the edge in form of a
GeneralPath
| PathBasedEdgeStyleRenderer | ||
![]() |
Gets an implementation of the
IPathGeometry interface that can
handle the provided edge and its associated style. | AbstractEdgeStyleRenderer | |
![]() |
getSegmentCount():int
Returns the number of "segments" this edge's path consists of.
| AbstractEdgeStyleRenderer | |
![]() |
Calculates the tangent on the edge's path at the given segment and ratio point.
| AbstractEdgeStyleRenderer | |
![]() |
Calculates the tangent on the edge's path at the given ratio point.
| AbstractEdgeStyleRenderer | |
![]() |
Installs the model in the canvas at the given group using the
styleDescriptor. | AbstractStyleRenderer | |
|
isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean
This method is overriden for performance reasons.
| PathBasedEdgeStyleRenderer | ||
|
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 | ||
![]() |
Calls
configure and tests the item using the style
for a visible intersection with the clip bounds. | AbstractStyleRenderer | |
![]() |
lookup(type:Class):Object
Implements the
ILookup interface. | AbstractStyleRenderer | |
|
Paints the
path
| PathBasedEdgeStyleRenderer | ||
| Method | Defined by | ||
|---|---|---|---|
|
configure():void
Prepares this instance for subsequent calls after the
style and item have been initialized.
| PathBasedEdgeStyleRenderer | ||
|
This method should create the basic uncropped path given the control points.
| PathBasedEdgeStyleRenderer | ||
![]() |
Factory method for the StyleDescriptor property.
| AbstractEdgeStyleRenderer | |
|
cropPath(pathToCrop:GeneralPath):void
Crops the edge's path at the nodes.
| PathBasedEdgeStyleRenderer | ||
|
getSmoothing():Number
Gets the smoothing factor
| PathBasedEdgeStyleRenderer | ||
|
Calculate and update the anchor and the source arrow's direction vector.
| PathBasedEdgeStyleRenderer | ||
|
getStroke():IStroke
Gets the pen to use for painting the path.
| PathBasedEdgeStyleRenderer | ||
|
Calculate and update the anchor and the target arrow's direction vector.
| PathBasedEdgeStyleRenderer | ||
![]() |
paintArrows(g:YGraphics, ctx:IPaintContext):void
Paints the provided arrows using the graphics context.
| AbstractEdgeStyleRenderer | |
![]() |
setItem(item:IModelItem):void
Called by the various descriptor getters to initialize the item.
| AbstractStyleRenderer | |
![]() |
setStyle(style:IVisualStyle):void
Called by the various descriptor getters to initialize the style.
| AbstractStyleRenderer | |
| path | property |
protected var path:GeneralPathThe path instance that this instance is working with.
| calculateBounds | () | method |
public override 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
|
| configure | () | method |
protected override function configure():voidPrepares this instance for subsequent calls after the style and item have been initialized.
Upon invocation the style and item fields have
been populated by the getPaintable or getBoundsProvider
methods.
| createPath | () | method |
protected function createPath():GeneralPathThis method should create the basic uncropped path given the control points.
ReturnsGeneralPath —
A path that has to be cropped, yet.
|
| cropPath | () | method |
protected function cropPath(pathToCrop:GeneralPath):voidCrops the edge's path at the nodes.
This implementation uses the IEdgeIntersectionCalculator instances
found in the lookup of the source and target port
of the edge to perform the actual cropping.
pathToCrop:GeneralPath — The path that should be cropped.
|
See also
| getHitTestable | () | method |
public override function getHitTestable(item:IModelItem, style:IVisualStyle):IHitTestableThis method is overridden for performance reasons.
This implementation does not call configure.
If subclasses depend on a configured instance in an override of isHit, they need
to override this method, too and call configure if the base call returns a non-null
value.
item:IModelItem |
|
style:IVisualStyle |
IHitTestable |
See also
| getPath | () | method |
public override function getPath():GeneralPath
Returns a representation of the visible path of the edge in form of a GeneralPath
GeneralPath —
An instance that describes the visible path or null if this is not applicable for the current geometry.
|
| getSmoothing | () | method |
protected function getSmoothing():NumberGets the smoothing factor
ReturnsNumber — The smoothing factor
|
| getSourceArrowAnchor | () | method |
protected override function getSourceArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):BooleanCalculate and update the anchor and the source arrow's direction vector.
Abstract method, has to be overriden by implementations.
Parametersarrow:IArrow — The arrow to calculate the anchor for.
|
|
anchorPoint:IPointSetter — The tip of the arrow.
|
|
arrowDirection:IPointSetter — The direction vector of the arrow.
|
Boolean — Whether an anchor has been successfully determined.
|
| getStroke | () | method |
protected function getStroke():IStrokeGets the pen to use for painting the path.
ReturnsIStroke — the stroke or null.
|
| getTargetArrowAnchor | () | method |
protected override function getTargetArrowAnchor(arrow:IArrow, anchorPoint:IPointSetter, arrowDirection:IPointSetter):BooleanCalculate and update the anchor and the target arrow's direction vector.
Abstract method, has to be overriden by implementations.
Parametersarrow:IArrow — The arrow to calculate the anchor for.
|
|
anchorPoint:IPointSetter — The tip of the arrow.
|
|
arrowDirection:IPointSetter — The direction vector of the arrow.
|
Boolean — Whether an anchor has been successfully determined.
|
| isHit | () | method |
public override function isHit(x:Number, y:Number, ctx:ICanvasContext):BooleanThis method is overriden for performance reasons.
This implementation uses the isVisible property as an early exit indicator.
If isVisible returns false for a certain rectangle,
the instance will not be configured but a non-hit will be assumed.
Otherwise, this instance will be configured and the standard path based hit test
routine is used.
Subclasses should not depend on the fact that configure
has already been called. This may not be the case. If your subclass depends
on configure being called, override getHitTestable
and call configure after the base class call.
x:Number |
|
y:Number |
|
ctx:ICanvasContext |
Boolean |
See also
| isInBox | () | method |
public override function 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.
box:IRectangle — The box describing the marquee's bounds
|
|
ctx:ICanvasContext — The current canvas context
|
Boolean — true if the item is considered to be captured by the marquee
|
| paint | () | method |
public override function paint(g:YGraphics, ctx:IPaintContext):void
Paints the path
g:YGraphics |
|
ctx:IPaintContext |
See also