The default implementation of the IEdgePathCropper interface.
Implements
- I
Remarks
It has a property that determines whether the edge path is cropped at the port or at the node bounds and supports an optional extra length the edge is cropped.
See Also
API
- INSTANCE
Demos
- Customize where edges at the node are cropped
Members
Show:
Constructors
Properties
Methods
Calculates the total length the edge path is cropped.
Calculates the total length the edge path is cropped.
This method can be overridden to change the length that is cropped from an edge. The default implementation returns the sum of extraCropLength, arrow length, and arrow cropLength.
protected
Parameters
- arrow: IArrow
- The arrow at this edge end.
- atSource: boolean
trueif the crop length should be calculated at the edge source,falseotherwise.
Return Value
- number
- The total length the edge path is cropped.
See Also
Crops the provided path at one end of an edge.
Crops the provided
path at one end of an edge.If cropAtPort is
true this implementation delegates to cropEdgePathAtPortGeometry. Otherwise, the edge path is cropped at the node geometry. If this results in an empty path, the cropping is delegated to handleEmptyPath instead.Parameters
- edge: IEdge
- The edge whose path is to be cropped.
- atSource: boolean
- Whether to crop the source or target side of the path.
- arrow: IArrow
- The arrow that is used at the end of the edge.
- path: GeneralPath
- The path to crop.
Return Value
- GeneralPath
- The cropped path. This can be either the same instance of the given path or a newly created instance.
Implements
IEdgePathCropper.cropEdgePathCrops an edge's path at the source or target side with respect to the given arrow.
Crops an edge's path at the source or target side with respect to the given arrow.
Parameters
- atSource: boolean
- if set to
truethe source side is cropped. - arrow: IArrow
- The arrow to consider for the cropping.
- path: GeneralPath
- The edge's path to crop.
Return Value
- GeneralPath
- The cropped path. This can be either the same instance of the given path or a newly created instance.
Crops an edge's path at the source or target side at the port geometry with respect to the given arrow.
Crops an edge's path at the source or target side at the port geometry with respect to the given arrow.
protected
Parameters
- edge: IEdge
- The edge whose path is to be cropped.
- atSource: boolean
- Whether to crop the source or target side of the path.
- arrow: IArrow
- The arrow that is used at the end of the edge.
- path: GeneralPath
- The path to crop.
Return Value
- GeneralPath
- The cropped path. This can be either the same instance of the given path or a newly created instance.
protected
Parameters
- node: INode
- The node whose geometry is tested for intersection.
- nodeShapeGeometry: IShapeGeometry
- The geometric representation of the node, or
nullif unavailable. - edge: IEdge
- The edge to test for intersection.
- inner: Point
- A point inside the node used for intersection testing.
- outer: Point
- A point outside the node used for intersection testing.
Return Value
- Point
- The intersection point, or
nullif no intersection is found.
Returns the geometry that is used to crop the edge at the node outline.
Returns the geometry that is used to crop the edge at the node outline.
The default implementation queries the node style renderer for an implementation of IShapeGeometry. This method can be overridden to return an arbitrary geometry for a node.
protected
Parameters
- node: INode
- The node the edge should be cropped at.
Return Value
- IShapeGeometry
- The geometry of the node.
Returns the geometry that is used to crop the edge at the port outline if cropAtPort is set to true.
Returns the geometry that is used to crop the edge at the port outline if cropAtPort is set to
true.The default implementation returns
null. This method can be overridden to return an arbitrary geometry for a port.protected
Parameters
- port: IPort
- The port the edge should be cropped at.
Return Value
- IShapeGeometry
- The geometry of the port.
See Also
API
- cropAtPort
Handles the edge path cropping if cropEdgePath would result in a cleared path.
Handles the edge path cropping if cropEdgePath would result in a cleared path.
This method is called by cropEdgePath if cropAtPort is false and cropping the edge path at the node geometry would result in an empty path.
The default implementation is to clear the edge path.
protected
Parameters
- edge: IEdge
- The edge whose path is to be cropped.
- atSource: boolean
- Whether to crop the source or target side of the path.
- arrow: IArrow
- The arrow that is used at the end of the edge.
- path: GeneralPath
- The path to crop.
Return Value
- GeneralPath
- The cropped path. This can be either the same instance of the given path or a newly created instance.
Checks whether a given point is inside a node's shape geometry with respect to the edge that is being calculated.
Checks whether a given point is inside a node's shape geometry with respect to the edge that is being calculated.
protected
Parameters
- location: Point
- The location to test.
- node: INode
- The node to test the point against for inclusion.
- nodeShapeGeometry: IShapeGeometry
- The node's geometry.
- edge: IEdge
- The edge that is being calculated.
Return Value
- boolean
- Whether a given point is inside a node's shape.