Class LayerTree

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class LayerTree extends JPanel
Author:
ACER
See Also:
  • Field Details

  • Constructor Details

    • LayerTree

      public LayerTree()
      Creates new LayerTree
  • Method Details

    • addNode

      public <T> DefaultMutableTreeNode addNode(DefaultMutableTreeNode parent, String label, T value, BiConsumer<T,DefaultMutableTreeNode> onSelect)
      Adds a new node to the tree.
      Type Parameters:
      T - The type of the value.
      Parameters:
      parent - The parent node. If null, the node is added to the root.
      label - The label of the node.
      value - The value of the node.
      onSelect - The action to perform when the node is selected.
      Returns:
      The newly created node.
    • toggleHidden

      public void toggleHidden()
    • addNode

      public <T> DefaultMutableTreeNode addNode(DefaultMutableTreeNode parent, TreeNodeIdentity<T> tni)
      Adds a new node to the tree.
      Type Parameters:
      T - The type of the value.
      Parameters:
      parent - The parent node. If null, the node is added to the root.
      tni - The TreeNodeIdentity object containing label, value, and onSelect action.
      Returns:
      The newly created node.
    • removeNode

      public void removeNode(DefaultMutableTreeNode node)
      Removes a node from the tree.
      Parameters:
      node - The node to remove.
    • initComponents

      private void initComponents()
      This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.