public static class MediaImporter.MediaImporterWithFileChooserDialogThread
extends java.lang.Object
implements java.lang.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 and Description |
---|
MediaImporterWithFileChooserDialogThread(java.lang.Class mediaImporterClass,
java.lang.String mediaDirectoryPath,
java.lang.String loggerTitleMessage,
int loggerWidth,
int loggerHeight,
boolean exitApplicationOnLoggerClose,
java.awt.Component parent,
javax.swing.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.
|
Modifier and Type | Method and Description |
---|---|
void |
run() |
public MediaImporterWithFileChooserDialogThread(java.lang.Class mediaImporterClass, java.lang.String mediaDirectoryPath, java.lang.String loggerTitleMessage, int loggerWidth, int loggerHeight, boolean exitApplicationOnLoggerClose, java.awt.Component parent, javax.swing.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.
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 filesloggerTitleMessage
- for the title bar of the dialog boxloggerWidth
- initial width of the resizeable dialog boxloggerHeight
- initial height of the resizeable dialog boxexitApplicationOnLoggerClose
- if true, when the logger dialog box is closed (X-d out), will exit the application with success statusparent
- 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)