Package com.pixelmed.display

## Class IconListBrowser

- java.lang.Object
- - com.pixelmed.display.IconListBrowser

-     public class IconListBrowser
      extends java.lang.Object

  This class implements a panel of icons of DICOM images inside a parent JScrollPane.

  Maintains icons in a pre-defined sorted order based on DICOM attributes as they are added and removed.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected class` | `IconListBrowser.OurCellRenderer` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `DEFAULT_ICON_SIZE` |
    `protected static java.lang.String` | `ICON_FILE_PREFIX` |
    `protected static java.lang.String` | `ICON_FILE_SUFFIX` |
    `protected static java.lang.String` | `ICON_FORMAT` |
    `protected static int` | `ICON_QUALITY` |
    `protected int` | `iconSize` |
    `protected javax.swing.JList` | `list` |
    `protected javax.swing.DefaultListModel` | `model` |
    `protected javax.swing.JScrollPane` | `parentScrollPane` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `IconListBrowser​(int iconSize)` | Build and display an (initally empty) graphical user interface view of a set of DICOM images.
    `IconListBrowser​(java.awt.Container content, java.lang.String[] dicomFileNames)` | Build and display a graphical user interface view of a set of DICOM image files.
    `IconListBrowser​(javax.swing.JFrame frame, java.lang.String[] dicomFileNames)` | Build and display a graphical user interface view of a set of DICOM image files.
    `IconListBrowser​(javax.swing.JScrollPane parentScrollPane)` | Build and display an (initally empty) graphical user interface view of a set of DICOM images.
    `IconListBrowser​(javax.swing.JScrollPane parentScrollPane, int iconSize)` | Build and display an (initally empty) graphical user interface view of a set of DICOM images.
    `IconListBrowser​(javax.swing.JScrollPane parentScrollPane, java.lang.String[] dicomFileNames)` | Build and display a graphical user interface view of a set of DICOM image files.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `add​(java.lang.String dicomFileName)` | Add an annotated icon of a DICOM image.
    `void` | `addDicomFiles​(java.lang.String[] dicomFileNames)` | Add a set of DICOM image files.
    `static void` | `main​(java.lang.String[] arg)` | Method for testing.
    `protected void` | `setParentScrollPane​(javax.swing.JScrollPane parentScrollPane)` | Set the parent scoll pane.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_ICON_SIZE

          public static final int DEFAULT_ICON_SIZE

      See Also:
        Constant Field Values

    - #### ICON_FILE_PREFIX

          protected static final java.lang.String ICON_FILE_PREFIX

      See Also:
        Constant Field Values

    - #### ICON_FORMAT

          protected static final java.lang.String ICON_FORMAT

      See Also:
        Constant Field Values

    - #### ICON_QUALITY

          protected static final int ICON_QUALITY

      See Also:
        Constant Field Values

    - #### ICON_FILE_SUFFIX

          protected static final java.lang.String ICON_FILE_SUFFIX

      See Also:
        Constant Field Values

    - #### iconSize

          protected int iconSize

    - #### parentScrollPane

          protected javax.swing.JScrollPane parentScrollPane

    - #### list

          protected javax.swing.JList list

    - #### model

          protected javax.swing.DefaultListModel model

  - ### Constructor Detail

    - #### IconListBrowser

          public IconListBrowser​(int iconSize)
                          throws DicomException

      Build and display an (initally empty) graphical user interface view of a set of DICOM images.

      Parameters:
        `iconSize` - the width and height in pixels of the icons to be created
      Throws:
        `DicomException` - thrown if the icons cannot be extracted

    - #### IconListBrowser

          public IconListBrowser​(javax.swing.JScrollPane parentScrollPane,
                                 int iconSize)
                          throws DicomException

      Build and display an (initally empty) graphical user interface view of a set of DICOM images.

      Parameters:
        `parentScrollPane` - the scrolling pane in which the icons will be rendered
        `iconSize` - the width and height in pixels of the icons to be created
      Throws:
        `DicomException` - thrown if the icons cannot be extracted

    - #### IconListBrowser

          public IconListBrowser​(javax.swing.JScrollPane parentScrollPane)
                          throws DicomException

      Build and display an (initally empty) graphical user interface view of a set of DICOM images.

      Uses default icon size.

      Parameters:
        `parentScrollPane` - the scrolling pane in which the icons will be rendered
      Throws:
        `DicomException` - thrown if the icons cannot be extracted

    - #### IconListBrowser

          public IconListBrowser​(javax.swing.JScrollPane parentScrollPane,
                                 java.lang.String[] dicomFileNames)
                          throws DicomException,
                                 java.io.FileNotFoundException,
                                 java.io.IOException

      Build and display a graphical user interface view of a set of DICOM image files.

      Uses default icon size.

      Parameters:
        `parentScrollPane` - the scrolling pane in which the icons will be rendered
        `dicomFileNames` - a list of DICOM files
      Throws:
        `DicomException` - thrown if the icons cannot be extracted
        `java.io.FileNotFoundException` - thrown if a file cannot be found
        `java.io.IOException` - thrown if a file cannot be read

    - #### IconListBrowser

          public IconListBrowser​(java.awt.Container content,
                                 java.lang.String[] dicomFileNames)
                          throws DicomException,
                                 java.io.FileNotFoundException,
                                 java.io.IOException

      Build and display a graphical user interface view of a set of DICOM image files.

      Parameters:
        `content` - a container to which will be added will be added a scrolling pane containing the icon browser
        `dicomFileNames` - a list of DICOM files
      Throws:
        `DicomException` - thrown if the icons cannot be extracted
        `java.io.FileNotFoundException` - thrown if a file cannot be found
        `java.io.IOException` - thrown if a file cannot be read

    - #### IconListBrowser

          public IconListBrowser​(javax.swing.JFrame frame,
                                 java.lang.String[] dicomFileNames)
                          throws DicomException,
                                 java.io.FileNotFoundException,
                                 java.io.IOException

      Build and display a graphical user interface view of a set of DICOM image files.

      Parameters:
        `frame` - a frame to whose content pane will be added a scrolling pane containing the icon browser
        `dicomFileNames` - a list of DICOM files
      Throws:
        `DicomException` - thrown if the icons cannot be extracted
        `java.io.FileNotFoundException` - thrown if a file cannot be found
        `java.io.IOException` - thrown if a file cannot be read

  - ### Method Detail

    - #### setParentScrollPane

          protected void setParentScrollPane​(javax.swing.JScrollPane parentScrollPane)

      Set the parent scoll pane.

      Used from within constructors.

      Parameters:
        `parentScrollPane` -

    - #### addDicomFiles

          public void addDicomFiles​(java.lang.String[] dicomFileNames)
                             throws DicomException,
                                    java.io.FileNotFoundException,
                                    java.io.IOException

      Add a set of DICOM image files.

      Parameters:
        `dicomFileNames` - a list of DICOM files
      Throws:
        `DicomException` - thrown if the icons cannot be extracted
        `java.io.FileNotFoundException` - thrown if a file cannot be found
        `java.io.IOException` - thrown if a file cannot be read

    - #### add

          public void add​(java.lang.String dicomFileName)
                   throws DicomException,
                          java.io.FileNotFoundException,
                          java.io.IOException

      Add an annotated icon of a DICOM image.

      Parameters:
        `dicomFileName` - the name of the file containing the DICOM image
      Throws:
        `DicomException` - thrown if the icons cannot be extracted
        `java.io.FileNotFoundException` - thrown if a file cannot be found
        `java.io.IOException` - thrown if a file cannot be read

    - #### main

          public static void main​(java.lang.String[] arg)

      Method for testing.

      Parameters:
        `arg` - a list of DICOM image files from which to extract one icon each and display