Package org.opentrafficsim.editor
Class NodeActions
java.lang.Object
org.opentrafficsim.editor.NodeActions
This class houses actions that can be performed on tree nodes. The actions will always be executed. Any check on whether the
state of a node is appropriate for an action, is up to the caller. Callers are typically mouse event or key listeners on the
tree.
Copyright (c) 2023-2024 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
ConstructorDescriptionNodeActions
(OtsEditor editor, de.javagl.treetable.JTreeTable treeTable) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(XsdTreeNode node) Add node.void
copy
(XsdTreeNode node) Copy node.void
cut
(XsdTreeNode node) Cut node.void
duplicate
(XsdTreeNode node) Duplicate node.void
expand
(XsdTreeNode node, TreePath path, boolean expanded) Expand, or collapse, node.void
insert
(XsdTreeNode node) Insert node.void
move
(XsdTreeNode node, int down) Move node.void
paste
(XsdTreeNode node) Paste node.void
remove
(XsdTreeNode node) Remove node.void
revolveOption
(XsdTreeNode node, List<XsdOption> options) Revolve to the next option of the node.
-
Constructor Details
-
NodeActions
Constructor.- Parameters:
editor
- OtsEditor; editor.treeTable
- JTreeTable; tree table.
-
-
Method Details
-
add
Add node.- Parameters:
node
- XsdTreeNode; node.
-
duplicate
Duplicate node.- Parameters:
node
- XsdTreeNode; node.
-
remove
Remove node.- Parameters:
node
- XsdTreeNode; node.
-
copy
Copy node.- Parameters:
node
- XsdTreeNode; node.
-
cut
Cut node.- Parameters:
node
- XsdTreeNode; node.
-
insert
Insert node.- Parameters:
node
- XsdTreeNode; node.
-
paste
Paste node.- Parameters:
node
- XsdTreeNode; node.
-
revolveOption
Revolve to the next option of the node.- Parameters:
node
- XsdTreeNode; node.options
- List<XsdOption>; options of the node. These are obtainable from the node, but already gathered by the caller of this method and therefore forwarded for efficieny.
-
expand
Expand, or collapse, node.- Parameters:
node
- XsdTreeNode; node.path
- TreePath; path in the tree of the node.expanded
- boolean; whether the node is currently expanded.
-
move
Move node.- Parameters:
node
- XsdTreeNode; node.down
- int; number of rows to move the node down.
-