Class JDialogBase

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
DTIPipeline, JDialogAAMClassification, JDialogAAMClassificationExt, JDialogAAMplusSVM, JDialogACPC, JDialogAction, JDialogAddNode, JDialogAGVF, JDialogAnalyzeNIFTIChoice, JDialogAnimate, JDialogAnnotation, JDialogAnonymizeDirectory, JDialogAnonymizePresets, JDialogAnyTwoImagesSNR, JDialogAVIChoice, JDialogBlankImage, JDialogBoundingVOIs, JDialogBrightness, JDialogBSmooth, JDialogBSnake, JDialogBurnParameter, JDialogCaptureScreen, JDialogCaptureScreens, JDialogCentroidThreshold, JDialogChangeMaskNumber, JDialogCheckerBoard, JDialogCircleGeneration, JDialogCircleToRectangle, JDialogCircularSectorToRectangle, JDialogConvexHull2D, JDialogCopyFiles, JDialogCreateHEDpngFiles, JDialogCreateHEDpngFilesTest, JDialogCreateProbMap, JDialogCreateProbMap64, JDialogCreateProbMapConvert, JDialogCT, JDialogCTHistoLUT, JDialogCTPreset, JDialogCumulativeHistogram, JDialogDataProvenance, JDialogDICOMDeleteTagEditor, JDialogDicomDir, JDialogDICOMNewTagEditor, JDialogDICOMTagEditor, JDialogDICOMtoAVI, JDialogDoublyConnectedSC, JDialogDTICreateListFile, JDialogDTICreateListFileRegOAR35DOptions, JDialogDTIEstimateTensor, JDialogDualContourSearch, JDialogEditor, JDialogEditUserDefinedFileTypes, JDialogEllipseGeneration, JDialogEllipseToCircle, JDialogEllipseToRectangle, JDialogEnhancedDicomChoice, JDialogEvolveBoundaryManual, JDialogExtractObject, JDialogFemurTraceSectionsNetherland, JDialogFemurTraceSectionsNIH, JDialogFemurTraceSectionsSeparateNetherland, JDialogFileInfo, JDialogFileInfoMincHDF, JDialogFileInfoXML, JDialogFilterChoice, JDialogFrameLinker, JDialogFRAP, JDialogFRET, JDialogGenerateEndingSlices, JDialogGridOptions, JDialogGVF, JDialogHessian, JDialogHistogramLUT, JDialogHoughCardioid, JDialogHoughCardioidChoice, JDialogHoughCircle, JDialogHoughCircleChoice, JDialogHoughEllipse, JDialogHoughEllipseChoice, JDialogHoughHyperbola, JDialogHoughHyperbolaChoice, JDialogHoughLine, JDialogHoughLineChoice, JDialogHoughParabola, JDialogHoughParabolaChoice, JDialogImageInfo, JDialogInitialCentroids, JDialogInstallPlugin, JDialogIntensityHistogram, JDialogIntensityPaint, JDialogIntensityThreshold, JDialogKnees_3DReconstrucion, JDialogKnees_90_data_train_extraction, JDialogKnees2DSlicesAtlasPngConverter, JDialogKneesLearnFromFailure64TestCase, JDialogKneesMapFromMRIandCED, JDialogLearnFromFailure64Knees, JDialogLevelSet, JDialogLevelSetDiffusion, JDialogLightBox, JDialogListSaveSelection, JDialogLivewire, JDialogLoadImageForRegistration, JDialogLoadLeica, JDialogLoadProstateMask, JDialogMask3D4D, JDialogMemoryAllocation, JDialogMetaImageChoice, JDialogMipavOptions, JDialogMultiPaint, JDialogNColors, JDialogNearlyCircleToCircle, JDialogNIFTIChoice, JDialogOpacityControls, JDialogOrder, JDialogOrientMatrix, JDialogOverlay, JDialogOverlay.JDialogChooseOverlay, JDialogPaintGrow, JDialogPaintRGBComponents, JDialogPaintVasculature, JDialogPatellaTraceSectionsNetherland, JDialogPatellaTraceSectionsNIH, JDialogPhaseCongruency, JDialogPolygonToCircle, JDialogPolygonToRectangle, JDialogPowerPaint, JDialogPromise12_2DVolumetrieHED, JDialogPromise12_2DVolumetrieHED_map, JDialogPromise12_mhg_to_nii, JDialogPromise12ConvertMask, JDialogPromise12ConvertRestoOnePointFiveTest, JDialogPromise12ConvertRestoOnePointFiveTrain, JDialogPromise12CropAndNormalizeTest, JDialogPromise12CropAndNormalizeTrain, JDialogPromise12NIHDataToNii, JDialogPromise12Train3DCnns, JDialogPromise12Train3DCnnsSmall, JDialogProstate2DHEDmap, JDialogProstate2DHEDmapCg, JDialogProstate2DHEDmapMICCAI, JDialogProstate2DHEDmapMICCAI_ced_scale, JDialogProstate2DHEDmapMICCAI_conversion, JDialogProstate2DHEDmapSPIE_2017, JDialogProstate2DSlicesAtlasConverter, JDialogProstate2DSlicesAtlasCopyGTstl, JDialogProstate2DSlicesAtlasPngConverter, JDialogProstate2DSlicesAtlasPngConverter_JMI, JDialogProstate2DSlicesAtlasPngConverter3DSurface, JDialogProstate2DSlicesAtlasPngConverter3DSurfaceEdgeMap, JDialogProstate2DSlicesAtlasPngConverter3DSurfaceEdgeMapGT, JDialogProstate2DSlicesAtlasPngConverter3DSurfaceEnergyMap, JDialogProstate2DSlicesAtlasPngConverter3DSurfaceTest, JDialogProstate2DSlicesAtlasPngConverter3DSurfaceTrainAndTest, JDialogProstate2DSlicesAtlasPngConverterCentralGland, JDialogProstate2DSlicesAtlasPngConverterCentralGland_CED_scale, JDialogProstate2DSlicesAtlasPngConverterCentralGland_CED_scale_boundary_test, JDialogProstate2DSlicesAtlasPngConverterCentralGland_CED_scale_boundary_train, JDialogProstate2DSlicesAtlasPngConverterCentralGland_CED_scale_test, JDialogProstate2DSlicesAtlasPngConverterCentralGland_CED_scale_train, JDialogProstate2DSlicesAtlasPngConverterCentralGland_miccai, JDialogProstate2DSlicesAtlasPngConverterMICCAI, JDialogProstate2DSlicesAtlasPngConverterMICCAI_boundary_ced_scale, JDialogProstate2DSlicesAtlasPngConverterMICCAI_boundary_ced_scale_test, JDialogProstate2DSlicesAtlasPngConverterMICCAI_ced_scale, JDialogProstate2DSlicesAtlasPngConverterMICCAI_ced_scale_test, JDialogProstate2DSlicesAtlasPngConverterMICCAI_ced_scale_train, JDialogProstate2DSlicesAtlasPngConverterMICCAI_conversion, JDialogProstate2DSlicesAtlasPngConverterTest, JDialogProstate2DSlicesAtlasPngConverterTest_JMI, JDialogProstate2DSlicesAtlasPngConverterTrain, JDialogProstate2DSlicesAtlasPngConverterTrain_JMI, JDialogProstate2DSlicesPngTextFileConverter, JDialogProstate2DSlicesPngTextFileConverterCentralGland, JDialogProstate2DSlicesPngTextFileConverterMICCAI, JDialogProstate2DSlicesPngTextFileConverterTest, JDialogProstate2DSlicesPngTextFileConverterTestCentralGland, JDialogProstate2DSlicesReconstrucion, JDialogProstate2DVolumetricHEDMiccaiProstate12, JDialogProstate3DReconstruction, JDialogProstateCheckPngFile, JDialogProstateEvaluationSegmentation, JDialogProstateEvaluationSegmentation_jmi, JDialogProstateExtractCEFeature, JDialogProstateImageCategorize, JDialogProstateISBIfinalSurfaceCompare, JDialogProstateISBIfinalSurfaceConvertNII, JDialogProstateISBIfinalSurfaceEvalSeg, JDialogProstateJMI_2017_HEDmap, JDialogProstateJMI_2017_VOI_converter, JDialogProstateLearnFromFailure64TestCase, JDialogProstateLearnFromFailure64TrainingCase, JDialogProstateSaveBoundaryFeature2D, JDialogProstateSaveFeatures2D, JDialogProstateSegmentationRegBSpline3D, JDialogProstateSegmentationRegBSpline3DFast, JDialogProstateSPIEcancerChallenge, JDialogProstateSPIEcancerChallenge_HEDmap_image_alone, JDialogProstateSPIEcancerChallenge_HEDmap_mri_ced, JDialogProstateSPIEcancerChallenge_noCED, JDialogProstateSPIEcancerChallengeNIH_boundary_train, JDialogProstateSPIEcancerChallengeNIH_train, JDialogProstateSPIEcancerChallengeNIH_train_ced, JDialogProstateSPIEcancerChallengeNIH_train_ced_ext, JDialogProstateSPIEcancerChallengeNIH_train_ced_ext_wp, JDialogProstateXReRunWholeProstate, JDialogProstateXReRunWholeProstateTestPatches, JDialogProstateXReRunWholeProstateTrainPatches, JDialogRawIO, JDialogRecordLUT, JDialogRegistrationChamfer, JDialogRegVOILandmark, JDialogRemovePlugin, JDialogRenameDirs, JDialogRendererAVI, JDialogReplaceSlice, JDialogSaveDicom, JDialogSaveMergedVOIs, JDialogSaveMinc, JDialogSaveMincVersionChoice, JDialogSaveSlices, JDialogSaveVistaParams, JDialogScriptableBase, JDialogScriptRecorder, JDialogSelectChannelSequence, JDialogSelectDICOMColumnHeaders, JDialogServer, JDialogShortcutEditor, JDialogShortcutEditor.ShortcutDialog, JDialogShuffleList, JDialogSimpleText, JDialogSingleMRIImageSNR, JDialogSK10_MRI_CED_map_pre, JDialogSK10_MRI_map_nopre, JDialogSKI_10_2D_axial_no_pre, JDialogSKI_10_3D_orthogonal_pre, JDialogSKI10_femur_eval_no_pre, JDialogSKI10_femur_eval_pre, JDialogSmoothMesh, JDialogSnake, JDialogSphereGeneration, JDialogStandalonePlugin, JDialogSurfaceAVI, JDialogSurfaceReconstruction, JDialogTalairach, JDialogTalairachTransform, JDialogText, JDialogThresholdLUT, JDialogTLRC, JDialogTrainingListGenerator, JDialogTransformVOI, JDialogTriFrameLinker, JDialogTriImageTransformation, JDialogTrim, JDialogTwoMRIImagesSNR, JDialogUninstallPlugin, JDialogUnknownIO, JDialogVABRA, JDialogVOIBoolean, JDialogVOIExtraction, JDialogVOIShapeInterpolation, JDialogVOISplitter, JDialogVolViewResample, JDialogWinLevel, JDialogZoom, JPanelAVIChoice, JPanelMouse.ChangeNameDialog, JPanelMousePlotter.ChangeNameDialog, Knees_90_data_train_extraction, ReportBugBuilder, ViewJFrameCreatePaint.JDialogGridSize, ViewJFrameRegistration.JDialogIncrement, ViewJFrameRegistrationTool.JDialogIncrement

public abstract class JDialogBase extends JDialog implements ActionListener, WindowListener, FocusListener, ItemListener, DialogDefaultsInterface
This class is the base for all the other dialogs. It has two important functions that are used by almost all the dialogs. It also implements all the listeners except for the action listener.
Version:
2.0 Aug 1, 2012
Author:
Justin Senseney, Neva Cherniavsky, Matthew J. McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

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

      protected static final int REPLACE
      REPLACE indicates the current image is replaced after algorithm is run.
      See Also:
    • NEW

      protected static final int NEW
      NEW indicates a new image is created after the algorithm is run.
      See Also:
    • LOAD_DEFAULT

      private static final String LOAD_DEFAULT
      Loads default for this dialog
      See Also:
    • LOAD_PROFILE

      private static final String LOAD_PROFILE
      Loads profile for this dialog
      See Also:
    • SAVE_DEFAULT

      private static final String SAVE_DEFAULT
      Saves default for this dialog
      See Also:
    • SAVE_PROFILE

      private static final String SAVE_PROFILE
      Saves profile for this dialog
      See Also:
    • HELP

      protected static final String HELP
      Displays help this dialog
      See Also:
    • ABOUT_MIPAV

      private static final String ABOUT_MIPAV
      Access about mipav panel
      See Also:
    • cancelFlag

      public boolean cancelFlag
      Flag indicating if the dialog had been cancelled or not.
    • applyButton

      protected JButton applyButton
      Apply button is used to apply the setting of the dialog.
    • cancelButton

      protected JButton cancelButton
      Cancel button is used on most dialogs. Defining it in the base allows default actions if the user presses return and the button is in focus.
    • closeButton

      protected JButton closeButton
      Close button is used to close the dialog.
    • helpButton

      protected JButton helpButton
      Help button is used on most dialogs. Defining it in the base allows default actions if the user presses return and the button is in focus.
    • mainDialogPanel

      protected JPanel mainDialogPanel
      The main panel of the dialog. To be filled by inheriting classes. Defaults to BorderLayout since that's what the contentPane defaults to (makes it easier to change over to using mainDialogPanel without messing up the layout).
    • OKButton

      protected JButton OKButton
      OK button is used on most dialogs. Defining it in the base allows default actions if the user presses return and the button is in focus.
    • parentFrame

      protected Frame parentFrame
      Parent frame of this dialog, usually of type ViewJFrameImage.
    • runInSeparateThread

      protected boolean runInSeparateThread
      Flag indicating if the algorithm should run in a separate thread. Default is true.
    • runningScriptFlag

      protected boolean runningScriptFlag
      Whether we are using this dialog as part of a script.
    • runQuiet

      protected boolean runQuiet
      Whether algorithm is running in quiet mode (such as part of a script, in headless environment, within other algorithm )
    • serif12

      protected Font serif12
      Fonts, same as MipavUtil.font12 and MipavUtil.font12B.
    • serif12B

      protected Font serif12B
      Fonts, same as MipavUtil.font12 and MipavUtil.font12B.
    • progressBar

      protected ViewJProgressBar progressBar
      Progress bar that will listen to a dialog's algorithm (and reflect current progress)
    • voiManager

      protected VOIManagerInterface voiManager
    • bar

      protected JMenuBar bar
      JMenuBar for loading/saving defaults
    • profiles

      private ArrayList<String> profiles
      List of existing default profiles for this dialog
  • Constructor Details

    • JDialogBase

      public JDialogBase()
      Constructor that sets the dialog to not modal. There is no parent frame. No visible dialogs should use this constructor - only for scripting, where the dialogs are hidden and simply store information.
    • JDialogBase

      public JDialogBase(boolean modal)
      Constructor that only sets the dialog to modal or not modal. In this case the parent frame is null. Also adds this as a window listener.
      Parameters:
      modal - true indicates modal dialog, false otherwise.
    • JDialogBase

      public JDialogBase(Frame parent, boolean modal)
      Constructor that sets the parent frame of the dialog and whether or not the dialog is modal. Also adds this as a window listener to all dialogs.
      Parameters:
      parent - Parent frame.
      modal - Modality of the dialog; true means the user can't do anything until this dialog is diposed of.
    • JDialogBase

      public JDialogBase(Frame parent, boolean modal, boolean displayMenu)
      Constructor that sets the parent frame of the dialog and whether or not the dialog is modal. Also adds this as a window listener to all dialogs.
      Parameters:
      parent - Parent frame.
      modal - Modality of the dialog; true means the user can't do anything until this dialog is diposed of.
      displayMenu - Whether menu should be displayed to user for loading/saving defaults
    • JDialogBase

      public JDialogBase(Dialog parent, boolean modal)
      Constructor that forwards the parent dialog whether or not the dialog is modal. Also adds this as a window listener to all dialogs.
      Parameters:
      parent - Parent Dialog. Unlike the JDialog(Frame, boolean) constructor, this method merely forwards the parent/owner to the super-class, and not store a reference locally. a higher level, but does not store the
      modal - Modality of the dialog; true means the user can't do anything until this dialog is diposed of.
    • JDialogBase

      public JDialogBase(Dialog parent, boolean modal, boolean displayMenu)
      Constructor that forwards the parent dialog whether or not the dialog is modal. Also adds this as a window listener to all dialogs.
      Parameters:
      parent - Parent Dialog. Unlike the JDialog(Frame, boolean) constructor, this method merely forwards the parent/owner to the super-class, and not store a reference locally. a higher level, but does not store the
      modal - Modality of the dialog; true means the user can't do anything until this dialog is diposed of.
      displayMenu - Whether menu should be displayed to user for loading/saving defaults
  • Method Details

    • createMenu

      private void createMenu()
    • makeImageName

      public static String makeImageName(String image_name, String ext)
      Helper method for making the result image's name. Strips the current extension from the original name, adds the given extension, and returns the new name.
      Parameters:
      image_name - the original image's name
      ext - Extension to add which gives information about what algorithm was performed on the image.
      Returns:
      The new image name.
    • updateFileInfoStatic

      public static void updateFileInfoStatic(ModelImage image, ModelImage resultImage)
      Copy important file information to resultant image structure.
      Parameters:
      image - Source image.
      resultImage - Resultant image.
    • updateFileInfoStatic

      public static final void updateFileInfoStatic(FileInfoBase info, ModelImage resultImage)
      Copy important file information between ModelImage structures, assuming all slices have same properties (uses only the first slice from the source).
      Parameters:
      resultImage - Resultant image.
      image - Source image.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • focusGained

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

      public void focusLost(FocusEvent event)
      Unchanged.
      Specified by:
      focusLost in interface FocusListener
      Parameters:
      event - FocusEvent
    • getComponentName

      private String getComponentName(Component comp, String longName, String profile)
    • getComponentName

      private static String getComponentName(Object parentClassObject, Component comp, String longName, String profile)
    • isCancelled

      public boolean isCancelled()
      Accessor that returns whether or not the dialog has been cancelled.
      Returns:
      true indicates cancelled, false indicates not cancelled.
    • isRunInSeparateThread

      public boolean isRunInSeparateThread()
      Returns whether this dialog's algorithm should be run in a new thread.
      Returns:
      True if this dialog's algorithm should be run in a new thread.
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Unchanged.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      event - ItemEvent
    • loadComponents

      private boolean loadComponents(Component comp, String name, String profile)
    • loadDefaults

      public void loadDefaults()
      Loads the defaults of profile 0.
      Specified by:
      loadDefaults in interface DialogDefaultsInterface
    • loadDefaults

      public boolean loadDefaults(String profileStr)
      Loads default values for gui components in the dialog.
    • loadProfiles

      private ArrayList<String> loadProfiles()
      Loads profile names that are available for the dialog
      Returns:
    • makeString

      public String makeString(float number, int decPts)
      Makes a string of a floating point number with a specific number of decimal points.
      Parameters:
      number - Number to be converted to a string.
      decPts - The number of decimal points.
      Returns:
      String representation of the number.
    • saveComponents

      private void saveComponents(Component comp, String name, String profile)
    • saveDefaults

      public void saveDefaults()
      Saves the defaults of profile 0.
      Specified by:
      saveDefaults in interface DialogDefaultsInterface
    • saveDefaults

      public void saveDefaults(String profile)
      Saves the defaults of the dialog base to the mipav preferences file, assigning it to the given profile name.
    • setLeftHandSystem

      public void setLeftHandSystem(boolean leftHandSys)
      Sets the left-hand coordinate flag. If true, change matrix to the left-hand coordinate system.
      Parameters:
      leftHandSys - flag for left hand coordinate system
    • setSeparateThread

      public void setSeparateThread(boolean flag)
      Accessor that sets the separate thread flag.
      Parameters:
      flag - true indicates run in separate thread, false otherwise.
    • setVisibleMenuBar

      public void setVisibleMenuBar(boolean visible)
      Parameters:
      bar - whether the menu bar is visible
    • setVisible

      public void setVisible()
      Makes the dialog visible in center of screen.
    • setVisible

      public void setVisible(boolean status)
      Makes the dialog visible in center of screen.
      Overrides:
      setVisible in class Dialog
      Parameters:
      status - Flag indicating if the dialog should be visible.
    • setVisibleStandard

      public void setVisibleStandard(boolean status)
      Makes the dialog visible by calling super method. No location set.
      Parameters:
      status - Flag indicating if the dialog should be visible.
    • setWCSystem

      public void setWCSystem(boolean wcSys)
      Sets the world coordinate flag. If true, change matrix to the world coordinate system.
      Parameters:
      wcSys - flag for world coordinate
    • updateFFTFileInfo

      public static final void updateFFTFileInfo(ModelImage image, ModelImage resultImage, int type)
      Copy important file information to resultant image structure. In doing a Forward FFT the result image is the same size or bigger than the original image because of zero padding. Set file info for the amount of slices in the FFT image so the original info will be available for all the slices after the inverse FFT is performed and so the MIPAV FileInfo operations will work properly on the FFT image.

      Because zero stripping is performed at the end of the inverse FFT process, the image formed after the inverse FFT will be the same size as the original image before the forward FFT. Also used for wavlet images since the wavelet tranform is always larger than the original source image

      Parameters:
      image - Source image.
      resultImage - Resultant image.
      type - Data type to set in file info.
    • updateFileInfo

      public static final void updateFileInfo(ModelImage image, ModelImage resultImage)
      Copy important file information to resultant image structure.
      Parameters:
      image - Source image.
      resultImage - Resultant image.
    • updateFileInfoOtherModality

      public static final void updateFileInfoOtherModality(ModelImage image, ModelImage resultImage)
      Copy important file information to resultant image structure.
      Parameters:
      image - Source image.
      resultImage - Resultant image.
    • updateFileTypeInfo

      public static final void updateFileTypeInfo(ModelImage image, int type)
      Copy important file information to resultant image structure, including data type.
      Parameters:
      image - Source image.
      type - Data type to set in file info.
    • updateFileTypeInfo

      public static final void updateFileTypeInfo(ModelImage image, ModelImage resultImage, int type)
      Copy important file information to resultant image structure, including data type.
      Parameters:
      image - Source image.
      resultImage - Resultant image.
      type - Data type to set in file info for the resultImage.
    • windowActivated

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

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

      public void windowClosing(WindowEvent event)
      Disposes of error dialog, then frame. Sets cancelled to true.
      Specified by:
      windowClosing in interface WindowListener
      Parameters:
      event - WindowEvent
    • windowDeactivated

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

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

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

      public void windowOpened(WindowEvent event)
      Unchanged.
      Specified by:
      windowOpened in interface WindowListener
      Parameters:
      event - WindowEvent
    • buildApplyButton

      protected JButton buildApplyButton()
      Builds the cancel button. Sets it internally as well return the just-built button.
      Returns:
      JButton apply button
    • buildButtons

      protected JPanel buildButtons()
      Builds button panel consisting of OK, Cancel and Help buttons.
      Returns:
      JPanel that has ok, cancel, and help buttons
    • buildOKCancelButtons

      protected JPanel buildOKCancelButtons()
      Builds button panel consisting of OK, Cancel and Help buttons.
      Returns:
      JPanel that has ok, cancel, and help buttons
    • buildCancelButton

      protected JButton buildCancelButton()
      Builds the cancel button. Sets it internally as well return the just-built button.
      Returns:
      JButton cancel button
    • buildCancelButton

      public static JButton buildCancelButton(String actionCommand, ActionListener parent)
    • buildCloseButton

      protected JButton buildCloseButton()
      Builds the close button. Sets it internally as well return the just-built button.
      Returns:
      JButton close button
    • buildHelpButton

      protected JButton buildHelpButton()
      Builds the help button. Sets it internally as well return the just-built button.
      Returns:
      JButton help button
    • buildImageComboBox

      protected JComboBox buildImageComboBox(ModelImage image)
      Builds a list of images. Returns combobox.
      Parameters:
      image - ModelImage to exclude from the box
      Returns:
      Newly created combo box.
    • buildOKButton

      public static JButton buildOKButton(String actionCommand, ActionListener parent)
      Builds the OK button. Sets it internally as well return the just-built button.
      Returns:
      JButton ok button
    • buildOKButton

      protected JButton buildOKButton()
      Builds the OK button. Sets it internally as well return the just-built button.
      Returns:
      JButton ok button
    • buildTitledBorder

      public static TitledBorder buildTitledBorder(String title)
      Builds a titled border with the given title, an etched border, and the proper font and color.
      Parameters:
      title - Title of the border
      Returns:
      The titled border.
    • buildTitledBorder

      public static TitledBorder buildTitledBorder(String title, Color color)
      Builds a titled border with the given title, an etched border, and the proper font and color.
      Parameters:
      title - Title of the border
      color - Color of the border
      Returns:
      The titled border.
    • createLabel

      protected JLabel createLabel(String title)
      Helper method to create a label with the proper font and font color.
      Parameters:
      title - Text of the label.
      Returns:
      New label.
    • createTextField

      protected JTextField createTextField(String title)
      Helper method to create a text field with the proper font and font color.
      Parameters:
      title - Text int the field.
      Returns:
      New text field.
    • createProgressBar

      protected void createProgressBar(String title, AlgorithmBase pListener)
      Creates the progress bar that will listen to an algorithm's progress changes
      Parameters:
      title - progress bar's title
      pListener - algorithmbase that will notify progress updates to the pBar
    • createProgressBar

      protected void createProgressBar(String title, String msg, AlgorithmBase pListener)
      Creates the progress bar (should be created within JDialog's callAlgorithm method
      Parameters:
      title - progress bar's title
      msg - the message to display on the progress bar (initial setting)
      pListener - the algorithm that will register the progress bar as a listener
    • getDialogName

      protected String getDialogName()
      Returns the name of the dialog (e.g. JDialogBase -> Base)
      Returns:
      String dialog name
    • openNewFrame

      protected ViewJFrameImage openNewFrame(ModelImage image)
      JDialogs that create result image's in new frame should call this method instead of creating a new ViewJFrameImage
      Parameters:
      image - the result image to be opened in a new frame that extends ViewJFrameImage
      Returns:
      the new frame
    • isScriptRunning

      public boolean isScriptRunning()
      Returns whether the current dialog is being run from within a script.
      Returns:
      whether a script is running
    • setScriptRunning

      public void setScriptRunning(boolean flag)
      Sets whether the dialog is being run by a script.
      Parameters:
      flag - whether a script is being executed
    • isQuietRunning

      public boolean isQuietRunning()
    • setQuietRunning

      public void setQuietRunning(boolean runQuiet)
    • setVOIManager

      public void setVOIManager(VOIManagerInterface voiManager)
      Sets the VOIManagerInterface
      Parameters:
      voiManager -
    • testParameter

      public static boolean testParameter(String str, double minValue, double maxValue)
      Tests that the entered parameter is in range from [minValue, maxValue].
      Parameters:
      str - The value entered by the user.
      minValue - The minimum value this variable may be set to.
      maxValue - The maximum value this variable may be set to.
      Returns:
      true if parameters passed range test, false if failed.
    • testParameterMin

      public static boolean testParameterMin(String str, double minValue)
      Tests that the entered parameter is larger than the specified value.
      Parameters:
      str - The value entered by the user.
      minValue - The minimum value this variable may be set to.
      Returns:
      true if parameters passed range test, false if failed.