Package dk.gtz.graphedit.tool
Class ClipboardTool
java.lang.Object
dk.gtz.graphedit.tool.AbstractBaseTool
dk.gtz.graphedit.tool.ClipboardTool
- All Implemented Interfaces:
ITool
Tool that enables cut/copy/paste support
- ctrl + x to cut
- ctrl + c to copy
- ctrl + v to paste
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Copy the currently selected elements into the system's clipboard.void
Copy the currently selected elements into the system's clipboard and delete the elements.javafx.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 the model editor viewport has been interacted with with the keyboardvoid
Paste the current content of the system clipboard.Methods inherited from class dk.gtz.graphedit.tool.AbstractBaseTool
onEdgeMouseEvent, onVertexMouseEvent, onViewportMouseEvent
-
Constructor Details
-
ClipboardTool
public ClipboardTool()Create a new instance ofClipboardTool
-
-
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
-
copySelection
Copy the currently selected elements into the system's clipboard.- Parameters:
e
- The key event
-
pasteModel
Paste the current content of the system clipboard. If the content is not a valid serialized model an error is logged and nothing will happen- Parameters:
e
- The key event
-
cutSelection
Copy the currently selected elements into the system's clipboard and delete the elements.- Parameters:
e
- The key event
-