public class CollectGraphSnapLinesEventArgs extends InputModeEventArgs
CollectSnapLines
event.
Instances of this class are also passed to
ISnapLineProvider.addSnapLines(GraphSnapContext, CollectGraphSnapLinesEventArgs, com.yworks.yfiles.graph.IModelItem).
Implementations of that interface can use the following methods to add snap lines for specific purposes:
addFixedNodeSnapLine(OrthogonalSnapLine) – Adds an orthogonal snap line for nodes.addFixedSegmentSnapLine(OrthogonalSnapLine) – Adds an orthogonal snap line for edge segments and bends.addPortSnapLine(OrthogonalSnapLine) – Adds an orthogonal snap line for ports.addAdditionalSnapLine(OrthogonalSnapLine) – Adds an additional orthogonal snap line to which all element will snap.EMPTY| Constructor and Description |
|---|
CollectGraphSnapLinesEventArgs(IInputModeContext context,
Collection<OrthogonalSnapLine> fixedNodeSnapLines,
Collection<OrthogonalSnapLine> fixedSegmentSnapLines,
Collection<OrthogonalSnapLine> fixedPortSnapLines,
Collection<OrthogonalSnapLine> additionalSnapLines)
Initializes a new instance of the
CollectGraphSnapLinesEventArgs class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAdditionalSnapLine(OrthogonalSnapLine snapLine)
Adds a snap line all elements will snap to.
|
void |
addFixedNodeSnapLine(OrthogonalSnapLine snapLine)
Adds a snap line for nodes.
|
void |
addFixedSegmentSnapLine(OrthogonalSnapLine snapLine)
Adds a snap line for edge segments and bends.
|
void |
addPortSnapLine(OrthogonalSnapLine snapLine)
Adds a snap line for ports.
|
getContextpublic CollectGraphSnapLinesEventArgs(IInputModeContext context, Collection<OrthogonalSnapLine> fixedNodeSnapLines, Collection<OrthogonalSnapLine> fixedSegmentSnapLines, Collection<OrthogonalSnapLine> fixedPortSnapLines, Collection<OrthogonalSnapLine> additionalSnapLines)
CollectGraphSnapLinesEventArgs class.context - The context where the event is being used in.fixedNodeSnapLines - The fixed node snap lines collection to add to.fixedSegmentSnapLines - The fixed segment snap lines collection to add to.fixedPortSnapLines - The fixed port snap lines collection to add to.additionalSnapLines - The additional snap lines collection to add to.public final void addAdditionalSnapLine(OrthogonalSnapLine snapLine)
snapLine - The snap line to add to the list of lines that all elements snap to by default.GraphSnapContext.getAdditionalSnapLines()public final void addFixedNodeSnapLine(OrthogonalSnapLine snapLine)
snapLine - The snap line to add to the list of lines that nodes snap to by default.GraphSnapContext.getFixedNodeSnapLines()public final void addFixedSegmentSnapLine(OrthogonalSnapLine snapLine)
snapLine - The snap line to add to the list of lines that segments snap to by default.GraphSnapContext.getFixedSegmentSnapLines()public final void addPortSnapLine(OrthogonalSnapLine snapLine)
snapLine - The snap line to add to the list of lines that ports snap to by default.GraphSnapContext.getFixedPortSnapLines()