| Package | com.yworks.graph.drawing |
| Class | public class PathBasedEdgeStyleRenderer |
| Inheritance | PathBasedEdgeStyleRenderer AbstractEdgeStyleRenderer AbstractStyleRenderer Object |
| Implements | IObstacleProvider |
| Subclasses | PolylineEdgeStyleRenderer |
IEdgeStyleRenderer implementations that are based on
the calculation of a GeneralPath.
See also
| Property | Defined By | ||
|---|---|---|---|
| addBridges : Boolean [read-only]
Determines whether the rendered path should use the BridgeManager
to add bridges to it. | PathBasedEdgeStyleRenderer | ||
| path : GeneralPath
The path instance that this instance is working with. | PathBasedEdgeStyleRenderer | ||
| Method | Defined By | ||
|---|---|---|---|
[override]
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 | |
[override]
This method is overridden for performance reasons. | PathBasedEdgeStyleRenderer | ||
![]() |
Configures the style and item parameters,
calls configure and returns this. | AbstractStyleRenderer | |
Yield the obstacles that the item that provided this instance
would add to the scene for the given IPaintContext. | PathBasedEdgeStyleRenderer | ||
![]() | [override]
Gets an implementation of the IPaintable interface that can
handle the provided item and its associated style. | AbstractEdgeStyleRenderer | |
[override]
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 [override]
This method is overriden for performance reasons. | PathBasedEdgeStyleRenderer | ||
[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 | ||
![]() |
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 | |
[override]
Paints the path
| PathBasedEdgeStyleRenderer | ||
| Method | Defined By | ||
|---|---|---|---|
configure():void [override]
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 | ||
![]() | [override]
Factory method for the StyleDescriptor property. | AbstractEdgeStyleRenderer | |
cropPath(pathToCrop:GeneralPath):void
Crops the edge's path at the nodes. | PathBasedEdgeStyleRenderer | ||
Yields the IAddBridgesCallback to use for adding bridges to the
created path. | PathBasedEdgeStyleRenderer | ||
getSmoothing():Number
Gets the smoothing factor
| PathBasedEdgeStyleRenderer | ||
[override]
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 | ||
[override]
Calculate and update the anchor and the target arrow's direction vector. | PathBasedEdgeStyleRenderer | ||
![]() |
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 | |
| addBridges | property |
addBridges:Boolean [read-only]
Determines whether the rendered path should use the BridgeManager
to add bridges to it.
protected function get addBridges():Boolean| path | property |
protected var path:GeneralPathThe path instance that this instance is working with.
| calculateBounds | () | method |
override public 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.
Parameters
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 |
override protected 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.
Parameters
pathToCrop:GeneralPath — The path that should be cropped.
|
See also
| getAddBridgesCallback | () | method |
protected function getAddBridgesCallback():IAddBridgesCallback
Yields the IAddBridgesCallback to use for adding bridges to the
created path.
The return value of this method (which may be null) will be passed to
the BridgeManager's addBridges() method.
IAddBridgesCallback — This implementation returns null
|
| getHitTestable | () | method |
override public 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.
Parameters
item:IModelItem | |
style:IVisualStyle |
IHitTestable |
See also
| getObstacles | () | method |
public function getObstacles(ctx:IPaintContext):GeneralPath
Yield the obstacles that the item that provided this instance
would add to the scene for the given IPaintContext.
The implementation should only yield a non-null
GeneralPath if it may be visible in the provided
IPaintContext.
Parameters
ctx:IPaintContext — The context for which the obstacles are queried.
|
GeneralPath — A path that describes the obstacles or null if there
are no obstacles for the given context.
|
| getPath | () | method |
override public 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 |
override protected 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.
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.
|
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 |
override protected 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.
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.
|
Boolean — Whether an anchor has been successfully determined.
|
| isHit | () | method |
override public 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.
Parameters
x:Number | |
y:Number | |
ctx:ICanvasContext |
Boolean |
See also
| isInBox | () | method |
override public 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.
Parameters
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 |
override public function paint(g:YGraphics, ctx:IPaintContext):void
Paints the path
Parameters
g:YGraphics | |
ctx:IPaintContext |
See also