public interface IBridgeCreator
GeneralPath
.
An implementation of this interface is used by BridgeManager
to insert bridges into an edge path.
A custom implementation of this interface is necessary if a custom bridge drawing style
is used.
BridgeManager
Modifier and Type | Method and Description |
---|---|
void |
createCustomBridge(IRenderContext context,
GeneralPath path,
PointD start,
PointD end,
double gapLength)
Callback that will be used by the
BridgeManager if the getCrossingStyle(IRenderContext)
method yields BridgeCrossingStyle.CUSTOM to actually insert a bridge into the given GeneralPath . |
double |
getBridgeHeight(IRenderContext context)
Gets the height of the bridge for the given
IRenderContext . |
double |
getBridgeWidth(IRenderContext context)
Gets the width of the bridge for the given
IRenderContext . |
BridgeCrossingStyle |
getCrossingStyle(IRenderContext context)
Gets the
BridgeCrossingStyle to use in the given IRenderContext . |
BridgeOrientationStyle |
getOrientationStyle(IRenderContext context)
Gets the
BridgeOrientationStyle to use in the given IRenderContext . |
void createCustomBridge(IRenderContext context, GeneralPath path, PointD start, PointD end, double gapLength)
BridgeManager
if the getCrossingStyle(IRenderContext)
method yields BridgeCrossingStyle.CUSTOM
to actually insert a bridge into the given GeneralPath
.
When this method is called the GeneralPath
's last
coordinates are not
yet at start
. So most implementation should first GeneralPath.moveTo(PointD)
that location. Also at the
end of the call, implementation should make sure that the GeneralPath's end is at end
. The gapLength
is
provided for convenience so that the distance between startPoint
and endPoint
does not need to be
calculated if it is needed for the drawing.
context
- The context for the call.path
- The path to append the bridge segment to.start
- The coordinates of the starting point of the bridge.end
- The coordinates of the ending point of the bridge.gapLength
- The distance between the starting point and the end point.double getBridgeHeight(IRenderContext context)
IRenderContext
.
The height is the default height that will be used for drawing the non-custom
BridgeCrossingStyle
s.
context
- The context where the bridge will be created for.double getBridgeWidth(IRenderContext context)
IRenderContext
.
The width is the preferred length of the segment that will be removed from the original segment if it crosses an obstacle. That bridge will be made larger if multiple obstacle bridges would otherwise overlap. The bridge will be automatically made smaller if it happens to be near the end of a segment and would otherwise extend beyond the end of the segment.
context
- The context where the bridge will be created for.BridgeCrossingStyle getCrossingStyle(IRenderContext context)
BridgeCrossingStyle
to use in the given IRenderContext
.context
- The context in which the crossing will be used.BridgeCrossingStyle.CUSTOM
in order to let BridgeManager
call createCustomBridge(IRenderContext, GeneralPath, PointD, PointD, double)
.BridgeOrientationStyle getOrientationStyle(IRenderContext context)
BridgeOrientationStyle
to use in the given IRenderContext
.context
- The context in which the style will be used..crossing style
is set to BridgeCrossingStyle.CUSTOM
.