Interface Selection
public interface Selection
Describes a selection in a model.
- Author:
- Per-Erik
-
Method Summary
Modifier and TypeMethodDescriptionReturns the selected control point on a single edge selection.getEdges()
Returns the list ofMTCompleteEdge
s contained in the selection.Point[]
Returns the selected segment of a single edge selection.Returns the lead selection.getModel()
Returns theMTCompleteModel
in which the selection "resides".Returns the list ofMTCompleteVertex
es contained in the selection.boolean
Returns true if this selection is an edge control point selection, false otherwise.boolean
boolean
isEmpty()
Checks if the current selection is empty.boolean
Returnstrue
if this is a label selection.boolean
Checks if the current selection is a multiple selection.boolean
Checks if the current selection is a single edge selection.boolean
Checks if the current selection is a single vertex selection.boolean
Returns true if the selection is still changing (for example because the user is still dragging over more objects/has not yet released the mouse button), false otherwise.void
Notify the selection that the point that is selected has moved.void
refreshEdgeSegment
(Point[] segment) Notify the selection that the segment that is selected has moved.
-
Method Details
-
getModel
MTCompleteModel getModel()Returns theMTCompleteModel
in which the selection "resides". The model itself is thus not part of the selection.- Returns:
- the
MTCompleteModel
in which the selection "resides".
-
getLeadSelection
MTCompleteVertex getLeadSelection()Returns the lead selection.- Returns:
- The first selected vertex or
null
if no vertices are selected.
-
getVertices
Collection<MTCompleteVertex> getVertices()Returns the list ofMTCompleteVertex
es contained in the selection. (MTCompleteVertices is correct language but not correct type!)- Returns:
- the list of
MTCompleteVertex
es contained in the selection.
-
getEdges
Collection<MTCompleteEdge> getEdges()Returns the list ofMTCompleteEdge
s contained in the selection.- Returns:
- the list of
MTCompleteEdge
s contained in the selection.
-
getEdgeControlPoint
Point getEdgeControlPoint()Returns the selected control point on a single edge selection.- Returns:
-
refreshEdgeControlPoint
Notify the selection that the point that is selected has moved. The selection is imutable and point to a specific point in time, but when a point is moved the selection changes and this must be tracked. When this method is called the selection is not changed but the change is forwarded to the selection model that keeps track of it.- Parameters:
p
- the new point as returned by the edge router
-
getEdgeSegment
Point[] getEdgeSegment()Returns the selected segment of a single edge selection.- Returns:
-
refreshEdgeSegment
Notify the selection that the segment that is selected has moved. The selection is imutable and point to a specific point in time, but when a selection is moved the segment in the selection changes and this must be tracked. When this method is called the selection is not changed but the change is forwarded to the selection model that keeps track of it.- Parameters:
segment
- the new segment as returned by the edge router
-
isLabelSelection
boolean isLabelSelection()Returnstrue
if this is a label selection.- Returns:
true
for label selections.
-
isEmpty
boolean isEmpty()Checks if the current selection is empty.- Returns:
true
if no vertices or edges are selected
-
isSingleVertexSelection
boolean isSingleVertexSelection()Checks if the current selection is a single vertex selection.- Returns:
true
if a single vertex is selected.
-
isSingleEdgeSelection
boolean isSingleEdgeSelection()Checks if the current selection is a single edge selection.- Returns:
true
if a single edge is selected.
-
isEdgeControlPointSelection
boolean isEdgeControlPointSelection()Returns true if this selection is an edge control point selection, false otherwise.- Returns:
- true if this selection is an edge control point selection, false otherwise.
-
isEdgeSegmentSelection
boolean isEdgeSegmentSelection() -
isMultipleSelection
boolean isMultipleSelection()Checks if the current selection is a multiple selection.- Returns:
true
if multiple vertices and/or edges are selected.
-
isValueAdjusting
boolean isValueAdjusting()Returns true if the selection is still changing (for example because the user is still dragging over more objects/has not yet released the mouse button), false otherwise.- Returns:
-