Class NodeActions

java.lang.Object
org.opentrafficsim.editor.NodeActions

public class NodeActions extends Object
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 Details

    • NodeActions

      public NodeActions(OtsEditor editor, de.javagl.treetable.JTreeTable treeTable)
      Constructor.
      Parameters:
      editor - OtsEditor; editor.
      treeTable - JTreeTable; tree table.
  • Method Details

    • add

      public void add(XsdTreeNode node)
      Add node.
      Parameters:
      node - XsdTreeNode; node.
    • duplicate

      public void duplicate(XsdTreeNode node)
      Duplicate node.
      Parameters:
      node - XsdTreeNode; node.
    • remove

      public void remove(XsdTreeNode node)
      Remove node.
      Parameters:
      node - XsdTreeNode; node.
    • copy

      public void copy(XsdTreeNode node)
      Copy node.
      Parameters:
      node - XsdTreeNode; node.
    • cut

      public void cut(XsdTreeNode node)
      Cut node.
      Parameters:
      node - XsdTreeNode; node.
    • insert

      public void insert(XsdTreeNode node)
      Insert node.
      Parameters:
      node - XsdTreeNode; node.
    • paste

      public void paste(XsdTreeNode node)
      Paste node.
      Parameters:
      node - XsdTreeNode; node.
    • revolveOption

      public void revolveOption(XsdTreeNode node, List<XsdOption> options)
      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

      public void expand(XsdTreeNode node, TreePath path, boolean expanded)
      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

      public void move(XsdTreeNode node, int down)
      Move node.
      Parameters:
      node - XsdTreeNode; node.
      down - int; number of rows to move the node down.