Class MediaImporter.MediaImporterWithFileChooserDialogThread

java.lang.Object
com.pixelmed.dicom.MediaImporter.MediaImporterWithFileChooserDialogThread
All Implemented Interfaces:
Runnable
Enclosing class:
MediaImporter

public static class MediaImporter.MediaImporterWithFileChooserDialogThread extends Object implements Runnable

A class that implements Runnable so that it can be invoked by EventQueue.invokeAndWait().

This is needed, for example, to call from a main() method, since the file chooser and logger dialogs and progress bar methods used MUST be invoked on the AWT Event Dispatch Thread.

  • Constructor Summary

    Constructors
    Constructor
    Description
    MediaImporterWithFileChooserDialogThread(Class mediaImporterClass, String mediaDirectoryPath, String loggerTitleMessage, int loggerWidth, int loggerHeight, boolean exitApplicationOnLoggerClose, Component parent, JProgressBar progressBar)
    Pop up a file chooser dialog that allows the user to specify the location of the DICOMDIR file, or the parent folder (for example, the drive or volume) in which the DICOMDIR file is located, and then import the referenced files.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run()
     

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MediaImporterWithFileChooserDialogThread

      public MediaImporterWithFileChooserDialogThread(Class mediaImporterClass, String mediaDirectoryPath, String loggerTitleMessage, int loggerWidth, int loggerHeight, boolean exitApplicationOnLoggerClose, Component parent, JProgressBar progressBar)

      Pop up a file chooser dialog that allows the user to specify the location of the DICOMDIR file, or the parent folder (for example, the drive or volume) in which the DICOMDIR file is located, and then import the referenced files.

      Will be positioned relative to the parent component (for example, centered over the component) if specified, else placed in a look-and-feel-dependent position such as the center of the screen if null.

      Will also pop up a logger dialog box, which describes the progress.

      Will update a progress bar, if one is supplied.

      Uses the specified sub-class of MediaImporter, which will have its doSomethingWithDicomFileOnMedia() method overridden to do something useful.

      Parameters:
      mediaImporterClass - the class of MediaImporter to use, which needs to support the constructor MediaImporter(String,MessageLogger,JProgressBar)
      mediaDirectoryPath - where to begin looking for the DICOMDIR and DICOM files
      loggerTitleMessage - for the title bar of the dialog box
      loggerWidth - initial width of the resizeable dialog box
      loggerHeight - initial height of the resizeable dialog box
      exitApplicationOnLoggerClose - if true, when the logger dialog box is closed (X-d out), will exit the application with success status
      parent - the parent component of the dialog; can be null
      progressBar - where to update progress as files are read (may be null for no progress bar)
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable