Package dk.gtz.graphedit.tool
Class VertexDeleteTool
java.lang.Object
dk.gtz.graphedit.tool.AbstractBaseTool
dk.gtz.graphedit.tool.VertexDeleteTool
- All Implemented Interfaces:
ITool
Tool to delete vertices.
When selected, click an vertex to delete it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(ViewModelProjectResource buffer, UUID vertexId, ViewModelVertex vertex, ViewModelGraph graph) Delete a specified vertexjavafx.scene.Node
Get the graphical representation for the tool selection button.Get a multiline string that describe the tool and how to use itGet a multiline tooltip string that briefly describes this toolvoid
Event handler for the case where a vertex has been interacted with with the mouseMethods inherited from class dk.gtz.graphedit.tool.AbstractBaseTool
onEdgeMouseEvent, onKeyEvent, onViewportMouseEvent
-
Constructor Details
-
VertexDeleteTool
public VertexDeleteTool()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
-
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
-
delete
public void delete(ViewModelProjectResource buffer, UUID vertexId, ViewModelVertex vertex, ViewModelGraph graph) Delete a specified vertex- Parameters:
buffer
- The buffer that contains the vertex. This is used to push undo actionsvertexId
- The id of the vertex to deletevertex
- The viewmodel object of the vertex to deletegraph
- The graph that contains the vertex
-