Package dk.gtz.graphedit.tool
Class SelectTool
java.lang.Object
dk.gtz.graphedit.tool.AbstractBaseTool
dk.gtz.graphedit.tool.SelectTool
- All Implemented Interfaces:
ITool
Tool to select syntactic elements.
When selected, click either a vertex or an edge to mark it as selected.
You can select more than one element at a time by holding down CTRL whilst clicking on a syntactic element.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the selectionjavafx.scene.Node
Get the graphical representation for the tool selection button.Get a multiline string that describe the tool and how to use itjavafx.collections.ObservableList<ViewModelSelection>
Get the current selectionGet a multiline tooltip string that briefly describes this toolvoid
Event handler for the case where an edge has been interacted with with the mousevoid
Event handler for the case where the model editor viewport has been interacted with with the keyboardvoid
Event handler for the case where a vertex has been interacted with with the mousevoid
Event handler for the case where the model editor viewport has been interacted with with the mousevoid
toggleSelected
(UUID id, ISelectable selectable) Toggle the selection of a syntactic element
-
Constructor Details
-
SelectTool
public SelectTool()Construct a new instance
-
-
Method Details
-
getHelpDescription
Description copied from interface:ITool
Get a multiline string that describe the tool and how to use it- Returns:
- a (possibly) multiline string
-
getTooltip
Description copied from interface:ITool
Get a multiline tooltip string that briefly describes this tool- Specified by:
getTooltip
in interfaceITool
- Overrides:
getTooltip
in classAbstractBaseTool
- Returns:
- a (possibly) multiline string
-
getGraphic
public javafx.scene.Node getGraphic()Description copied from interface:ITool
Get the graphical representation for the tool selection button. Typically just aFontIcon
, but can be anything- Returns:
- a javafx node that will be displayed inside the tool selector button
-
onKeyEvent
Description copied from interface:ITool
Event handler for the case where the model editor viewport has been interacted with with the keyboard- Specified by:
onKeyEvent
in interfaceITool
- Overrides:
onKeyEvent
in classAbstractBaseTool
- Parameters:
e
- The event that happened
-
onViewportMouseEvent
Description copied from interface:ITool
Event handler for the case where the model editor viewport has been interacted with with the mouse- Specified by:
onViewportMouseEvent
in interfaceITool
- Overrides:
onViewportMouseEvent
in classAbstractBaseTool
- Parameters:
e
- The event that happened
-
onVertexMouseEvent
Description copied from interface:ITool
Event handler for the case where a vertex has been interacted with with the mouse- Specified by:
onVertexMouseEvent
in interfaceITool
- Overrides:
onVertexMouseEvent
in classAbstractBaseTool
- Parameters:
e
- The event that happened
-
onEdgeMouseEvent
Description copied from interface:ITool
Event handler for the case where an edge has been interacted with with the mouse- Specified by:
onEdgeMouseEvent
in interfaceITool
- Overrides:
onEdgeMouseEvent
in classAbstractBaseTool
- Parameters:
e
- The event that happened
-
clear
public void clear()Clear the selection -
toggleSelected
Toggle the selection of a syntactic element- Parameters:
id
- The id of the element to select / deselectselectable
- The selectable object to select / deselect
-
getSelection
Get the current selection- Returns:
- An observable list of selections
-