public class EdgeSnapLineProvider extends Object implements ISnapLineProvider
ISnapLineProvider
interface that can be used to add snap lines for orthogonally
routed IEdge
s.
This implementation can be put into the ILookup.lookup(java.lang.Class)
of an
IEdge
.
Constructor and Description |
---|
EdgeSnapLineProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
addHorizontalSegmentSnapLines(GraphSnapContext context,
CollectGraphSnapLinesEventArgs args,
IEdge edge,
PointD segmentStart,
PointD segmentEnd)
Adds horizontal snap lines for a horizontally oriented fixed segment snap lines.
|
void |
addSnapLines(GraphSnapContext context,
CollectGraphSnapLinesEventArgs args,
IModelItem item)
Adds the snap lines for the given model item to the
args . |
protected void |
addVerticalSegmentSnapLines(GraphSnapContext context,
CollectGraphSnapLinesEventArgs args,
IEdge edge,
PointD segmentStart,
PointD segmentEnd)
Adds vertical snap lines for a vertically oriented fixed segment snap lines.
|
protected void addHorizontalSegmentSnapLines(GraphSnapContext context, CollectGraphSnapLinesEventArgs args, IEdge edge, PointD segmentStart, PointD segmentEnd)
context
- The context which holds the settings for the snap lines. Note that implementations should not change the state of the
context explicitly.edge
- The edge to add snap lines for.segmentStart
- The start of the segment.args
- The argument to use for adding snap lines.segmentEnd
- The end of the segment.addVerticalSegmentSnapLines(GraphSnapContext, CollectGraphSnapLinesEventArgs, IEdge, PointD, PointD)
public void addSnapLines(GraphSnapContext context, CollectGraphSnapLinesEventArgs args, IModelItem item)
args
.
This implementation queries the movement information
for the provided
edge to determine which edge segments stay fixed. For each fixed segment, it will call addVerticalSegmentSnapLines(GraphSnapContext, CollectGraphSnapLinesEventArgs, IEdge, PointD, PointD)
or addHorizontalSegmentSnapLines(GraphSnapContext, CollectGraphSnapLinesEventArgs, IEdge, PointD, PointD)
respectively.
addSnapLines
in interface ISnapLineProvider
context
- The context which holds the settings for the snap lines. Note that implementations should not change the state of the
context explicitly.item
- The item to add snap lines for.args
- The argument to use for adding snap lines.protected void addVerticalSegmentSnapLines(GraphSnapContext context, CollectGraphSnapLinesEventArgs args, IEdge edge, PointD segmentStart, PointD segmentEnd)
context
- The context which holds the settings for the snap lines. Note that implementations should not change the state of the
context explicitly.edge
- The edge to add snap lines for.segmentStart
- The start of the segment.segmentEnd
- The end of the segment.args
- The argument to use for adding snap lines.addHorizontalSegmentSnapLines(GraphSnapContext, CollectGraphSnapLinesEventArgs, IEdge, PointD, PointD)