Package org.opentrafficsim.editor
Class Actions
java.lang.Object
org.opentrafficsim.editor.Actions
This class houses all the actions that are made available on the editor. They can be bound to a component with a key-stroke
using
bind(JComponent, int, Action), or they can be programmatically invoked using
invoke(Action).
Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNode()Action to add node.static voidbind(JComponent component, int state, Action action) Binds a key stroke to an action on the component.Action to collapse all.copyNode()Action to copy node.cutNode()Action to cut node.Action to delete node.static DocumentListenerdocumentListener(Runnable runnable) Returns a document listener that executes the runnable on any change.Action to duplicate node.Action to expand or collapse node.Returns the node actions.Action to insert node.static voidInvoke action programmatically.Action to move node down.Action to move node up.Action to paste node.Action to revolve node.voidsetTreeTable(de.javagl.treetable.JTreeTable treeTable) Sets a new tree table as a new file is created or loaded.Action to show the description of a tree node.Action to show the invalid message on an attribute.Action to show the description of a tree node.Action to show the invalid message on a tree node.
-
Constructor Details
-
Actions
Constructor.- Parameters:
editor- editorattributesTable- attributes table
-
-
Method Details
-
setTreeTable
public void setTreeTable(de.javagl.treetable.JTreeTable treeTable) Sets a new tree table as a new file is created or loaded.- Parameters:
treeTable- tree table
-
getNodeActions
Returns the node actions.- Returns:
- node actions
-
bind
Binds a key stroke to an action on the component. The key stroke is taken from the action'sAction.ACCELERATOR_KEYvalue.- Parameters:
component- componentstate- int, for example JComponent.WHEN_FOCUSEDaction- action
-
invoke
Invoke action programmatically. If the action is disabled it will be ignored.- Parameters:
action- action to invoke
-
documentListener
Returns a document listener that executes the runnable on any change.- Parameters:
runnable- runnable to run on any change- Returns:
- document listener that executes the runnable on any change
-
showTreeNodeDescription
Action to show the description of a tree node. Ignored of the node does not have a description.- Returns:
- action to show the description of a tree node
-
showTreeNodeInvalid
Action to show the invalid message on a tree node. Ignored if the node is valid.- Returns:
- action to show the invalid message on a tree node
-
showAttributeDescription
Action to show the description of a tree node. Ignored of the node does not have a description.- Returns:
- action to show the description of a tree node
-
showAttributeInvalid
Action to show the invalid message on an attribute. Ignored if the attribute is valid.- Returns:
- action to show the invalid message on an attribute
-
addNode
Action to add node.- Returns:
- action to add node
-
duplicateNode
Action to duplicate node.- Returns:
- action to duplicate node
-
deleteNode
Action to delete node.- Returns:
- action to delete node
-
copyNode
Action to copy node.- Returns:
- action to copy node
-
cutNode
Action to cut node.- Returns:
- action to cut node
-
insertNode
Action to insert node.- Returns:
- action to insert node
-
pasteNode
Action to paste node.- Returns:
- action to paste node
-
revolveNode
Action to revolve node.- Returns:
- action to revolve node
-
collapseAll
Action to collapse all.- Returns:
- action to collapse all
-
expandOrCollapseNode
Action to expand or collapse node.- Returns:
- action to expand or collapse node
-
moveNodeUp
Action to move node up.- Returns:
- action to move node up
-
moveNodeDown
Action to move node down.- Returns:
- action to move node down
-