Module org.jpo
Package org.jpo.gui

Class CollectionJTreeController

java.lang.Object
org.jpo.gui.CollectionJTreeController

public class CollectionJTreeController extends Object
This class deals with the tree representation of the picture collection
  • Constructor Details

    • CollectionJTreeController

      public CollectionJTreeController(PictureCollection pictureCollection)
      The Controller class for the tree representation of the picture collection.
      Parameters:
      pictureCollection - the PictureCollection to control
  • Method Details

    • handleShowGroupRequest

      public void handleShowGroupRequest(ShowGroupRequest request)
      When the tree receives a ShowGroupRequest it position the selection on the node.
      Parameters:
      request - The ShowGroupRequest
    • getSelectedNode

      public static Optional<SortableDefaultMutableTreeNode> getSelectedNode(JComponent component)
      A helper method that returns us the selected node on the tree if we have a selection, and it is pointing to a GroupInfo or a PictureInfo object.
      Parameters:
      component - The component that we want to check
      Returns:
      the node if we have one.
    • getCollectionJTree

      @TestOnly public JTree getCollectionJTree()
    • getJScrollPane

      public JScrollPane getJScrollPane()
      Returns the JScrollPane that holds the JTree.
      Returns:
      the JScrollPane that holds the tree