public class ArcEdgeStyleRenderer extends PathBasedEdgeStyleRenderer<ArcEdgeStyle>
ArcEdgeStyle
.path
EMPTY, UNBOUNDED
ALWAYS, NEVER
ALWAYS, NEVER
ALWAYS, NEVER
Constructor and Description |
---|
ArcEdgeStyleRenderer() |
Modifier and Type | Method and Description |
---|---|
protected void |
configure()
Prepares this instance for subsequent calls after the style and edge have been initialized.
|
protected GeneralPath |
createPath()
This method should create the basic uncropped path given the control points.
|
protected GeneralPath |
cropPath(GeneralPath path)
Crops the edge's path at the nodes.
|
double |
getHeight()
Retrieves the
Height of the style. |
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 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 . |
protected boolean |
isAddingBridgesEnabled()
Overridden to return
false since the flattening interferes with its own obstacles. |
boolean |
isFixedHeightEnabled()
Gets a value indicating whether this
getHeight() should be interpreted as an absolute or relative value. |
boolean |
isVisible(ICanvasContext context,
RectD rectangle)
Overridden for performance reasons.
|
<TLookup> TLookup |
lookup(Class<TLookup> type)
Returns an instance that implements the given type or
null . |
createRectangleSelfLoop, createRoundSelfLoop, createSelfLoopPath, createVisual, getBounds, getBoundsProvider, getBridgeCreator, getContext, getEdge, getHitTestable, getMarqueeTestable, getObstacles, getPath, getPathGeometry, getSelfLoopDistance, getSmoothingLength, getSourceArrowAnchor, getStyle, getTargetArrowAnchor, getVisibilityTestable, getVisualCreator, isHit, isInBox, 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 void configure()
PathBasedEdgeStyleRenderer
Upon invocation the Style
and Edge
properties have been populated by the
PathBasedEdgeStyleRenderer.getVisualCreator(IEdge, IEdgeStyle)
, PathBasedEdgeStyleRenderer.getBoundsProvider(IEdge, IEdgeStyle)
,
PathBasedEdgeStyleRenderer.getHitTestable(IEdge, IEdgeStyle)
, or PathBasedEdgeStyleRenderer.getMarqueeTestable(IEdge, IEdgeStyle)
methods.
Subclasses which override this method have to call the base implementation, first.
configure
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
protected GeneralPath createPath()
PathBasedEdgeStyleRenderer
createPath
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
protected GeneralPath cropPath(GeneralPath path)
PathBasedEdgeStyleRenderer
This implementation uses the IEdgePathCropper
instances found in the ILookup.lookup(Class)
of the source
and target port of the edge to perform the actual cropping.
cropPath
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
path
- The path that should be cropped.public double getHeight()
Height
of the style.protected Pen getPen()
PathBasedEdgeStyleRenderer
getPen
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
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<ArcEdgeStyle>
-1
if there is no such thing as a segment for this edge.PathBasedEdgeStyleRenderer.getPathGeometry(IEdge, IEdgeStyle)
protected IArrow getSourceArrow()
SourceArrow
.getSourceArrow
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
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<ArcEdgeStyle>
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<ArcEdgeStyle>
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<ArcEdgeStyle>
protected boolean isAddingBridgesEnabled()
false
since the flattening interferes with its own obstacles.isAddingBridgesEnabled
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
PathBasedEdgeStyleRenderer.getBridgeCreator()
public boolean isFixedHeightEnabled()
getHeight()
should be interpreted as an absolute or relative value.true
if the height value should be interpreted as a fixed value, otherwise, false
.getHeight()
public boolean isVisible(ICanvasContext context, RectD rectangle)
isVisible
in interface IVisibilityTestable
isVisible
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
context
- the current canvas contextrectangle
- the clip boundstrue
if the edge may be painted within the clip bounds.PathBasedEdgeStyleRenderer.getVisibilityTestable(IEdge, IEdgeStyle)
public <TLookup> TLookup lookup(Class<TLookup> type)
ILookup
null
.
Typically, this method will be called in order to obtain a different view or
aspect of the current instance. This is quite similar to casting or using
a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. An instance implementing this method is not
required to return non-null
implementations for the types, nor does it
have to return the same instance any time. Also it depends on the
type and context whether the instance returned stays up to date or needs to
be reobtained for subsequent use.lookup
in interface ILookup
lookup
in class PathBasedEdgeStyleRenderer<ArcEdgeStyle>
type
- the type for which an instance shall be returnednull