Class Tree

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class Tree extends JTree
See Also:
  • Field Details

    • treePopupMenu

      private final JPopupMenu treePopupMenu
    • rootNode

      private final Object rootNode
  • Constructor Details

    • Tree

      public Tree(Component parentComponent)
      Constructor.
      Parameters:
      parentComponent - the main UI where the Tree resides.
  • Method Details

    • getPopupLocation

      public Point getPopupLocation(MouseEvent event)
      Overrides:
      getPopupLocation in class JComponent
    • addPopupMenuItems

      private void addPopupMenuItems(TreePath nodePath)
      Produce the popup menu items depending on the node of a certain TreePath.
      Parameters:
      nodePath - is instance of TreePath of the specified Node.
    • getTreePathMenuItem

      private JMenuItem getTreePathMenuItem(TreePath path)
      Produce the JMenuItem that gives way to copy tree path string to clipboard
      Parameters:
      path - the TreePath instance
      Returns:
      Menu Item
    • getRawStreamSaveMenu

      private JMenuItem getRawStreamSaveMenu(COSStream cosStream)
      Produce JMenuItem that saves the raw stream
      Parameters:
      cosStream - stream to save
      Returns:
      JMenuItem for saving the raw stream
    • getFilters

      private String getFilters(COSStream cosStream)
      Returns the filters used by the given stream.
    • getStreamSaveMenu

      private JMenuItem getStreamSaveMenu(COSStream cosStream, TreePath nodePath)
      Produce JMenuItem that saves the stream
      Parameters:
      cosStream - stream to save
      Returns:
      JMenuItem for saving stream
    • getFileExtensionForStream

      private String getFileExtensionForStream(COSStream cosStream, TreePath nodePath)
      Returns the recommended file extension for the given cos stream.
    • getFileOpenMenu

      private JMenuItem getFileOpenMenu(COSStream cosStream, TreePath nodePath)
      Produce JMenuItem that opens the stream with the system's default app.
    • getPartiallyDecodedStreamSaveMenu

      private List<JMenuItem> getPartiallyDecodedStreamSaveMenu(COSStream cosStream)
      produce possible partially decoded stream saving menu items
      Parameters:
      cosStream - stream to save
      Returns:
      JMenuItems for saving partially decoded streams
    • getPartialStreamSavingMenuItem

      private JMenuItem getPartialStreamSavingMenuItem(int indexOfStopFilter, PDStream stream)
    • saveStream

      private void saveStream(byte[] bytes, FileFilter filter, String extension) throws IOException
      Save the stream.
      Parameters:
      bytes - byte array of the stream.
      filter - an optional FileFilter
      Throws:
      IOException - if there is an error in creation of the file.