public class SelectionHandler
extends java.lang.Object
Constructor and Description |
---|
SelectionHandler(ProcessEditor editor)
Creates a new selection handler for a certain ProcessModel.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectedObject(ProcessObject n)
Adds a node to the selection.
|
void |
clearSelection()
Clears the selection.
|
boolean |
contains(ProcessObject o)
Returns if a certain ProcessObject is contained.
|
ProcessNode |
getLastSelectedNode()
convenience method that returns the lastSelection
as a ProcessNode (if it is one) or null otherwise
|
ProcessObject |
getLastSelection()
Returns the last selected node (the last one that has been added to
the selection).
|
java.util.List<ProcessObject> |
getSelection()
Returns the current selection.
|
int |
getSelectionSize()
Returns the size of the selection.
|
boolean |
isEmpty()
Checks whether the selection is empty.
|
void |
moveSelection(int offsetX,
int offsetY)
Moves the ProcessNodes of the selection according to the given offsets.
|
boolean |
removeSelectedObject(ProcessObject n)
Removes a node from the selection.
|
void |
toggleSelectedObject(ProcessObject n)
Adds the ProcessObject if it is currently not contained in the
selection and removes it otherwise.
|
public SelectionHandler(ProcessEditor editor)
m
- public void addSelectedObject(ProcessObject n)
n
- The ProcessObject n is only added if it is not already contained.public void toggleSelectedObject(ProcessObject n)
n
- public boolean removeSelectedObject(ProcessObject n)
n
- public void clearSelection()
public ProcessObject getLastSelection()
public ProcessNode getLastSelectedNode()
public java.util.List<ProcessObject> getSelection()
public boolean contains(ProcessObject o)
o
- public boolean isEmpty()
public int getSelectionSize()
public void moveSelection(int offsetX, int offsetY)