public class PolylineEdgeStyleRenderer extends PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
IEdgeStyleRenderer
that will render PolylineEdgeStyle
instances.path
EMPTY, UNBOUNDED
ALWAYS, NEVER
ALWAYS, NEVER
ALWAYS, NEVER
Constructor and Description |
---|
PolylineEdgeStyleRenderer() |
Modifier and Type | Method and Description |
---|---|
protected GeneralPath |
createPath()
This method should create the basic uncropped path given the control points.
|
protected Pen |
getPen()
Gets the pen to use to render the path.
|
int |
getSegmentCount()
Returns the number of "segments" this edge's path consists of.
|
protected double |
getSmoothingLength()
Gets the value that determines the radius of the smoothing arcs that can be added to the path at the bends.
|
protected IArrow |
getSourceArrow()
Gets the source arrow from the style via
SourceArrow . |
Tangent |
getTangent(double ratio)
Calculates the tangent on the edge's path at the given ratio point.
|
Tangent |
getTangent(int segmentIndex,
double ratio)
Calculates the tangent on the edge's path at the given ratio point for the given segment.
|
protected IArrow |
getTargetArrow()
Gets the target arrow from the style via
TargetArrow . |
boolean |
isVisible(ICanvasContext context,
RectD rectangle)
Calls
PathBasedEdgeStyleRenderer.configure() and test the Edge using the Style for a visible
intersection with the clip bounds. |
configure, createRectangleSelfLoop, createRoundSelfLoop, createSelfLoopPath, createVisual, cropPath, getBounds, getBoundsProvider, getBridgeCreator, getContext, getEdge, getHitTestable, getMarqueeTestable, getObstacles, getPath, getPathGeometry, getSelfLoopDistance, getSourceArrowAnchor, getStyle, getTargetArrowAnchor, getVisibilityTestable, getVisualCreator, isAddingBridgesEnabled, isHit, isInBox, lookup, setEdge, setSelfLoopDistance, setStyle, updateVisual
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromRectangle
create
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookup
protected GeneralPath createPath()
PathBasedEdgeStyleRenderer
createPath
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
protected Pen getPen()
PathBasedEdgeStyleRenderer
getPen
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
null
.public int getSegmentCount()
PathBasedEdgeStyleRenderer
This method is part of the IPathGeometry
interface, that is implemented by this class. This interface will be
returned by PathBasedEdgeStyleRenderer.getPathGeometry(IEdge, IEdgeStyle)
.
getSegmentCount
in interface IPathGeometry
getSegmentCount
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
-1
if there is no such thing as a segment for this edge.PathBasedEdgeStyleRenderer.getPathGeometry(IEdge, IEdgeStyle)
protected double getSmoothingLength()
This implementation returns SmoothingLength
.
getSmoothingLength
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
protected IArrow getSourceArrow()
SourceArrow
.getSourceArrow
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
public Tangent getTangent(double ratio)
PathBasedEdgeStyleRenderer
This method is part of the IPathGeometry
interface, that is implemented by this class. This interface will be
returned by PathBasedEdgeStyleRenderer.getPathGeometry(IEdge, IEdgeStyle)
.
getTangent
in interface IPathGeometry
getTangent
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
ratio
- a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge pathPathBasedEdgeStyleRenderer.getPathGeometry(IEdge, IEdgeStyle)
public Tangent getTangent(int segmentIndex, double ratio)
PathBasedEdgeStyleRenderer
This method is part of the IPathGeometry
interface, that is implemented by this class. This interface will be
returned by PathBasedEdgeStyleRenderer.getPathGeometry(IEdge, IEdgeStyle)
.
getTangent
in interface IPathGeometry
getTangent
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
segmentIndex
- the segment to use for the calculationratio
- a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segmentPathBasedEdgeStyleRenderer.getTangent(double)
,
PathBasedEdgeStyleRenderer.getSegmentCount()
,
PathBasedEdgeStyleRenderer.getPathGeometry(IEdge, IEdgeStyle)
protected IArrow getTargetArrow()
TargetArrow
.getTargetArrow
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
public boolean isVisible(ICanvasContext context, RectD rectangle)
PathBasedEdgeStyleRenderer
PathBasedEdgeStyleRenderer.configure()
and test the Edge
using the Style
for a visible
intersection with the clip bounds.
This simple implementation uses PathBasedEdgeStyleRenderer.getBounds(ICanvasContext)
to determine the visibility. Subclasses may choose to
override this behavior for improved performance but need to make sure to call PathBasedEdgeStyleRenderer.configure()
if they depend
on a configured instance.
isVisible
in interface IVisibilityTestable
isVisible
in class PathBasedEdgeStyleRenderer<PolylineEdgeStyle>
context
- the current canvas contextrectangle
- the clip boundstrue
if the edge may be painted within the clip bounds.PathBasedEdgeStyleRenderer.getVisibilityTestable(IEdge, IEdgeStyle)