Class ViewJFrameDICOMQuery

All Implemented Interfaces:
ActionListener, ComponentListener, FocusListener, MouseListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, ListSelectionListener, RootPaneContainer, WindowConstants

GUI for DICOM Query and retreival from DICOM compliant servers. There are three tabbed panels in the GUI. The first one is DICOM Query Panel. It has a panel for entering the query information, a panel for setting the dates of the query, a table that displays the results of the query, and a table that displays the status of any move requests. The user may either double click on the query table, hit the "Send Query" button, or hit the "Down" button to send a query to the next level. To go up a level, the user can click the "Up" button. To move an image from any level, the user can select the item to move on and click the "Move Image" button. At the images level, double clicking on an image will move that image. When a move request is sent, it is put in a separate thread. That thread updates the message table as to the progress of the move request.
Version:
1.0
Author:
Neva Cherniavsky, Matthew McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

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

      private static final int DEFAULT_MIN_YEAR
      DOCUMENT ME!
      See Also:
    • PATIENT_LEVEL

      private static final int PATIENT_LEVEL
      DOCUMENT ME!
      See Also:
    • STUDY_LEVEL

      private static final int STUDY_LEVEL
      DOCUMENT ME!
      See Also:
    • SERIES_LEVEL

      private static final int SERIES_LEVEL
      DOCUMENT ME!
      See Also:
    • IMAGE_LEVEL

      private static final int IMAGE_LEVEL
      DOCUMENT ME!
      See Also:
    • MINIMUM_SIZE

      private static final Dimension MINIMUM_SIZE
      DOCUMENT ME!
    • browseButton

      private JButton browseButton
      DOCUMENT ME!
    • currentDateL

      private JLabel currentDateL
      DOCUMENT ME!
    • dicomQuery

      private DICOM_Query dicomQuery
      DOCUMENT ME!
    • endYearBox

      private JComboBox endYearBox
      DOCUMENT ME!
    • endMonthBox

      private JComboBox endMonthBox
      DOCUMENT ME!
    • endDayBox

      private JComboBox endDayBox
      DOCUMENT ME!
    • font12

      private static final Font font12
      DOCUMENT ME!
    • font12B

      private static final Font font12B
      DOCUMENT ME!
    • listPanel

      private JPanel listPanel
      DOCUMENT ME!
    • messageTable

      private DICOMDisplayer messageTable
      DOCUMENT ME!
    • monthString

      private static final String[] monthString
      DOCUMENT ME!
    • moveRequestHash

      DOCUMENT ME!
    • ptNameText

      private JTextField ptNameText
      DOCUMENT ME!
    • ptIDText

      private JTextField ptIDText
      DOCUMENT ME!
    • studyNOText

      private JTextField studyNOText
      DOCUMENT ME!
    • physText

      private JTextField physText
      DOCUMENT ME!
    • queryLev

      private JLabel queryLev
      DOCUMENT ME!
    • queryLevel

      private int queryLevel
      DOCUMENT ME!
    • queryMsgID

      private int queryMsgID
      DOCUMENT ME!
    • aboutPanel

      private JPanel aboutPanel
    • queryPDU

      private DICOM_PDUService queryPDU
      DOCUMENT ME!
    • queryResultTable

      private JTable queryResultTable
      DOCUMENT ME!
    • queryTableModel

      private ViewTableModel queryTableModel
      DOCUMENT ME!
    • refreshButton

      private JButton refreshButton
      DOCUMENT ME!
    • rootQueryPanel

      private JPanel rootQueryPanel
      DOCUMENT ME!
    • sendButton

      private JButton sendButton
      DOCUMENT ME!
    • sendDestCBox

      private JComboBox sendDestCBox
      DOCUMENT ME!
    • sendModel

      private ViewTableModel sendModel
      DOCUMENT ME!
    • sendQueryThread

      private Thread sendQueryThread
      DOCUMENT ME!
    • sendStatusClearButton

      private JButton sendStatusClearButton
      DOCUMENT ME!
    • sendStatusTArea

      private JTextArea sendStatusTArea
      DOCUMENT ME!
    • sendTable

      private JTable sendTable
      DOCUMENT ME!
    • seriesInstanceUID

      private String seriesInstanceUID
      DOCUMENT ME!
    • serverModel

      private ViewTableModel serverModel
      DOCUMENT ME!
    • serverTable

      private JTable serverTable
      DOCUMENT ME!
    • set

      private JButton set
      Buttons used for the host tab
    • activateStore

      private JButton activateStore
      Buttons used for the host tab
    • createStore

      private JButton createStore
      Buttons used for the host tab
    • editStore

      private JButton editStore
      Buttons used for the host tab
    • deleteStore

      private JButton deleteStore
      Buttons used for the host tab
    • setStore

      private JButton setStore
      Buttons used for the host tab
    • cancel

      private JButton cancel
      Buttons used for the host tab
    • help1

      private JButton help1
      Buttons used for the host tab
    • help2

      private JButton help2
      Buttons used for the host tab
    • help3

      private JButton help3
      Buttons used for the host tab
    • help4

      private JButton help4
      Buttons used for the host tab
    • SOPInstanceUID

      private String SOPInstanceUID
      DOCUMENT ME!
    • sourceTextF

      private JTextField sourceTextF
      DOCUMENT ME!
    • startCalendar

      private Calendar startCalendar
      DOCUMENT ME!
    • endCalendar

      private Calendar endCalendar
      DOCUMENT ME!
    • todayCalendar

      private Calendar todayCalendar
      DOCUMENT ME!
    • startYearBox

      private JComboBox startYearBox
      DOCUMENT ME!
    • startMonthBox

      private JComboBox startMonthBox
      DOCUMENT ME!
    • startDayBox

      private JComboBox startDayBox
      DOCUMENT ME!
    • storageModel

      private ViewTableModel storageModel
      DOCUMENT ME!
    • storageTable

      private JTable storageTable
      DOCUMENT ME!
    • studyInstanceUID

      private String studyInstanceUID
      DOCUMENT ME!
    • subQueryPanel

      private JPanel subQueryPanel
      DOCUMENT ME!
    • tabbedPane

      private JTabbedPane tabbedPane
      DOCUMENT ME!
    • testButton

      private JButton testButton
      DOCUMENT ME!
    • textArea

      private JTextArea textArea
      DOCUMENT ME!
    • uids

      private DICOM_UID[] uids
      DOCUMENT ME!
    • up

      private JButton up
      DOCUMENT ME!
    • down

      private JButton down
      DOCUMENT ME!
    • cancelQ

      private JButton cancelQ
      DOCUMENT ME!
    • send

      private JButton send
      DOCUMENT ME!
    • move

      private JButton move
      DOCUMENT ME!
    • create

      private JButton create
      DOCUMENT ME!
    • edit

      private JButton edit
      DOCUMENT ME!
    • delete

      private JButton delete
      DOCUMENT ME!
    • upDirButton

      private JButton upDirButton
      DOCUMENT ME!
    • sendPanel

      private final JPanel sendPanel
    • userInterface

      private static final ViewUserInterface userInterface
  • Constructor Details

    • ViewJFrameDICOMQuery

      public ViewJFrameDICOMQuery()
      Constructs three tabbed panels - DICOM Query, Host and Help panels.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Calls various methods depending on the action.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - event that triggered function
    • getFiles

      private String[] getFiles(int[] rows)
    • addFiles

      private void addFiles(File current, Vector<String> list)
    • appendSendMessage

      public void appendSendMessage(String appMessage)
      Appends the text area with the message.
      Parameters:
      appMessage - the message
    • cancelPendingMoves

      public boolean cancelPendingMoves()
      Cancels pending moves.
      Returns:
      DOCUMENT ME!
    • cancelPendingQuery

      public boolean cancelPendingQuery()
      Cancels pending query.
      Returns:
      DOCUMENT ME!
    • componentHidden

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

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

      public void componentResized(ComponentEvent event)
      Does not allow component to be smaller than MINIMUM_SIZE.
      Specified by:
      componentResized in interface ComponentListener
      Parameters:
      event - event that triggered this method
    • componentShown

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

      public void displayQueryResults(int type)
      Displays the query results.
      Parameters:
      type - indicates the query level
    • focusGained

      public void focusGained(FocusEvent event)
      Unchanged.
      Specified by:
      focusGained in interface FocusListener
      Parameters:
      event - DOCUMENT ME!
    • focusLost

      public void focusLost(FocusEvent event)
      When the user clicks the mouse out of a text field, resets the neccessary variables.
      Specified by:
      focusLost in interface FocusListener
      Parameters:
      event - event that triggers this function
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      When the user double clicks on a selection, sends a query at the next query level; when the user clicks on a header, sorts the column.
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      e - event that triggered this method
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • mouseExited

      public void mouseExited(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • mousePressed

      public void mousePressed(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • stateChanged

      public void stateChanged(ChangeEvent e)
      ChangeListener************************************************************************* /** Sets values based on knob along slider.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - DOCUMENT ME! event that triggered this function
    • valueChanged

      public void valueChanged(ListSelectionEvent e)
      A List Selection Listener event for changes in the tables. If this is the query table, it will enable the down and move images buttons and set up the UIDs for querying. If this is the server or storage table, it will enable the edit, delete, and set as default buttons.
      Specified by:
      valueChanged in interface ListSelectionListener
      Parameters:
      e - event that triggered this method.
    • windowActivated

      public void windowActivated(WindowEvent event)
      Unchanged.
      Specified by:
      windowActivated in interface WindowListener
      Parameters:
      event - DOCUMENT ME!
    • windowClosed

      public void windowClosed(WindowEvent event)
      Unchanged.
      Specified by:
      windowClosed in interface WindowListener
      Parameters:
      event - DOCUMENT ME!
    • windowClosing

      public void windowClosing(WindowEvent event)
      Closes frame is requested. The user is notified if there are any pending image move requests. The user is able to
      Specified by:
      windowClosing in interface WindowListener
      Parameters:
      event - event that triggered this function
    • windowDeactivated

      public void windowDeactivated(WindowEvent event)
      Unchanged.
      Specified by:
      windowDeactivated in interface WindowListener
      Parameters:
      event - DOCUMENT ME!
    • windowDeiconified

      public void windowDeiconified(WindowEvent event)
      Unchanged.
      Specified by:
      windowDeiconified in interface WindowListener
      Parameters:
      event - DOCUMENT ME!
    • windowIconified

      public void windowIconified(WindowEvent event)
      Unchanged.
      Specified by:
      windowIconified in interface WindowListener
      Parameters:
      event - DOCUMENT ME!
    • windowOpened

      public void windowOpened(WindowEvent event)
      Unchanged.
      Specified by:
      windowOpened in interface WindowListener
      Parameters:
      event - DOCUMENT ME!
    • assignCalendar

      private Calendar assignCalendar(Calendar sourceC, Calendar targetC)
      Assign source Calendar to target calendar.
      Parameters:
      sourceC - The source calendar
      targetC - The target calendar that will copy the values of the source Calendar.
      Returns:
      The target calendar.
    • buildDatePanel

      private JPanel buildDatePanel()
      Builds the panel that designed for inputing study duration information. It contains a panel of radiobuttons, and two rows of pull down boxes to facilitate the input of information.
      Returns:
      The constructed panel.
    • buildHelpText

      private void buildHelpText()
      Constructs the helping manual in the help panel - one of the three panels in the tabbed panel. Reads the help information from a file "DICOMhelp.txt" that should be in the classpath. If it is not, throws up an error message and displays nothing in the tabbed pane.
    • buildHostPanel

      private JPanel buildHostPanel()
      Builds the host panel by calling methods to build the server and storage panels.
      Returns:
      the panel containing the hosts
    • buildLabel

      private JLabel buildLabel(String s)
      Builds the label for the textField, try to standardize the label appearance in the GUI.
      Parameters:
      s - a string which encode the name of the label
      Returns:
      the constructed label.
    • buildListingPanel

      private JPanel buildListingPanel()
      Builds the listing panel.
      Returns:
      the server panel
    • buildMessagePanel

      private JPanel buildMessagePanel()
      Construct the Query retrieval message panel. It contains a table for displaying the information.
      Returns:
      The constructed panel.
    • buildPtInfoPanel

      private JPanel buildPtInfoPanel()
      Constructs the patient information input panel.
      Returns:
      the constructed panel.
    • buildQueryPanel

      private JPanel buildQueryPanel()
      Builds the DICOM Query panel, one of the three tabbed Panels in the DICOMQuery GUI. Inside, there are three different elements: The patient information panel - patient name, ID, study dates ... The Query result panel - display the result of the query The message area - display the status of the query
      Returns:
      the DICOM Query Panel which contains the patient info and query result
    • buildRadioButton

      private JRadioButton buildRadioButton(String s, boolean flag)
      Constructs the radio button for fast input of study date range.
      Parameters:
      s - The name of the radio button: today, one week, one month ...
      flag - Whether the radio button is active by default or not.
      Returns:
      The constructed radio button with appropriated attributes attached.
    • buildSendPanel

      private final JPanel buildSendPanel()
      Builds the host panel by calling methods to build the server and storage panels.
      Returns:
      the panel containing
    • buildServerPanel

      private JPanel buildServerPanel()
      Builds the panel that contains the server table and four buttons. The server table consists of five columns with information the user needs to query the server. The buttons are "Create", which creates a new server; "Edit", which edits the currently selected server; "Delete", which deletes the currently selected server; and "Set As Default", which sets the current server as default. To get the data in the table, the table model reads the .preferences file and parses the data. When changes are made, they are saved to the .preferences file.
      Returns:
      the server panel
    • buildStoragePanel

      private JPanel buildStoragePanel()
      Builds the panel that contains the storage table and four buttons. The storage table consists of five columns with information the user needs to move images. The buttons are "Create", which creates a new destination; "Edit", which edits the currently selected destination; "Delete", which deletes the currently selected destination; and "Set As Default", which sets the current destination as default. To get the data in the table, the table model reads the .preferences file and parses the data. When changes are made, they are saved to the .preferences file.
      Returns:
      the storage panel
    • buildTextPanel

      private JPanel buildTextPanel()
      Constructs the panel that contains the query result table. There are four action-attached buttons to facilitate different levels of query: up, down, send query, and move images. Up moves the query up a level; down moves it down a level; send query sends a query; and move images moves an image or a set of images at that level.
      Returns:
      The constructed panel.
    • buildTitledBorder

      private TitledBorder buildTitledBorder(String s)
      Constructs the titled border for the panel.
      Parameters:
      s - a string carried the name of the border
      Returns:
      the constructed titled border
    • checkCalendar

      private Calendar checkCalendar(Calendar date)
      To check if the date is a valid date in the calendar.
      Parameters:
      date - The date to be checked.
      Returns:
      The new calendar class with correctd date.
    • checkDate

      private boolean checkDate(int year, int month, int day, boolean start)
      Checks the date to be sure the user didn't enter the start after the end.
      Parameters:
      year - year of the date to check
      month - month of the date to check
      day - day of the date to check
      start - flag that says if this is the start date or end date
      Returns:
      boolean that tells if the date checked out
    • copyOfCalendar

      private Calendar copyOfCalendar(Calendar date)
      Constructs and new class and copy the year, month, day paramenters.
      Parameters:
      date - The source Calendar class which will be copied from.
      Returns:
      The newly constructed calendar class with the same info as source.
    • endOfMonth

      private int endOfMonth(Calendar tmp)
      Calculates the last date of the month.
      Parameters:
      tmp - The calendar to be calculated.
      Returns:
      the last date of the month.
    • getDaysBefore

      private Calendar getDaysBefore(Calendar date, int num)
      Returns the new date of num days before date.
      Parameters:
      date - the date to get the days before of
      num - the number of days before
      Returns:
      the calendar with the right number of years before
    • getEndCalendar

      private Calendar getEndCalendar()
      Gets all the ending date of the patient's study from the all three comboboxes.
      Returns:
      a Calendar type stores the ending date information
    • getEndDay

      private int getEndDay()
      Gets the ending day of the study in the endDayBox combobox.
      Returns:
      integer: the ending day of the study
    • getEndMonth

      private int getEndMonth()
      Gets the ending month of the study in the endMonthBox combobox.
      Returns:
      integer: the ending month of the study
    • getEndYear

      private int getEndYear()
      Gets the ending year of the study in the endYearBox combobox.
      Returns:
      integer: the ending year of the study
    • getMonthsBefore

      private Calendar getMonthsBefore(Calendar tmp, int num)
      Returns the new date of num months before date.
      Parameters:
      tmp - the date to get the months before of
      num - the number of months before
      Returns:
      the calendar with the right number of months before
    • getPhysName

      private String getPhysName()
      Gets the physician's name from the physText field.
      Returns:
      The string that stores the physician's name.
    • getPtID

      private String getPtID()
      Gets the Patient's ID from the ptIDText field.
      Returns:
      The string that stores the patient ID.
    • getPtName

      private String getPtName()
      Gets the Patient name from the ptNameText field.
      Returns:
      The string that contained the patient's name.
    • getStartCalendar

      private Calendar getStartCalendar()
      Gets all the starting date of the patient's study from the all three comboboxes.
      Returns:
      a Calendar type stores the starting date information
    • getStartDay

      private int getStartDay()
      Gets the starting day of the study in the startDayBox combobox.
      Returns:
      integer: the starting day of the study
    • getStartMonth

      private int getStartMonth()
      Gets the starting Month of the study in the startMonthBox combobox.
      Returns:
      integer: the starting month of the study
    • getStartYear

      private int getStartYear()
      Gets the starting year of the study in the startYearBox combobox.
      Returns:
      integer: the starting year of the study
    • getStudyNo

      private String getStudyNo()
      Gets the study id from the studyNOText field.
      Returns:
      The string that stores the study number.
    • getYearsBefore

      private Calendar getYearsBefore(Calendar tmp, int num)
      Returns the new date of num years before date.
      Parameters:
      tmp - the date to get the years before of
      num - the number of years before
      Returns:
      the calendar with the right number of years before
    • itemToInteger

      private int itemToInteger(Object item)
      Converts the combo box item to its corresponding integer. Year and date - are numbers as they represented. Month - will be converted to integer, starting with 0 = January,
      Parameters:
      item - DOCUMENT ME!
      Returns:
      The appropriated integer number.
    • lastName

      private String lastName(String name)
      Finds the last name of the current patient.
      Parameters:
      name - patient's name
      Returns:
      the last name
    • makeString

      private String makeString(String[] stuff)
      Makes the .preferences string out of the array.
      Parameters:
      stuff - array to make the string from
      Returns:
      the string with the array items separated by semicolons
    • originalName

      private String originalName(String name)
      Transforms the name from the usual form to the DICOM form.
      Parameters:
      name - the usual name
      Returns:
      the DICOM version of the name
    • parseName

      private String parseName(String name)
      Transforms the name from the DICOM form to a more usual form.
      Parameters:
      name - the original name
      Returns:
      the more usual version of the name
    • sendMoveRequest

      private void sendMoveRequest(int type)
      Sends a move request at the current level, setting up the data objects appropriately. It runs the move request in its own thread.
      Parameters:
      type - type of move request: PATIENT, STUDY, SERIES, or IMAGE.
    • sendQuery

      private void sendQuery(int type)
      This method sets up the information for the DICOM query depending on the type, sends the query, and parses the information that the server sends back. On a study query, it filters out studies before the start date or after the end date.
      Parameters:
      type - type of query: PATIENT, STUDY, SERIES, or IMAGE.
    • setColumns

      private void setColumns()
      Sets the columns of the query table to certain values.
    • setEnabled

      private void setEnabled(JButton button, boolean enabled)
      Sets the specified button to enabled or disabled, depending on the boolean parameter.
      Parameters:
      button - button to set
      enabled - true is enabled, false if disabled
    • setEndCalendar

      private void setEndCalendar(Calendar date)
      Set the end calendar.
      Parameters:
      date - date to set it to
    • setEndDay

      private void setEndDay(int day)
      Sets the end day.
      Parameters:
      day - day to set it to
    • setEndMonth

      private void setEndMonth(int month)
      Sets the end month.
      Parameters:
      month - month to set it to
    • setEndYear

      private void setEndYear(int year)
      Sets the end year.
      Parameters:
      year - year to set it to
    • setGBC

      private GridBagConstraints setGBC(int x, int y, int w, int h)
      A helper method for adding a component using GridBagLayout, so we don't have to set up the x, y, width, and height over and over again.
      Parameters:
      x - GridBagConstraints.gridx
      y - GridBagConstraints.gridy
      w - GridBagContraints.gridwidth
      h - GridBagConstraints.gridheight
      Returns:
      the grid bag constraints
      See Also:
    • setStartCalendar

      private void setStartCalendar(Calendar date)
      Sets the start calender to the calendar given.
      Parameters:
      date - calendar to set it to
    • setStartDay

      private void setStartDay(int day)
      Displays the starting day in the startDayBox combobox.
      Parameters:
      day - an integer of the starting date: day
    • setStartMonth

      private void setStartMonth(int month)
      Displays the starting month in the startMonthBox combobox.
      Parameters:
      month - an integer of the starting date: month
    • setStartYear

      private void setStartYear(int year)
      Displays the starting year in the startYearBox combobox.
      Parameters:
      year - an integer of the starting date: year
    • setupComboBoxLayout

      private GridBagConstraints setupComboBoxLayout()
      Sets up the gridbag layout of the combo boxes.
      Returns:
      The gbc for the combo boxes
    • setupLabelLayout

      private GridBagConstraints setupLabelLayout()
      Sets up the gridBagLayout of the textField label.
      Returns:
      the gbc layout for label
    • setupSendFileListing

      private boolean setupSendFileListing(String dir)
      Sets ups the send file listing.
      Parameters:
      dir - the directory from which to build the listing
      Returns:
      DOCUMENT ME!
    • setupSendTab

      private void setupSendTab()
      Update Send tab to reflect any changes in hosts.
    • setupTextFieldLayout

      private GridBagConstraints setupTextFieldLayout()
      Sets up the gridbaglayout of the textField.
      Returns:
      The gbc layout for the text field.
    • sort

      private void sort(ViewTableModel model, int col, boolean reverse)
      Sorts the column of the table model. If reverse is true, sorts in reverse order.
      Parameters:
      model - table model to sort on
      col - column to sort on
      reverse - whether or not to sort in reverse order.