Class ViewImageDirectory

All Implemented Interfaces:
PreviewImageContainer, ActionListener, ComponentListener, ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, TreeExpansionListener, TreeSelectionListener, RootPaneContainer, WindowConstants
Direct Known Subclasses:
ViewJFrameDICOMParser

Tree of images beneath the given directory. When a user clicks on a filename, a thumbnail of the image appears, along with the header data.
Version:
1.0 June 1, 2002
Author:
Neva Cherniavsky
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • directory

      protected String directory
      DOCUMENT ME!
    • directoryTree

      protected JTree directoryTree
      DOCUMENT ME!
    • file

      protected File file
      DOCUMENT ME!
    • imageFilter

      protected ViewImageFileFilter imageFilter
      DOCUMENT ME!
    • imagePanel

      protected JPanel imagePanel
      DOCUMENT ME!
    • img

      DOCUMENT ME!
    • node

      protected ViewFileTreeNode node
      DOCUMENT ME!
    • serif12

      protected Font serif12
      DOCUMENT ME!
    • serif12B

      protected Font serif12B
      DOCUMENT ME!
    • thumbnail

      protected FileImageXML.Thumbnail thumbnail
      DOCUMENT ME!
    • treePanel

      protected JPanel treePanel
      DOCUMENT ME!
    • userInterface

      protected ViewUserInterface userInterface
      DOCUMENT ME!
    • brightness

      private int brightness
      DOCUMENT ME!
    • brightPanel

      private JPanel brightPanel
      DOCUMENT ME!
    • brightSlider

      private JSlider brightSlider
      DOCUMENT ME!
    • contSlider

      private JSlider contSlider
      DOCUMENT ME!
    • contrast

      private float contrast
      DOCUMENT ME!
    • current

      private JLabel current
      DOCUMENT ME!
    • current2

      private JLabel current2
      DOCUMENT ME!
    • defaultImageSize

      private Dimension defaultImageSize
      DOCUMENT ME!
    • imageSliderPane

      private JSplitPane imageSliderPane
      DOCUMENT ME!
    • nfc

      private NumberFormat nfc
      DOCUMENT ME!
    • openSeparate

      private boolean openSeparate
      DOCUMENT ME!
    • openSeparateOption

      private JCheckBoxMenuItem openSeparateOption
      DOCUMENT ME!
    • origBrightness

      private int origBrightness
      DOCUMENT ME!
    • origContrast

      private float origContrast
      DOCUMENT ME!
    • otherLabel

      private JLabel otherLabel
      DOCUMENT ME!
    • primaryModel

      private ViewTableModel primaryModel
      DOCUMENT ME!
    • primaryTable

      private JTable primaryTable
      DOCUMENT ME!
    • secondaryModel

      private ViewTableModel secondaryModel
      DOCUMENT ME!
    • secondaryTable

      private JTable secondaryTable
      DOCUMENT ME!
    • showXMLThumbnail

      private boolean showXMLThumbnail
      DOCUMENT ME!
    • sliderPanel

      private JPanel sliderPanel
      DOCUMENT ME!
    • thumbnailOption

      private JCheckBoxMenuItem thumbnailOption
      DOCUMENT ME!
  • Constructor Details

    • ViewImageDirectory

      public ViewImageDirectory(String dir, ViewImageFileFilter filter)
      Creates new tree of images and sets up file filter. Calls initialization method.
      Parameters:
      dir - DOCUMENT ME!
      filter - Directory to make tree under.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Recreates the tree when a new directory is selected; refreshes the tree when refresh is selected.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - Event that triggered this function.
    • componentHidden

      public void componentHidden(ComponentEvent event)
      Unchanged.
      Specified by:
      componentHidden in interface ComponentListener
      Parameters:
      event - DOCUMENT ME!
    • componentMoved

      public void componentMoved(ComponentEvent event)
      Unchanged.
      Specified by:
      componentMoved in interface ComponentListener
      Parameters:
      event - DOCUMENT ME!
    • componentResized

      public void componentResized(ComponentEvent event)
      Tells the component image that the size of the image panel has changed, then repaints the component image.
      Specified by:
      componentResized in interface ComponentListener
      Parameters:
      event - Event that triggered this function.
    • componentShown

      public void componentShown(ComponentEvent event)
      Unchanged.
      Specified by:
      componentShown in interface ComponentListener
      Parameters:
      event - DOCUMENT ME!
    • getPanelSize

      public Dimension getPanelSize()
      Called by the component image to get the real-time size of the panel before centering.
      Specified by:
      getPanelSize in interface PreviewImageContainer
      Returns:
      The size of the panel.
    • getComponentPreviewImage

      public ViewJComponentPreviewImage getComponentPreviewImage()
      Gets the ViewJComponentPreviewImage that contains the currently selected model image.
      Returns:
      Gets the contained preview image component.
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Sets border painted or not painted depending on if the button was selected or deselected.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      event - Event that triggered this function.
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Sets values based on knob along slider.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - Event that triggered this function
    • treeCollapsed

      public void treeCollapsed(TreeExpansionEvent tee)
      Unchanged.
      Specified by:
      treeCollapsed in interface TreeExpansionListener
      Parameters:
      tee - DOCUMENT ME!
    • treeExpanded

      public void treeExpanded(TreeExpansionEvent tee)
      Expands tree node in file tree. On expansion, the tree queries the selected node; if a selected node has had its children previously added, then no nodes will be added, but the tree will display the previously added children. Otherwize, the node will add nodes which will be displayed; each node will be marked as adding only directories as child-nodes.
      Specified by:
      treeExpanded in interface TreeExpansionListener
      Parameters:
      tee - Event that triggered this function.
    • valueChanged

      public void valueChanged(TreeSelectionEvent e)
      Re-create the image and header info by reacting to each selection on the tree. On selection, the image is read in again and constructed, and the table is cleared and the new header info is posted to the table. Note: no check has been made to remove child-nodes from a selection when the parent has been selected.
      Specified by:
      valueChanged in interface TreeSelectionListener
      Parameters:
      e - Event that triggered this function.
    • buildImage

      protected FileInfoBase buildImage(String fileName, String directory)
      DOCUMENT ME!
      Parameters:
      fileName - String
      directory - String
      Returns:
      FileInfoBase
    • buildSourceTreeListing

      protected void buildSourceTreeListing(boolean directoriesOnly)
      Creates the tree that holds the image files and returns the panel containing the tree.
      Parameters:
      directoriesOnly - DOCUMENT ME!
    • buildTitledBorder

      protected TitledBorder buildTitledBorder(String title)
      Builds a titled border with the given title, an etched border, and the proper font and color.
      Parameters:
      title - Title of the border
      Returns:
      The titled border.
    • buildToolbar

      protected JPanel buildToolbar()
      Builds a toolbar with the same functionality as the menu.
      Returns:
      DOCUMENT ME!
    • init

      protected void init()
      Initializes the GUI components and adds them to the main frame.
    • buildBrightContPanel

      private void buildBrightContPanel()
      Initializes GUI components and displays dialog.

      For the brightSlider the slider values and the brightness values are identical. brightness is an offset going from -255 to 255. This is enough to change all 0 values to 255 and all 255 values to 0. brightness is added to all contrast scaled red, green, and blue.

      However, for the contrastSlider the slider values are different from the contrast values. The contrast values go from 0.1 to 10.0 while the slider values go from -200 to 200. contrast = (float)Math.pow(10.0,contSlider.getValue()/200.0) The original red, green, and blue are mutliplied by contrast.

    • buildImagePanel

      private JSplitPane buildImagePanel()
      Sets up the image panel and the table that will store basic header info, and returns the panel containing these.
      Returns:
      The panel containing the image and the header info table.
    • buildMenu

      private void buildMenu()
      Builds a small menu with "New directory", "Refresh directory", "Reset file filter", and "Open image" options.