Class ViewUserInterface
- java.lang.Object
- 
- gov.nih.mipav.view.ViewUserInterface
 
- 
- All Implemented Interfaces:
- ScriptRecordingListener,- CommandLineParser,- java.awt.event.ActionListener,- java.awt.event.KeyListener,- java.awt.event.WindowListener,- java.util.EventListener
 
 public class ViewUserInterface extends java.lang.Object implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.KeyListener, ScriptRecordingListener, CommandLineParser This class is the _glue_ keeps a record of the present structure of the application. It keeps a list of all the image frames presently being displayed and keeps a hash table of all the images (ModelImage) open in the application. In addition, this class keeps a reference to the main MIPAV frame and the message frame with much of the imaging results are output.- Version:
- 1.1 June 1, 2012
- Author:
- Justin Senseney, Matthew McAuliffe, Ph.D.
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description private classViewUserInterface.DicomQueryListenerprivate classViewUserInterface.ImageTransferHandlerHandles drag and drop events to the main mipav gui.private classViewUserInterface.MemoryUsageUpdaterprivate classViewUserInterface.OpenFileInfoStores file name and switch for multifile.
 - 
Field SummaryFields Modifier and Type Field Description protected java.util.Vector<javax.swing.JMenuBar>aloneMenuStores all stand-alone menus that have been created by the user.private javax.swing.JButtonbtnGpuCompThe button indicating that MIPAV is set to run OpenCL -- GPU based algorithmsprivate javax.swing.JButtonbtnMultiCoreThe button indicating that MIPAV is set to run in a threaded environmentprivate TransMatrixclippedMatrixMatrix for copy/paste actions in image's or between image's matrix edit panel.private java.util.Vector<java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>>clippedScannerVectorsDOCUMENT ME!private ViewVOIVectorclippedVOIsVector to hold clipped VOIs (multiple).private java.lang.StringcmdLineArgumentsString holding the command line arguments for data provenance usage.private java.util.Vector<VOIBase>copyVOIListVector to hold clipped VOIs (multiple).private java.util.Vector<java.lang.String>copyVOINameListVector to hold VOI names (multiple).private DICOM_ReceiverDICOMcatcherReference to the DICOM receiver that listens for DICOM formatted images sent by a DICOM server.private ViewJFrameDICOMQueryDICOMQueryFrameDICOM query frame for sending and receiving DICOM images.private JDialogDataProvenancedpDialogDialog to display the mipav system data provenanceprivate static java.io.FileexceptionsException logging fileprivate booleanexitCmdLineOnErrorerror handling for cmd line, if set to false will not exit on MipavUtil.displayError()private booleanforceAlgorithmInPlaceboolean to force the algorithm to replace the image rather than opening a new frameprivate java.awt.DimensionframeLocationLocation of new image frames.private java.util.Vector<java.awt.Frame>imageFrameVectorStores array of images frames the first of which is the active image frame.private CustomHashtable<ModelImage>imageHashtableA list of image models currently open in MIPAV.private ViewJFrameRegisteredImagesimgMonitorFrameFrame that monitors the registered images.private booleanisAppFrameVisibleWhether the mipav GUI should be shown; set by the -hide command line option.private booleanisPlugInFrameVisibleWhether a plugin standalone frame is visibleprivate JarClassLoaderjarClassLoaderClass/resource loader for plugins that are in jarsprivate booleanlastStackFlagIndicates the user's last choice of whether to open images as multi-file (stack) or single file in the file open dialog.private static java.lang.StringLOADING_STRString to use as the progress bar loading prefix.protected javax.swing.JFramemainFrameThe main menu bar that runs MIPAV.private JDialogMemoryAllocationmallocFrameDialog that allows changes to the amount of heap requested of the system by the java Virtual Machine for MIPAV during java start.private ViewJFrameMemorymemoryFrameDialog that displays the used and available memory.private javax.swing.JLabelmemoryUsageLabelThe label showing the current memory usage of MIPAV.private ViewUserInterface.MemoryUsageUpdatermemoryUsageUpdaterThe periodic thread which updates the memory usage display once every second.protected ViewMenuBuildermenuBuilderThe object used to build and enable/select the menus.protected javax.swing.JTextFieldmessageFieldMessage line at the bottom of the mainFrame.protected ViewJFrameMessagemessageFrameMessage area for multi-line text output.private intnumTileSheetsif user selects to open images as tiles, then this counter tells us how many tile sheets there are*private static java.lang.StringOPENING_STRString to use as the progress bar opening prefix.protected javax.swing.JMenuBaropeningMenuBarInitial menubar for MIPAV.private JDialogMipavOptionsoptionsDialogDialog that allows changes to the amount of heap requested of the system by the java Virtual Machine for MIPAV during java start.private static java.lang.StringoutputDirThis is the outputDir path that the user entered as a command line argument when running a script *private javax.swing.JMenupluginsMenuStores the plugins menu so that it can be removed/updated when plugins are installed.private java.lang.StringprogressBarPrefixThe current progress bar prefix to use.private static booleanprovidedOutputDirThis boolean tells if the user has provided an ouputDir parameter as a command line argument when running a scriptprivate static booleanprovidedUserDefaultDirThis boolean tells if the user has provided an inputDir parameter as a command line argument when running a scriptprivate static JDialogShortcutEditorshortcutEdKey shortcut editor dialog.private booleanshortcutRecordingIndicates whether the user is currently recording a new keyboard shortcut using the shortcut editor dialog.private ProvenanceHoldersystemDPHolderSystem DP holder (separate from images data provenance...this has everything).private static java.util.Vector<java.lang.String>tempDirListprivate static java.lang.StringuserDefaultDirThis is the inputDir path that the user entered as a command line argument when running a script *protected static ViewUserInterfaceuserInterfaceReferenceA reference to the only ViewUserInterface object in MIPAV.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedViewUserInterface()Constructs main UI frame.protectedViewUserInterface(boolean forceQuiet)Constructs main UI frame.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidabout()Creates simple dialog that describes basic info about MIPAV, with MIPAV as the title.voidabout(java.lang.String title, java.lang.String filename)Creates a fairly simple plain-text viewing box.voidaboutDataProvenance()Displays the system data provenance using a simple dialog with table and jtextarea (for current selection).voidaboutJava()Creates simple dialog that describes basic info about the version of Java.voidactionPerformed(java.awt.event.ActionEvent event)Calls various methods based on the user's actions.booleanaddAloneMenu(javax.swing.JMenuBar menu)Adds a standalone menu to the user interface.private voidaddPluginToMenu(java.lang.Class<?> plugin, java.lang.String pluginName, java.lang.String name, javax.swing.JMenu currentMenu, java.awt.event.ActionListener al, java.lang.String jarContainer)static voidaddToTempDirList(java.lang.String path)voidbuildAnonDirectoryDialog()Builds the anonymize directory dialog and displays it.JDialogDicomDirbuildDICOMDIRFrame()Builds the image tree dialog and displays it.ViewJFrameDICOMParserbuildDICOMFrame()Builds the image tree dialog and displays it.voidbuildEditDICOMFrame()Builds the edit dicom tag interface.javax.swing.JMenuBarbuildMenu()Builds menus for the User Interface.ViewJFrameMessagebuildMessageFrame()Builds the message frame where user/program data can be displayed.javax.swing.JMenubuildPlugInsMenu(java.awt.event.ActionListener al)Called by either userInterface (this) or by another actionlistener (ViewJFrameImage) to build the plugins menu bar.voidbuildTreeDialog()Builds the image tree dialog and displays it.voidchangeRecordingStatus(int recorderStatus)Alerts the listener to a change in whether the ScriptRecorder is currently recording a script.private voidcheckHeapMaxAgainstPreferences()Test for VM memory sizes being the same as last run in preferences: displays a user-warning that the preferences & VM config files disagree and presents the JDialogMemoryAllocation dialog with "use preference" buttons to quicken the matching process.static voidcheckPrefDirCommand(java.lang.String[] args, int initArg)If the preferences name command is about to be performed before an existing preferences directory command, this guarantees that the directory command will be executed first.voidcleanupAndExit()voidclearAllDataText()Accessor to clear all of data frame.voidclearClippedVOIs()Deprecated.voidcloseAllImages()this method closes all registered imagesvoidcopyClippedVOIs(ViewVOIVector copyList)Deprecated.voidcopyVOIs(java.util.Vector<VOIBase> copyList)static ViewUserInterfacecreate()This method should only be called once, and it should only be called by MipavMain to during the initialization of MIPAV.ModelImagecreateBlankImage(FileInfoBase fileInfo)Creates a blank Image based on the information found in the fileInfo object and places it in a frame.ModelImagecreateBlankImage(FileInfoBase fileInfo, boolean doDisplay, boolean allowRecording)Creates a blank Image based on the information found in the fileInfo object.ModelImagecreateEmptyImage(FileInfoBase fileInfo)Creates a blank Image based on the information found in the default fileInfo object.private voiddeleteItem(java.lang.String name, boolean deleteFrame, boolean runGC)Deletes the item specified by name.private voiddeleteMenu(javax.swing.JMenu menu)Recursive deletion algorithm to delete JMenus which contain no JMenuItems exclusive of JMenus in any children.booleandoExitCmdLineOnError()Tells whether or not to exit on an error when running from the command linebooleandoForceInPlace()Checks whether the dialog should force the algorithm to replace the image (no new frame)voidenableOutputWindow(boolean doShowFrame)Toggles the display of the Output window and updates all JFrameImages so that the menu checkbox will reflect the status of the output window.static java.lang.StringgenerateCmdUsageInfo()Generates automatic list of available commands.ViewJFrameImagegetActiveImageFrame()Accessor that returns the active image frame vector.java.lang.StringgetAppTitle()Accessor to get the title of this application.TransMatrixgetClippedMatrix()Retrieves the clipped matrix for paste action.java.util.Vector<java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>>getClippedScannerVectors()Deprecated.ViewVOIVectorgetClippedVOIs()Deprecated.java.lang.StringgetCmdLineArguments()Returns the Command line arguments (as one string, each separated by a space) .java.util.Vector<java.lang.String>getCopyVOINames()java.util.Vector<VOIBase>getCopyVOIs()java.lang.StringgetDefaultDirectory()Accessor to get directory location of last file access.java.lang.StringgetDefaultScriptDirectory()Accessor to get directory location of script files.DICOM_ReceivergetDICOMCatcher()Accessor to get the DICOM receiver.ViewJFrameDICOMQuerygetDICOMQueryFrame()Accessor to get the DICOM query frame.static java.util.Vector<java.lang.Class<ActionDiscovery>>getDiscoverableActionList()static java.util.Vector<java.lang.Class<ActionDiscovery>>getDiscoverableActionList(java.lang.String baseDir)static java.io.FilegetExceptions()ViewJFrameImagegetFrameContainingImage(ModelImage image)Accessor that returns the active image frame vector.java.util.Vector<java.awt.Frame>getImageFrameVector()Accessor that returns frame vector.JarClassLoadergetJarClassLoader()java.lang.StringgetLastScript()Returns the last script file used from the preferences.booleangetLastStackFlag()Gets the last checkbox entry for "multi-file" for opening images.javax.swing.JFramegetMainFrame()Accessor that returns the main user interface frame.ViewMenuBuildergetMenuBuilder()Returns the interface's menu builder.ViewJFrameMessagegetMessageFrame()Accessor that returns the message frame.java.lang.StringgetMessageText()Accessor to get text of message field.java.awt.DimensiongetNewFrameLocation(int newImageXDim, int newImageYDim)Changes location of image when first displayed.java.awt.DimensiongetNewFrameYLocation()Changes vertical location of image when first displayed.static java.lang.StringgetOutputDir()java.lang.StringgetProgressBarPrefix()Gets the string "Opening " or "Loading " based on what the progress bar should be displaying.ProvenanceHoldergetProvenanceHolder()Accessor for the mipav's data provenance .static ViewUserInterfacegetReference()Get a reference to the ViewUserInterface object.intgetRegisteredFramedImagesNum()Return an num of images with frames(elements) from the image hashtable.ModelImagegetRegisteredImageByName(java.lang.String name)Return a registered image from the image hashtable based on the name of the image.java.util.Enumeration<java.lang.String>getRegisteredImageNames()Return an enumeration of keys (image names) from the image hashtable.java.util.Enumeration<ModelImage>getRegisteredImages()Return an enumeration of images (elements) from the image hashtable.intgetRegisteredImagesNum()Return an num of images (elements) from the image hashtable.static java.io.FilegetSecondaryPluginsDir()static java.lang.StringgetUserDefaultDir()voidimageRegistryMonitoring()Display image registry frame.voidimagesToFront()Brings all images and message frame to the front.protected javax.swing.JPanelinitCreateMemoryUsagePanel()Construct the panel which displays the current memory usage/limit and a garbage collection button.protected voidinitCreateMessageBar()Create the panel containing components which show the application title initially, and will later be used to show image coordinates and intensities.protected javax.swing.JTextFieldinitCreateMessageField(java.lang.String title)Creates the message field for the main frame using the title given.protected javax.swing.JPanelinitCreateMultiCoreGpuIndicatorPanel()Construct the panel which displays whether the CPU and GPU could be utilized by algorithms based on the preferences settings by the user.protected voidinitDicomReceiver()Starts the DICOM receiver if the flag in the preference file istrue.voidinitializeGui()Initializes the user interface.protected voidinitMacintoshJDKversionCheck()Method checks to verify that when running on a Machintosh, the JDK version is at least 1x2e;4.protected voidinitPrefsFile()Set the preferences file to use (Preferences defaults to mipav.preferences).protected voidinitPrefsTrim()Gets the TRIM_VOI, TRIM_MASK and TRIM_FLAG values from the preferences file, and if it cannot find them, it sets to some default value: TRIM_VOI will be 0.3, TRIM_MASK will be 0.0, and TRIM_FLAG will be true.protected voidinitSetMainFrameDefaults(java.awt.LayoutManager prefLayout, boolean resize)Sets the layout of the Main Frame with the given, preferred layout manager; makes the main frame resizable as given; makes this class a window-listener; sets the default operation to do nothing on close; and the icon is set.protected voidinitSetTitles(java.lang.String mainFrameTitle, java.lang.String appTitle)Sets the titles for for the main frame and the application using the strings given.protected voidinitUsingPreferences()Performs a variety of start-up operations based on user-preferences; First, it tries to read from the preferences file; if it cannot, it sets the user directory.booleanisAppFrameVisible()Accessor to check whether the application frame visible or not.booleanisImageHashtableEmpty()Indicates if the image hashtable is empty.booleanisImageRegistered(java.lang.String imageName)Indicates if the image name is found in the hashtable.booleanisPlugInFrameVisible()Accessor to see if a stand-alone plugin frame is visible (not app frame)static booleanisProvidedOutputDir()This is the getter for providedOutputDir providedOutputDir: This boolean tells if the user has provided an ouputDir parameter as a command line argument when running a scriptstatic booleanisProvidedUserDefaultDir()booleanisShorcutRecording()Determines if the UserInterface is currently recording an action command as a shortcut.voidkeyPressed(java.awt.event.KeyEvent e)Pass the key event to the selected image frame (if one exists).voidkeyReleased(java.awt.event.KeyEvent e)Pass the key event to the selected image frame (if one exists).voidkeyTyped(java.awt.event.KeyEvent e)Pass the key event to the selected image frame (if one exists).private voidloadMouseDrivers()voidmemoryAllocation()Display memory allocation frame (request more from the JVM on next JVM-start).voidmemoryFrame()Display memory usage frame.voidopenImageFrame()This method opens an image and puts it into a frame.voidopenImageFrame(java.lang.String imageFile)Open an image and put it into a new frame, given the image file name.voidopenImageFrame(java.lang.String imageFile, boolean multiFile)Open an image or images and put it into a new frame, given the image file name.voidopenImageFrame(java.lang.String imageFileName, java.lang.String imageFileDir)Open an image and put it into a new frame, given the image file name.voidopenJSONImageFrames()voidopenLastImage(int index)Attempts to open an image from the quicklist.voidoptions()Display Options dialog for all mipav options (including image specific options) to allow user to adjust display in one place.intparseArguments(java.lang.String[] args, int initArg)Required by the CommandLineParser interface.static intparseStaticArguments(java.lang.String[] args, int initArg)Required by the CommandLineParser interface.static voidprintUsageAndExit()Displays command line help information on usage of all commands and then exits.static voidprintUsageAndExit(Argument c)Displays command line help information on usage to standard out and then into an informational dialog box then exits the MIPAV application.voidregFrame(java.awt.Frame frame)Method that registers an image frame by putting it in the image frame vector and does NOT loads controls.voidregisterFrame(java.awt.Frame frame)Method that registers an image frame by adding it to the vector and loads controls.java.lang.StringregisterImage(ModelImage image)Register image model by adding it to the image hashtable.java.lang.StringregisterImage(java.lang.String key, ModelImage image)Register image model by adding it to the image hashtable.booleanremoveAloneMenu(javax.swing.JMenuBar menu)Removes the stand-alone menu from the user interface.protected voidrunCmdLine(java.lang.String scriptFile, java.util.Vector<ViewUserInterface.OpenFileInfo> imageList, java.util.Vector<java.util.Vector<java.lang.String>> voiList)This method is used when running MIPAV from the command line.voidsetActiveFrame(java.awt.Frame frame)Method sets the parameter frame to top and active.voidsetAppFrameVisible(boolean isVisible)Tells the application to show the MIPAV UI or suppress it (progress bars, image frames, etc).voidsetClippedMatrix(TransMatrix tMat)Sets the clipped matrix for copy/paste actions.voidsetControls()Sets the menu for the main frame.voidsetDataText(java.lang.String str)Accessor to set text of data FRAME.voidsetDefaultDirectory(java.lang.String defaultDirectory)Sets directory location of last file access.voidsetDefaultScriptDirectory(java.lang.String dir)Sets directory location of the script files.voidsetDICOMCatcher(DICOM_Receiver rcv)Accessor to set the DICOM receiver.voidsetDICOMQueryFrame(ViewJFrameDICOMQuery frame)Accessor to set the DICOM query frame.voidsetExitCmdLineOnError(boolean doExit)Sets MIPAV to exit (true) or not (false) on an error when running from the command linevoidsetForceInPlace(boolean doForce)Sets the dialogs to only replace the image (no new frame)voidsetGlobalDataText(java.lang.String str)Accessor to set text of global data FRAME.voidsetJarClassLoader(JarClassLoader jarClassLoader)voidsetLastScript(java.lang.String script)Sets last used script files in preferences.voidsetLastStackFlag(boolean lastStackFlag)Sets the last value for opened multi-files (or single).voidsetLoad(boolean doLoad)Tells the progress bar to say "Loading" rather than "Opening" for images being loaded if true.private voidsetMenuActionListeners(java.awt.Component comp, java.awt.event.ActionListener frame)voidsetMessageText(java.lang.String str)Accessor to set text of message field.static voidsetOutputDir(java.lang.String outputDir)voidsetPlugInFrameVisible(boolean isVisible)Tells the UI that a standalone plugin frame is visiblestatic voidsetProvidedOutputDir(boolean providedOutputDir)static voidsetProvidedUserDefaultDir(boolean providedUserDefaultDir)static voidsetSecondaryPluginsDir(java.io.File secondaryPluginsDir)voidsetShortcutRecording(boolean doRecord)Sets the UI to either be/not be recording action command.voidsetTitle(java.lang.String str)Gets the application title from the preference file and prepends to the string passed into the method and displays the resultant string in the title of the main frame.static voidsetUserDefaultDir(java.lang.String userDefaultDir)voidsetUseVOIName(boolean useName)Sets the Preference to use VOI Names instead of labels, then updates all frames to reflect this change with their VOIs.voidsetVisible(boolean visible)Change whether the GUI should be visible.voidshowLicense()Displays the MIPAV Software Transfer Agreement in a JDialogText window.voidshowLicense(java.lang.String title, java.lang.String filename)Displays the MIPAV Software Transfer Agreement in a JDialogText window.voidshowShortcutEditor(boolean doUpdate)Opens a dialog for viewing/modifying shortcuts.voidshowSplashGraphics()Shows the MIPAV splash screen for a few seconds, or until the user clicks it.voidunregisterFrame(java.awt.Frame frame)Method that unregisters an image frame by removing it from the image frame vector.voidunregisterFrame(java.awt.Frame frame, boolean closeAll)Method that unregisters an image frame by removing it from the image frame vector.voidunRegisterImage(ModelImage image)Unregister image model by removing it from the image hashtable.voidunRegisterImage(java.lang.String imageKey)Unregister image model by removing it from the image hashtable given the key to the hashtable.voidupdateGpuUsage()This method updates the "whether algorithms will use the GPU" when the relevant button has been pushed in either the preferences pane.voidupdateMemoryUsage()This method is a callback method.voidupdateMultiCoreUsage()This method updates the "whether multi-core should be used" button when the relevant button has been pushed in either the preferences pane.voidupdateScript(java.lang.String newScriptText)Do nothing - required by ScriptRecordingListener interface.voidwindowActivated(java.awt.event.WindowEvent event)Do nothing.voidwindowClosed(java.awt.event.WindowEvent event)Do nothing.voidwindowClosing(java.awt.event.WindowEvent event)Confirms if the user really wants to exit, then closes the application.voidwindowDeactivated(java.awt.event.WindowEvent event)Do nothing.voidwindowDeiconified(java.awt.event.WindowEvent event)Deiconify only the other frames who's last state was normal (ie- restore other frames to their lastState).voidwindowIconified(java.awt.event.WindowEvent event)Iconify all other frames associateed with MIPAV.voidwindowOpened(java.awt.event.WindowEvent event)Do nothing.voidwriteDataProvenance()Writes Mipav's data provenance to the default location.
 
- 
- 
- 
Field Detail- 
userInterfaceReferenceprotected static ViewUserInterface userInterfaceReference A reference to the only ViewUserInterface object in MIPAV.- See Also:
- ViewUserInterface(),- getReference()
 
 - 
OPENING_STRprivate static final java.lang.String OPENING_STR String to use as the progress bar opening prefix.- See Also:
- Constant Field Values
 
 - 
LOADING_STRprivate static final java.lang.String LOADING_STR String to use as the progress bar loading prefix.- See Also:
- Constant Field Values
 
 - 
shortcutEdprivate static JDialogShortcutEditor shortcutEd Key shortcut editor dialog.
 - 
providedUserDefaultDirprivate static boolean providedUserDefaultDir This boolean tells if the user has provided an inputDir parameter as a command line argument when running a script
 - 
userDefaultDirprivate static java.lang.String userDefaultDir This is the inputDir path that the user entered as a command line argument when running a script *
 - 
providedOutputDirprivate static boolean providedOutputDir This boolean tells if the user has provided an ouputDir parameter as a command line argument when running a script
 - 
outputDirprivate static java.lang.String outputDir This is the outputDir path that the user entered as a command line argument when running a script *
 - 
mainFrameprotected javax.swing.JFrame mainFrame The main menu bar that runs MIPAV.
 - 
menuBuilderprotected ViewMenuBuilder menuBuilder The object used to build and enable/select the menus.
 - 
messageFieldprotected javax.swing.JTextField messageField Message line at the bottom of the mainFrame.
 - 
messageFrameprotected ViewJFrameMessage messageFrame Message area for multi-line text output. The message area has the ability to save/copy/paste the data to a file or clip board. This frame contains the Global Data, Data, Logging and Debug text areas. The Global and Debug text areas are common to all images (i.e. there is only one). The Data and logging window are unique and associated to their respect image.
 - 
openingMenuBarprotected javax.swing.JMenuBar openingMenuBar Initial menubar for MIPAV.
 - 
clippedMatrixprivate TransMatrix clippedMatrix Matrix for copy/paste actions in image's or between image's matrix edit panel.
 - 
clippedScannerVectorsprivate final java.util.Vector<java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>> clippedScannerVectors DOCUMENT ME!
 - 
clippedVOIsprivate final ViewVOIVector clippedVOIs Vector to hold clipped VOIs (multiple).
 - 
copyVOIListprivate java.util.Vector<VOIBase> copyVOIList Vector to hold clipped VOIs (multiple).
 - 
copyVOINameListprivate final java.util.Vector<java.lang.String> copyVOINameList Vector to hold VOI names (multiple).
 - 
jarClassLoaderprivate JarClassLoader jarClassLoader Class/resource loader for plugins that are in jars
 - 
cmdLineArgumentsprivate java.lang.String cmdLineArguments String holding the command line arguments for data provenance usage.
 - 
DICOMcatcherprivate DICOM_Receiver DICOMcatcher Reference to the DICOM receiver that listens for DICOM formatted images sent by a DICOM server.
 - 
DICOMQueryFrameprivate ViewJFrameDICOMQuery DICOMQueryFrame DICOM query frame for sending and receiving DICOM images.
 - 
frameLocationprivate final java.awt.Dimension frameLocation Location of new image frames. This location is updated with each additional image opened.- See Also:
- #getNewFrameLocation()
 
 - 
imageFrameVectorprivate final java.util.Vector<java.awt.Frame> imageFrameVector Stores array of images frames the first of which is the active image frame.
 - 
imageHashtableprivate final CustomHashtable<ModelImage> imageHashtable A list of image models currently open in MIPAV.
 - 
imgMonitorFrameprivate ViewJFrameRegisteredImages imgMonitorFrame Frame that monitors the registered images.
 - 
isAppFrameVisibleprivate boolean isAppFrameVisible Whether the mipav GUI should be shown; set by the -hide command line option.
 - 
isPlugInFrameVisibleprivate boolean isPlugInFrameVisible Whether a plugin standalone frame is visible
 - 
lastStackFlagprivate boolean lastStackFlag Indicates the user's last choice of whether to open images as multi-file (stack) or single file in the file open dialog.
 - 
mallocFrameprivate JDialogMemoryAllocation mallocFrame Dialog that allows changes to the amount of heap requested of the system by the java Virtual Machine for MIPAV during java start.
 - 
memoryFrameprivate ViewJFrameMemory memoryFrame Dialog that displays the used and available memory.
 - 
dpDialogprivate JDialogDataProvenance dpDialog Dialog to display the mipav system data provenance
 - 
memoryUsageLabelprivate javax.swing.JLabel memoryUsageLabel The label showing the current memory usage of MIPAV.
 - 
btnMultiCoreprivate javax.swing.JButton btnMultiCore The button indicating that MIPAV is set to run in a threaded environment
 - 
btnGpuCompprivate javax.swing.JButton btnGpuComp The button indicating that MIPAV is set to run OpenCL -- GPU based algorithms
 - 
memoryUsageUpdaterprivate ViewUserInterface.MemoryUsageUpdater memoryUsageUpdater The periodic thread which updates the memory usage display once every second.- See Also:
- updateMemoryUsage()
 
 - 
optionsDialogprivate JDialogMipavOptions optionsDialog Dialog that allows changes to the amount of heap requested of the system by the java Virtual Machine for MIPAV during java start.
 - 
pluginsMenuprivate javax.swing.JMenu pluginsMenu Stores the plugins menu so that it can be removed/updated when plugins are installed.
 - 
aloneMenuprotected java.util.Vector<javax.swing.JMenuBar> aloneMenu Stores all stand-alone menus that have been created by the user.
 - 
progressBarPrefixprivate java.lang.String progressBarPrefix The current progress bar prefix to use.
 - 
shortcutRecordingprivate boolean shortcutRecording Indicates whether the user is currently recording a new keyboard shortcut using the shortcut editor dialog.
 - 
systemDPHolderprivate ProvenanceHolder systemDPHolder System DP holder (separate from images data provenance...this has everything).
 - 
forceAlgorithmInPlaceprivate boolean forceAlgorithmInPlace boolean to force the algorithm to replace the image rather than opening a new frame
 - 
exitCmdLineOnErrorprivate boolean exitCmdLineOnError error handling for cmd line, if set to false will not exit on MipavUtil.displayError()
 - 
numTileSheetsprivate int numTileSheets if user selects to open images as tiles, then this counter tells us how many tile sheets there are*
 - 
exceptionsprivate static java.io.File exceptions Exception logging file
 - 
tempDirListprivate static java.util.Vector<java.lang.String> tempDirList 
 
- 
 - 
Constructor Detail- 
ViewUserInterfaceprotected ViewUserInterface() Constructs main UI frame. Accesses the .preferences file to set up variables. Sets up DICOM hashtable for reading in DICOM files and starts the catcher, if appropriate. This method cannot be called directly. To use this constructor, you must call createReference. This class is a singleton, which means that only one type of this class is allowed to be instantiated in a single VM.
 - 
ViewUserInterfaceprotected ViewUserInterface(boolean forceQuiet) Constructs main UI frame. Accesses the .preferences file to set up variables. Sets up DICOM hashtable for reading in DICOM files and starts the catcher, if appropriate. This method cannot be called directly. To use this constructor, you must call createReference. This class is a singleton, which means that only one type of this class is allowed to be instantiated in a single VM.- Parameters:
- forceQuiet- Mipav will not display any error, warning, or info messages. If a error displays MIPAV will exit.
 
 
- 
 - 
Method Detail- 
createpublic static ViewUserInterface create() This method should only be called once, and it should only be called by MipavMain to during the initialization of MIPAV.- Returns:
- ViewUserInterface
 
 - 
getReferencepublic static ViewUserInterface getReference() Get a reference to the ViewUserInterface object.- Returns:
- ViewUserInterface
 
 - 
aboutpublic void about() Creates simple dialog that describes basic info about MIPAV, with MIPAV as the title.
 - 
aboutpublic void about(java.lang.String title, java.lang.String filename)Creates a fairly simple plain-text viewing box.- Parameters:
- title- the title for the about frame.
- filename- the filename of the about file to display.
 
 - 
aboutDataProvenancepublic void aboutDataProvenance() Displays the system data provenance using a simple dialog with table and jtextarea (for current selection).. 
 - 
aboutJavapublic void aboutJava() Creates simple dialog that describes basic info about the version of Java.
 - 
addAloneMenupublic boolean addAloneMenu(javax.swing.JMenuBar menu) Adds a standalone menu to the user interface.- Parameters:
- menu- the standalone JMenu
- Returns:
- whether addition to the vector was successful
 
 - 
actionPerformedpublic void actionPerformed(java.awt.event.ActionEvent event) Calls various methods based on the user's actions.- Specified by:
- actionPerformedin interface- java.awt.event.ActionListener
- Parameters:
- event- Event that triggered this function.
 
 - 
createEmptyImagepublic ModelImage createEmptyImage(FileInfoBase fileInfo) Creates a blank Image based on the information found in the default fileInfo object.- Parameters:
- fileInfo- This object contains the enough image information to build a ModelImage with nothing inside (eg. blank image).
- image- Created blank image.
 
 - 
copyClippedVOIs@Deprecated public void copyClippedVOIs(ViewVOIVector copyList) Deprecated.Copies into the VOI clipboard.- Parameters:
- voi- VOI
 
 - 
copyVOIspublic void copyVOIs(java.util.Vector<VOIBase> copyList) 
 - 
buildAnonDirectoryDialogpublic void buildAnonDirectoryDialog() Builds the anonymize directory dialog and displays it.
 - 
buildDICOMFramepublic ViewJFrameDICOMParser buildDICOMFrame() Builds the image tree dialog and displays it.
 - 
buildEditDICOMFramepublic void buildEditDICOMFrame() Builds the edit dicom tag interface.
 - 
buildDICOMDIRFramepublic JDialogDicomDir buildDICOMDIRFrame() Builds the image tree dialog and displays it.
 - 
buildMenupublic javax.swing.JMenuBar buildMenu() Builds menus for the User Interface.
 - 
buildMessageFramepublic ViewJFrameMessage buildMessageFrame() Builds the message frame where user/program data can be displayed.
 - 
buildPlugInsMenupublic javax.swing.JMenu buildPlugInsMenu(java.awt.event.ActionListener al) Called by either userInterface (this) or by another actionlistener (ViewJFrameImage) to build the plugins menu bar.- Parameters:
- al- the listener that wants to know about actions on the plugins menu
- Returns:
- the new plugin menu
 
 - 
addPluginToMenuprivate void addPluginToMenu(java.lang.Class<?> plugin, java.lang.String pluginName, java.lang.String name, javax.swing.JMenu currentMenu, java.awt.event.ActionListener al, java.lang.String jarContainer)
 - 
deleteMenuprivate void deleteMenu(javax.swing.JMenu menu) Recursive deletion algorithm to delete JMenus which contain no JMenuItems exclusive of JMenus in any children.- Parameters:
- menu- The menu to run through deletion
 
 - 
loadMouseDriversprivate void loadMouseDrivers() 
 - 
buildTreeDialogpublic void buildTreeDialog() Builds the image tree dialog and displays it.
 - 
changeRecordingStatuspublic void changeRecordingStatus(int recorderStatus) Alerts the listener to a change in whether the ScriptRecorder is currently recording a script..*- Specified by:
- changeRecordingStatusin interface- ScriptRecordingListener
- Parameters:
- recorderStatus- DOCUMENT ME!
 
 - 
clearAllDataTextpublic final void clearAllDataText() Accessor to clear all of data frame.
 - 
clearClippedVOIs@Deprecated public void clearClippedVOIs() Deprecated.DOCUMENT ME!
 - 
createBlankImagepublic ModelImage createBlankImage(FileInfoBase fileInfo) Creates a blank Image based on the information found in the fileInfo object and places it in a frame.- Parameters:
- fileInfo- This object contains the enough image information to build a ModelImage with nothing inside (eg. blank image).
 
 - 
createBlankImagepublic ModelImage createBlankImage(FileInfoBase fileInfo, boolean doDisplay, boolean allowRecording) Creates a blank Image based on the information found in the fileInfo object.- Parameters:
- fileInfo- This object contains the enough image information to build a ModelImage with nothing inside (eg. blank image).
- doDisplay-
- allowRecording-
 
 - 
enableOutputWindowpublic void enableOutputWindow(boolean doShowFrame) Toggles the display of the Output window and updates all JFrameImages so that the menu checkbox will reflect the status of the output window.- Parameters:
- doShowFrame- Whether the output window should be shown.
 
 - 
getActiveImageFramepublic ViewJFrameImage getActiveImageFrame() Accessor that returns the active image frame vector. If the top frame is not an image frame, then the frame vector is iterated until an image frame is found. If none is found then null is returned.- Returns:
- The vector that has a list of frames visible in the GUI.
 
 - 
getAppTitlepublic java.lang.String getAppTitle() Accessor to get the title of this application.- Returns:
- The title of this application.
 
 - 
getClippedMatrixpublic TransMatrix getClippedMatrix() Retrieves the clipped matrix for paste action.- Returns:
- clippedMatrix
 
 - 
getClippedScannerVectors@Deprecated public java.util.Vector<java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>> getClippedScannerVectors() Deprecated.DOCUMENT ME!- Returns:
- DOCUMENT ME!
 
 - 
getClippedVOIs@Deprecated public ViewVOIVector getClippedVOIs() Deprecated.Returns the VOIs copied into the clip board. For copying and pasting VOIs between images.- Returns:
- Vector
 
 - 
getCopyVOIspublic java.util.Vector<VOIBase> getCopyVOIs() 
 - 
getCopyVOINamespublic java.util.Vector<java.lang.String> getCopyVOINames() 
 - 
getCmdLineArgumentspublic java.lang.String getCmdLineArguments() Returns the Command line arguments (as one string, each separated by a space) .@return command line arguments concatenated with spaces- Returns:
- DOCUMENT ME!
 
 - 
getDefaultDirectorypublic java.lang.String getDefaultDirectory() Accessor to get directory location of last file access.- Returns:
- The last file directory
 
 - 
getDefaultScriptDirectorypublic java.lang.String getDefaultScriptDirectory() Accessor to get directory location of script files.- Returns:
- The script file directory
 
 - 
getDICOMCatcherpublic DICOM_Receiver getDICOMCatcher() Accessor to get the DICOM receiver.- Returns:
- the DICOM receiver
 
 - 
getDICOMQueryFramepublic ViewJFrameDICOMQuery getDICOMQueryFrame() Accessor to get the DICOM query frame.- Returns:
- The DICOM query frame.
 
 - 
getFrameContainingImagepublic ViewJFrameImage getFrameContainingImage(ModelImage image) Accessor that returns the active image frame vector. If the top frame is not an image frame, then the frame vector is iterated until an image frame is found. If none is found then null is returned.- Parameters:
- image- the image to find the frame for.
- Returns:
- The vector that has a list of frames visible in the GUI.
 
 - 
getImageFrameVectorpublic java.util.Vector<java.awt.Frame> getImageFrameVector() Accessor that returns frame vector.- Returns:
- The vector that has a list of frames visible in the GUI.
 
 - 
getJarClassLoaderpublic JarClassLoader getJarClassLoader() 
 - 
getLastScriptpublic java.lang.String getLastScript() Returns the last script file used from the preferences.- Returns:
- LastScript
 
 - 
getLastStackFlagpublic boolean getLastStackFlag() Gets the last checkbox entry for "multi-file" for opening images.- Returns:
- boolean
 
 - 
getMainFramepublic javax.swing.JFrame getMainFrame() Accessor that returns the main user interface frame.- Returns:
- The main user interface frame.
 
 - 
getMenuBuilderpublic ViewMenuBuilder getMenuBuilder() Returns the interface's menu builder.
 - 
getMessageFramepublic ViewJFrameMessage getMessageFrame() Accessor that returns the message frame.- Returns:
- The message frame.
 
 - 
getMessageTextpublic java.lang.String getMessageText() Accessor to get text of message field.
 - 
getNewFrameLocationpublic java.awt.Dimension getNewFrameLocation(int newImageXDim, int newImageYDim)Changes location of image when first displayed.- Returns:
- The new location.
 
 - 
getNewFrameYLocationpublic java.awt.Dimension getNewFrameYLocation() Changes vertical location of image when first displayed.- Returns:
- The new location.
 
 - 
getProgressBarPrefixpublic java.lang.String getProgressBarPrefix() Gets the string "Opening " or "Loading " based on what the progress bar should be displaying.- Returns:
- String OPENING_STR or LOADING_STR
 
 - 
getProvenanceHolderpublic ProvenanceHolder getProvenanceHolder() Accessor for the mipav's data provenance .@return mipav's data provenance holder- Returns:
- DOCUMENT ME!
 
 - 
getRegisteredFramedImagesNumpublic int getRegisteredFramedImagesNum() Return an num of images with frames(elements) from the image hashtable.- Returns:
- images number
- See Also:
- CustomHashtable
 
 - 
getRegisteredImageByNamepublic ModelImage getRegisteredImageByName(java.lang.String name) Return a registered image from the image hashtable based on the name of the image. This works as long as the image was registered and the name is unique.- Parameters:
- name- The name of the image to be retrieved.
- Returns:
- the ImageModel associated with this name.
- Throws:
- java.lang.IllegalArgumentException- if the name is not in the image hastable.
- See Also:
- CustomHashtable
 
 - 
getRegisteredImageNamespublic java.util.Enumeration<java.lang.String> getRegisteredImageNames() Return an enumeration of keys (image names) from the image hashtable.- Returns:
- An Enumeration containing the keys (image names).
- See Also:
- CustomHashtable
 
 - 
getRegisteredImagespublic java.util.Enumeration<ModelImage> getRegisteredImages() Return an enumeration of images (elements) from the image hashtable.- Returns:
- An Enumeration containing the elements (images).
- See Also:
- CustomHashtable
 
 - 
getRegisteredImagesNumpublic int getRegisteredImagesNum() Return an num of images (elements) from the image hashtable.- Returns:
- images number
- See Also:
- CustomHashtable
 
 - 
imageRegistryMonitoringpublic void imageRegistryMonitoring() Display image registry frame.
 - 
imagesToFrontpublic void imagesToFront() Brings all images and message frame to the front.
 - 
initializeGuipublic void initializeGui() Initializes the user interface. Starts by reading out some starting options out of the preferences file; setting up the main frame; building the message frame and setting the message frame into the preferences; building the menu; setting controls; initialising the DICOM dictionary; setting up the message field that is used in the main frame; setting the application titles; and showing the main frame.Recommendations for how to most easily perform modifications to the initialisation procedure are included with the individual method comments, although in most cases, it suffices to simply over-ride an individual method. 
 - 
isAppFrameVisiblepublic boolean isAppFrameVisible() Accessor to check whether the application frame visible or not.- Returns:
- isAppFrameVisible application frame visibility flag
 
 - 
isImageHashtableEmptypublic boolean isImageHashtableEmpty() Indicates if the image hashtable is empty.- Returns:
- A boolean showing state of hashtable.
- See Also:
- CustomHashtable
 
 - 
isImageRegisteredpublic boolean isImageRegistered(java.lang.String imageName) Indicates if the image name is found in the hashtable.- Parameters:
- imageName- the image name (key).
- Returns:
- A boolean indicating that image name.
- See Also:
- CustomHashtable
 
 - 
isPlugInFrameVisiblepublic boolean isPlugInFrameVisible() Accessor to see if a stand-alone plugin frame is visible (not app frame)- Returns:
 
 - 
isShorcutRecordingpublic boolean isShorcutRecording() Determines if the UserInterface is currently recording an action command as a shortcut.- Returns:
- boolean is it recording
 
 - 
setAppFrameVisiblepublic void setAppFrameVisible(boolean isVisible) Tells the application to show the MIPAV UI or suppress it (progress bars, image frames, etc).- Parameters:
- isVisible- Set to false to hide the MIPAV UI.
 
 - 
setPlugInFrameVisiblepublic void setPlugInFrameVisible(boolean isVisible) Tells the UI that a standalone plugin frame is visible- Parameters:
- isVisible- is the plugin frame visible
 
 - 
keyPressedpublic void keyPressed(java.awt.event.KeyEvent e) Pass the key event to the selected image frame (if one exists). If not, check the shortcut table and attempt to handle it here.- Specified by:
- keyPressedin interface- java.awt.event.KeyListener
- Parameters:
- e- a key event generated by the user
 
 - 
keyReleasedpublic void keyReleased(java.awt.event.KeyEvent e) Pass the key event to the selected image frame (if one exists).- Specified by:
- keyReleasedin interface- java.awt.event.KeyListener
- Parameters:
- e- a key event generated by the user
 
 - 
keyTypedpublic void keyTyped(java.awt.event.KeyEvent e) Pass the key event to the selected image frame (if one exists).- Specified by:
- keyTypedin interface- java.awt.event.KeyListener
- Parameters:
- e- a key event generated by the user
 
 - 
memoryAllocationpublic void memoryAllocation() Display memory allocation frame (request more from the JVM on next JVM-start).
 - 
memoryFramepublic void memoryFrame() Display memory usage frame.
 - 
closeAllImagespublic void closeAllImages() this method closes all registered images
 - 
deleteItemprivate void deleteItem(java.lang.String name, boolean deleteFrame, boolean runGC)Deletes the item specified by name. If false, only the model image is deleted- Parameters:
- name- the object to delete
- deleteFrame- whether the frame should be deleted along with the image
- runGC- whether to run application-wide garbage collector once item is deleted
 
 - 
openJSONImageFramespublic void openJSONImageFrames() 
 - 
openImageFramepublic void openImageFrame() This method opens an image and puts it into a frame.
 - 
openImageFramepublic void openImageFrame(java.lang.String imageFile) Open an image and put it into a new frame, given the image file name.- Parameters:
- imageFile- the image file name with the path.
 
 - 
openImageFramepublic void openImageFrame(java.lang.String imageFileName, java.lang.String imageFileDir)Open an image and put it into a new frame, given the image file name.- Parameters:
- imageFileName- the file name, without the path
- imageFileDir- the directory where the file is
 
 - 
openImageFramepublic void openImageFrame(java.lang.String imageFile, boolean multiFile)Open an image or images and put it into a new frame, given the image file name.- Parameters:
- imageFile- the image file name with the path.
- multiFile- If true, the image is composed of image slices each in their own file.
 
 - 
openLastImagepublic void openLastImage(int index) Attempts to open an image from the quicklist.- Parameters:
- index- int index of image on quicklist
 
 - 
optionspublic void options() Display Options dialog for all mipav options (including image specific options) to allow user to adjust display in one place.
 - 
parseArgumentspublic int parseArguments(java.lang.String[] args, int initArg)Required by the CommandLineParser interface. Processes MIPAV command line arguments that require MIPAV to have already been initialized. Returns the next argument to be processed (finished if returns args.length)- Specified by:
- parseArgumentsin interface- CommandLineParser
- Parameters:
- args- command arguments
- Returns:
- the location of the next command to be processed, if equal to args.length, then no further processing is necessary
 
 - 
regFramepublic void regFrame(java.awt.Frame frame) Method that registers an image frame by putting it in the image frame vector and does NOT loads controls.- Parameters:
- frame- Frame to be registered with this the main UI.
 
 - 
registerFramepublic void registerFrame(java.awt.Frame frame) Method that registers an image frame by adding it to the vector and loads controls.- Parameters:
- frame- Frame to be registered with this the main UI. The zero element frame is the active image. Any new image registered is made the active window.
 
 - 
setMenuActionListenersprivate void setMenuActionListeners(java.awt.Component comp, java.awt.event.ActionListener frame)
 - 
registerImagepublic java.lang.String registerImage(ModelImage image) Register image model by adding it to the image hashtable. Use the image name as the key. If the name is not unique then theCustomHashtablewill attempt to make it unique. The image name will be reset with the new name. Classes calling this method need to check the returned key (image name) from this method.- Parameters:
- image- Image to be registered.
- Returns:
- the String value of the key (image name)
- See Also:
- CustomHashtable
 
 - 
registerImagepublic java.lang.String registerImage(java.lang.String key, ModelImage image)Register image model by adding it to the image hashtable. Use the String provided as the key. If the key is not unique then theCustomHashtablewill attempt to make it unique. The actual key used will be returned.- Parameters:
- key- the desired image key
- image- Image to be registered.
- Returns:
- the actual image key used (unique)
- See Also:
- CustomHashtable
 
 - 
removeAloneMenupublic boolean removeAloneMenu(javax.swing.JMenuBar menu) Removes the stand-alone menu from the user interface.- Parameters:
- menu- the menu to be removed.
 
 - 
setActiveFramepublic void setActiveFrame(java.awt.Frame frame) Method sets the parameter frame to top and active.- Parameters:
- frame- Frame to be set active (i.e. to the top of the list).
 
 - 
setClippedMatrixpublic void setClippedMatrix(TransMatrix tMat) Sets the clipped matrix for copy/paste actions.- Parameters:
- tMat- transmatrix for copy/paste
 
 - 
setControlspublic void setControls() Sets the menu for the main frame.
 - 
setDataTextpublic final void setDataText(java.lang.String str) Accessor to set text of data FRAME.- Parameters:
- str- String to be displayed in text panel.
 
 - 
setDefaultDirectorypublic void setDefaultDirectory(java.lang.String defaultDirectory) Sets directory location of last file access.- Parameters:
- defaultDirectory- Directory to set it to.
 
 - 
setDefaultScriptDirectorypublic void setDefaultScriptDirectory(java.lang.String dir) Sets directory location of the script files.- Parameters:
- dir- Directory to set the script directory to.
 
 - 
setDICOMCatcherpublic void setDICOMCatcher(DICOM_Receiver rcv) Accessor to set the DICOM receiver.- Parameters:
- rcv- the DICOM receiver
 
 - 
setDICOMQueryFramepublic void setDICOMQueryFrame(ViewJFrameDICOMQuery frame) Accessor to set the DICOM query frame.- Parameters:
- frame- The DICOM query frame.
 
 - 
setExitCmdLineOnErrorpublic void setExitCmdLineOnError(boolean doExit) Sets MIPAV to exit (true) or not (false) on an error when running from the command line- Parameters:
- doExit-
 
 - 
doExitCmdLineOnErrorpublic boolean doExitCmdLineOnError() Tells whether or not to exit on an error when running from the command line- Returns:
- boolean whether to exit
 
 - 
doForceInPlacepublic boolean doForceInPlace() Checks whether the dialog should force the algorithm to replace the image (no new frame)- Returns:
- if only algorithm image replacement is allowed
 
 - 
setForceInPlacepublic void setForceInPlace(boolean doForce) Sets the dialogs to only replace the image (no new frame)- Parameters:
- doForce- do force the dialog to replace the image (in-place)
 
 - 
setGlobalDataTextpublic final void setGlobalDataText(java.lang.String str) Accessor to set text of global data FRAME.- Parameters:
- str- String to be displayed in text panel.
 
 - 
setJarClassLoaderpublic void setJarClassLoader(JarClassLoader jarClassLoader) 
 - 
setLastScriptpublic void setLastScript(java.lang.String script) Sets last used script files in preferences.- Parameters:
- script- Script to set the LastScript to.
 
 - 
setLastStackFlagpublic void setLastStackFlag(boolean lastStackFlag) Sets the last value for opened multi-files (or single).- Parameters:
- lastStackFlag- boolean
 
 - 
setLoadpublic void setLoad(boolean doLoad) Tells the progress bar to say "Loading" rather than "Opening" for images being loaded if true.- Parameters:
- doLoad- boolean do set progress bar to load
 
 - 
setMessageTextpublic void setMessageText(java.lang.String str) Accessor to set text of message field.- Parameters:
- str- String to be displayed in text field.
 
 - 
setShortcutRecordingpublic void setShortcutRecording(boolean doRecord) Sets the UI to either be/not be recording action command.- Parameters:
- doRecord- boolean true = is recording, false = not
 
 - 
setTitlepublic void setTitle(java.lang.String str) Gets the application title from the preference file and prepends to the string passed into the method and displays the resultant string in the title of the main frame.- Parameters:
- str- the application title
 
 - 
setUseVOINamepublic void setUseVOIName(boolean useName) Sets the Preference to use VOI Names instead of labels, then updates all frames to reflect this change with their VOIs.- Parameters:
- useName- boolean show name instead of label
 
 - 
setVisiblepublic void setVisible(boolean visible) Change whether the GUI should be visible. The order is strage because we want the main frame to be first on the taskbar, but also focused when the windows show up.- Parameters:
- visible- whether the message and main frames should be shown on the screen
 
 - 
showLicensepublic void showLicense() Displays the MIPAV Software Transfer Agreement in a JDialogText window.The "license.html" file is read (using the GetPathclass) and displayed as HTML with a JDialogText. If the file is not found, or there is a problem opening it, a notation is made in thePreferences.debugwindow and is otherwise ignored. A warning box is displayed when the license dialog cannot be created (and throws aNullPointerException). Finally, the main frame does not record this item in its list of windows, so many instances of this window may be made.
 - 
showLicensepublic void showLicense(java.lang.String title, java.lang.String filename)Displays the MIPAV Software Transfer Agreement in a JDialogText window.The "license.html" file is read (using the GetPathclass) and displayed as HTML with a JDialogText. If the file is not found, or there is a problem opening it, a notation is made in thePreferences.debugwindow and is otherwise ignored. A warning box is displayed when the license dialog cannot be created (and throws aNullPointerException). Finally, the main frame does not record this item in its list of windows, so many instances of this window may be made.- Parameters:
- title- The title of the frame
- filename- the name of the license file.
 
 - 
showShortcutEditorpublic void showShortcutEditor(boolean doUpdate) Opens a dialog for viewing/modifying shortcuts.- Parameters:
- doUpdate- whether to update the shortcut table
 
 - 
showSplashGraphicspublic void showSplashGraphics() Shows the MIPAV splash screen for a few seconds, or until the user clicks it.
 - 
unregisterFramepublic void unregisterFrame(java.awt.Frame frame) Method that unregisters an image frame by removing it from the image frame vector.- Parameters:
- frame- Frame to be unregistered with this the main UI.
 
 - 
unregisterFramepublic void unregisterFrame(java.awt.Frame frame, boolean closeAll)Method that unregisters an image frame by removing it from the image frame vector.- Parameters:
- frame- Frame to be unregistered with this the main UI.
 
 - 
unRegisterImagepublic void unRegisterImage(ModelImage image) Unregister image model by removing it from the image hashtable. Assume that the imageName is the key to the image. Display an error if the image key is not found.- Parameters:
- image- Image to be unregistered.
- Throws:
- java.lang.IllegalArgumentException- if image is- null
 
 - 
unRegisterImagepublic void unRegisterImage(java.lang.String imageKey) Unregister image model by removing it from the image hashtable given the key to the hashtable. Display an error if the image key is not found.- Parameters:
- imageKey- The key to the image to be unregistered (a string).
- Throws:
- java.lang.IllegalArgumentException- if imageKey is- null
 
 - 
updateMemoryUsagepublic void updateMemoryUsage() This method is a callback method. The purpose is to update the memory usage readout every one second. A separate thread calls this method every one second.
 - 
updateMultiCoreUsagepublic void updateMultiCoreUsage() This method updates the "whether multi-core should be used" button when the relevant button has been pushed in either the preferences pane.
 - 
updateGpuUsagepublic void updateGpuUsage() This method updates the "whether algorithms will use the GPU" when the relevant button has been pushed in either the preferences pane.
 - 
updateScriptpublic void updateScript(java.lang.String newScriptText) Do nothing - required by ScriptRecordingListener interface.- Specified by:
- updateScriptin interface- ScriptRecordingListener
- Parameters:
- newScriptText- Ignored.
 
 - 
windowActivatedpublic void windowActivated(java.awt.event.WindowEvent event) Do nothing.- Specified by:
- windowActivatedin interface- java.awt.event.WindowListener
- Parameters:
- event- the window event.
 
 - 
windowClosedpublic void windowClosed(java.awt.event.WindowEvent event) Do nothing.- Specified by:
- windowClosedin interface- java.awt.event.WindowListener
- Parameters:
- event- the window event.
 
 - 
windowClosingpublic void windowClosing(java.awt.event.WindowEvent event) Confirms if the user really wants to exit, then closes the application.- Specified by:
- windowClosingin interface- java.awt.event.WindowListener
- Parameters:
- event- Event that triggered this function.
 
 - 
cleanupAndExitpublic void cleanupAndExit() 
 - 
windowDeactivatedpublic void windowDeactivated(java.awt.event.WindowEvent event) Do nothing.- Specified by:
- windowDeactivatedin interface- java.awt.event.WindowListener
- Parameters:
- event- the window event.
 
 - 
windowDeiconifiedpublic void windowDeiconified(java.awt.event.WindowEvent event) Deiconify only the other frames who's last state was normal (ie- restore other frames to their lastState).- Specified by:
- windowDeiconifiedin interface- java.awt.event.WindowListener
- Parameters:
- event- the deiconify window event.
 
 - 
windowIconifiedpublic void windowIconified(java.awt.event.WindowEvent event) Iconify all other frames associateed with MIPAV.- Specified by:
- windowIconifiedin interface- java.awt.event.WindowListener
- Parameters:
- event- the iconify window event.
 
 - 
windowOpenedpublic void windowOpened(java.awt.event.WindowEvent event) Do nothing.- Specified by:
- windowOpenedin interface- java.awt.event.WindowListener
- Parameters:
- event- the window event.
 
 - 
writeDataProvenancepublic void writeDataProvenance() Writes Mipav's data provenance to the default location.. 
 - 
initCreateMemoryUsagePanelprotected javax.swing.JPanel initCreateMemoryUsagePanel() Construct the panel which displays the current memory usage/limit and a garbage collection button.- Returns:
- the memory usage panel
 
 - 
initCreateMultiCoreGpuIndicatorPanelprotected javax.swing.JPanel initCreateMultiCoreGpuIndicatorPanel() Construct the panel which displays whether the CPU and GPU could be utilized by algorithms based on the preferences settings by the user.- Returns:
- the memory usage panel
 
 - 
initCreateMessageBarprotected void initCreateMessageBar() Create the panel containing components which show the application title initially, and will later be used to show image coordinates and intensities.
 - 
initCreateMessageFieldprotected javax.swing.JTextField initCreateMessageField(java.lang.String title) Creates the message field for the main frame using the title given. For other applications, extend this method to call the super method with the appropriate title.- Parameters:
- title- the string use in the newly-created message field.
- Returns:
- the message field (displays coordinate info when an image is opened)
 
 - 
initDicomReceiverprotected void initDicomReceiver() Starts the DICOM receiver if the flag in the preference file istrue.
 - 
initMacintoshJDKversionCheckprotected void initMacintoshJDKversionCheck() Method checks to verify that when running on a Machintosh, the JDK version is at least 1x2e;4. It sets the start up file "Info.plist" to use java1.4 if it can. The check for these routines is System.getProperty("os.name").indexOf("Mac"), and we simply return doing nothing if the property for os.name is something different. If the os.name does not contain "Mac", and the Info.plist file is found,"Info.plist" file to hold its startup arguments, so we need that file anyway. All exceptions caught here are not propogated. 
 - 
initPrefsFileprotected void initPrefsFile() Set the preferences file to use (Preferences defaults to mipav.preferences).
 - 
initPrefsTrimprotected void initPrefsTrim() Gets the TRIM_VOI, TRIM_MASK and TRIM_FLAG values from the preferences file, and if it cannot find them, it sets to some default value: TRIM_VOI will be 0.3, TRIM_MASK will be 0.0, and TRIM_FLAG will be true.Over-ride this method if these defaults are unnacceptable. 
 - 
initSetMainFrameDefaultsprotected void initSetMainFrameDefaults(java.awt.LayoutManager prefLayout, boolean resize)Sets the layout of the Main Frame with the given, preferred layout manager; makes the main frame resizable as given; makes this class a window-listener; sets the default operation to do nothing on close; and the icon is set. The image icon is set by the preferences.Over-riding classes can alter the preferred layout most easily by over-riding this method, but calling this method with a different layout and desired size-setting. To change the default close-operation with an over-riding class, call this super method, then set the default close operation, rather than creating a custom re-implemention of this method. - Parameters:
- prefLayout- A layout manager to handle the main frame.
- resize- Whether to allow resizing of the main frame.
- See Also:
- JFrame.setDefaultCloseOperation(int),- Preferences.getIconName()
 
 - 
initSetTitlesprotected void initSetTitles(java.lang.String mainFrameTitle, java.lang.String appTitle)Sets the titles for for the main frame and the application using the strings given. For other applications, extend this method to call the super method with the appropriate title.- Parameters:
- mainFrameTitle- The string to use as the title for the main frame.
- appTitle- The string to put in the main frame's bottom status field.
 
 - 
initUsingPreferencesprotected void initUsingPreferences() Performs a variety of start-up operations based on user-preferences; First, it tries to read from the preferences file; if it cannot, it sets the user directory. It then follows from the preferences file:- splash screen
- checks the VM heap size max
- sets the default directory
- debug output
- sets the TRIM
 Over-riding classes should not over-ride this method unless one of these intermediate operations is not desired or more operations are needed. To modify the defaults used in creating a preferences file, over-ride one of the called methods. 
 - 
runCmdLineprotected void runCmdLine(java.lang.String scriptFile, java.util.Vector<ViewUserInterface.OpenFileInfo> imageList, java.util.Vector<java.util.Vector<java.lang.String>> voiList)This method is used when running MIPAV from the command line.- Parameters:
- scriptFile- The script to run.
- imageList- A list of OpenImageFile objects to use in the script.
- voiList- A list of VOIs to put into the various images.
- See Also:
- printUsageAndExit()
 
 - 
checkHeapMaxAgainstPreferencesprivate void checkHeapMaxAgainstPreferences() Test for VM memory sizes being the same as last run in preferences: displays a user-warning that the preferences & VM config files disagree and presents the JDialogMemoryAllocation dialog with "use preference" buttons to quicken the matching process.Note, this method does not throw any NullPointerExceptions.
 - 
printUsageAndExitpublic static void printUsageAndExit() Displays command line help information on usage of all commands and then exits.
 - 
printUsageAndExitpublic static void printUsageAndExit(Argument c) Displays command line help information on usage to standard out and then into an informational dialog box then exits the MIPAV application. Help display just shows the different options, display help, load image, load script, load VOI, and hide menu bar, as well as examples of use.
 - 
generateCmdUsageInfopublic static java.lang.String generateCmdUsageInfo() Generates automatic list of available commands.
 - 
isProvidedOutputDirpublic static boolean isProvidedOutputDir() This is the getter for providedOutputDir providedOutputDir: This boolean tells if the user has provided an ouputDir parameter as a command line argument when running a script- Returns:
 
 - 
isProvidedUserDefaultDirpublic static boolean isProvidedUserDefaultDir() 
 - 
getDiscoverableActionListpublic static java.util.Vector<java.lang.Class<ActionDiscovery>> getDiscoverableActionList() 
 - 
getDiscoverableActionListpublic static java.util.Vector<java.lang.Class<ActionDiscovery>> getDiscoverableActionList(java.lang.String baseDir) 
 - 
getExceptionspublic static java.io.File getExceptions() - Returns:
- the exceptions
 
 - 
getOutputDirpublic static java.lang.String getOutputDir() 
 - 
getSecondaryPluginsDirpublic static java.io.File getSecondaryPluginsDir() 
 - 
getUserDefaultDirpublic static java.lang.String getUserDefaultDir() 
 - 
setProvidedOutputDirpublic static void setProvidedOutputDir(boolean providedOutputDir) 
 - 
setProvidedUserDefaultDirpublic static void setProvidedUserDefaultDir(boolean providedUserDefaultDir) 
 - 
setOutputDirpublic static void setOutputDir(java.lang.String outputDir) 
 - 
setSecondaryPluginsDirpublic static void setSecondaryPluginsDir(java.io.File secondaryPluginsDir) 
 - 
setUserDefaultDirpublic static void setUserDefaultDir(java.lang.String userDefaultDir) 
 - 
parseStaticArgumentspublic static int parseStaticArguments(java.lang.String[] args, int initArg)Required by the CommandLineParser interface. Processes MIPAV command line arguments that DO NOT require MIPAV to have already been initialized. In cases like the plugins directory, it is specifically required that MIPAV has not been initialized yet. Returns the next argument to be processed (finished if returns args.length)
 - 
checkPrefDirCommandpublic static void checkPrefDirCommand(java.lang.String[] args, int initArg)If the preferences name command is about to be performed before an existing preferences directory command, this guarantees that the directory command will be executed first.
 - 
addToTempDirListpublic static void addToTempDirList(java.lang.String path) 
 
- 
 
-