Package gov.nih.mipav.view.dialogs
Class JDialogBase
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- gov.nih.mipav.view.dialogs.JDialogBase
-
- All Implemented Interfaces:
DialogDefaultsInterface
,java.awt.event.ActionListener
,java.awt.event.FocusListener
,java.awt.event.ItemListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.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 javax.swing.JDialog implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.FocusListener, java.awt.event.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JDialogBase.CancelAction
Handler for keys which should invoke the Cancel button (such as ESC).protected class
JDialogBase.HelpAction
Handler for keys which should invoke the Help button (such as F1).protected class
JDialogBase.OKAction
Handler for keys which should invoke the OK button (such as ENTER).-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ABOUT_MIPAV
Access about mipav panelprotected javax.swing.JButton
applyButton
Apply button is used to apply the setting of the dialog.protected javax.swing.JMenuBar
bar
JMenuBar for loading/saving defaultsprotected javax.swing.JButton
cancelButton
Cancel button is used on most dialogs.boolean
cancelFlag
Flag indicating if the dialog had been cancelled or not.protected javax.swing.JButton
closeButton
Close button is used to close the dialog.protected static java.lang.String
HELP
Displays help this dialogprotected javax.swing.JButton
helpButton
Help button is used on most dialogs.private static java.lang.String
LOAD_DEFAULT
Loads default for this dialogprivate static java.lang.String
LOAD_PROFILE
Loads profile for this dialogprotected javax.swing.JPanel
mainDialogPanel
The main panel of the dialog.protected static int
NEW
NEW indicates a new image is created after the algorithm is run.protected javax.swing.JButton
OKButton
OK button is used on most dialogs.protected java.awt.Frame
parentFrame
Parent frame of this dialog, usually of type ViewJFrameImage.private java.util.ArrayList<java.lang.String>
profiles
List of existing default profiles for this dialogprotected ViewJProgressBar
progressBar
Progress bar that will listen to a dialog's algorithm (and reflect current progress)protected static int
REPLACE
REPLACE indicates the current image is replaced after algorithm is run.protected boolean
runInSeparateThread
Flag indicating if the algorithm should run in a separate thread.protected boolean
runningScriptFlag
Whether we are using this dialog as part of a script.protected boolean
runQuiet
Whether algorithm is running in quiet mode (such as part of a script, in headless environment, within other algorithm )private static java.lang.String
SAVE_DEFAULT
Saves default for this dialogprivate static java.lang.String
SAVE_PROFILE
Saves profile for this dialogprivate static long
serialVersionUID
Use serialVersionUID for interoperability.protected java.awt.Font
serif12
Fonts, same asMipavUtil.font12
andMipavUtil.font12B.
protected java.awt.Font
serif12B
Fonts, same asMipavUtil.font12
andMipavUtil.font12B.
protected VOIManagerInterface
voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JDialogBase()
Constructor that sets the dialog to not modal.JDialogBase(boolean modal)
Constructor that only sets the dialog to modal or not modal.JDialogBase(java.awt.Dialog parent, boolean modal)
Constructor that forwards the parent dialog whether or not the dialog is modal.JDialogBase(java.awt.Dialog parent, boolean modal, boolean displayMenu)
Constructor that forwards the parent dialog whether or not the dialog is modal.JDialogBase(java.awt.Frame parent, boolean modal)
Constructor that sets the parent frame of the dialog and whether or not the dialog is modal.JDialogBase(java.awt.Frame parent, boolean modal, boolean displayMenu)
Constructor that sets the parent frame of the dialog and whether or not the dialog is modal.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
protected javax.swing.JButton
buildApplyButton()
Builds the cancel button.protected javax.swing.JPanel
buildButtons()
Builds button panel consisting of OK, Cancel and Help buttons.protected javax.swing.JButton
buildCancelButton()
Builds the cancel button.static javax.swing.JButton
buildCancelButton(java.lang.String actionCommand, java.awt.event.ActionListener parent)
protected javax.swing.JButton
buildCloseButton()
Builds the close button.protected javax.swing.JButton
buildHelpButton()
Builds the help button.protected javax.swing.JComboBox
buildImageComboBox(ModelImage image)
Builds a list of images.protected javax.swing.JButton
buildOKButton()
Builds the OK button.static javax.swing.JButton
buildOKButton(java.lang.String actionCommand, java.awt.event.ActionListener parent)
Builds the OK button.protected javax.swing.JPanel
buildOKCancelButtons()
Builds button panel consisting of OK, Cancel and Help buttons.static javax.swing.border.TitledBorder
buildTitledBorder(java.lang.String title)
Builds a titled border with the given title, an etched border, and the proper font and color.static javax.swing.border.TitledBorder
buildTitledBorder(java.lang.String title, java.awt.Color color)
Builds a titled border with the given title, an etched border, and the proper font and color.protected javax.swing.JLabel
createLabel(java.lang.String title)
Helper method to create a label with the proper font and font color.private void
createMenu()
protected void
createProgressBar(java.lang.String title, AlgorithmBase pListener)
Creates the progress bar that will listen to an algorithm's progress changesprotected void
createProgressBar(java.lang.String title, java.lang.String msg, AlgorithmBase pListener)
Creates the progress bar (should be created within JDialog's callAlgorithm methodprotected javax.swing.JTextField
createTextField(java.lang.String title)
Helper method to create a text field with the proper font and font color.void
focusGained(java.awt.event.FocusEvent event)
Unchanged.void
focusLost(java.awt.event.FocusEvent event)
Unchanged.private java.lang.String
getComponentName(java.awt.Component comp, java.lang.String longName, java.lang.String profile)
private static java.lang.String
getComponentName(java.lang.Object parentClassObject, java.awt.Component comp, java.lang.String longName, java.lang.String profile)
protected java.lang.String
getDialogName()
Returns the name of the dialog (e.g.boolean
isCancelled()
Accessor that returns whether or not the dialog has been cancelled.boolean
isQuietRunning()
boolean
isRunInSeparateThread()
Returns whether this dialog's algorithm should be run in a new thread.boolean
isScriptRunning()
Returns whether the current dialog is being run from within a script.void
itemStateChanged(java.awt.event.ItemEvent event)
Unchanged.private boolean
loadComponents(java.awt.Component comp, java.lang.String name, java.lang.String profile)
void
loadDefaults()
Loads the defaults of profile 0.boolean
loadDefaults(java.lang.String profileStr)
Loads default values for gui components in the dialog.private java.util.ArrayList<java.lang.String>
loadProfiles()
Loads profile names that are available for the dialogstatic java.lang.String
makeImageName(java.lang.String image_name, java.lang.String ext)
Helper method for making the result image's name.java.lang.String
makeString(float number, int decPts)
Makes a string of a floating point number with a specific number of decimal points.protected ViewJFrameImage
openNewFrame(ModelImage image)
JDialogs that create result image's in new frame should call this method instead of creating a new ViewJFrameImageprivate void
saveComponents(java.awt.Component comp, java.lang.String name, java.lang.String profile)
void
saveDefaults()
Saves the defaults of profile 0.void
saveDefaults(java.lang.String profile)
Saves the defaults of the dialog base to the mipav preferences file, assigning it to the given profile name.void
setLeftHandSystem(boolean leftHandSys)
Sets the left-hand coordinate flag.void
setQuietRunning(boolean runQuiet)
void
setScriptRunning(boolean flag)
Sets whether the dialog is being run by a script.void
setSeparateThread(boolean flag)
Accessor that sets the separate thread flag.void
setVisible()
Makes the dialog visible in center of screen.void
setVisible(boolean status)
Makes the dialog visible in center of screen.void
setVisibleMenuBar(boolean visible)
void
setVisibleStandard(boolean status)
Makes the dialog visible by calling super method.void
setVOIManager(VOIManagerInterface voiManager)
Sets the VOIManagerInterfacevoid
setWCSystem(boolean wcSys)
Sets the world coordinate flag.static boolean
testParameter(java.lang.String str, double minValue, double maxValue)
Tests that the entered parameter is in range from [minValue, maxValue].static boolean
testParameterMin(java.lang.String str, double minValue)
Tests that the entered parameter is larger than the specified value.static void
updateFFTFileInfo(ModelImage image, ModelImage resultImage, int type)
Copy important file information to resultant image structure.static void
updateFileInfo(ModelImage image, ModelImage resultImage)
Copy important file information to resultant image structure.static void
updateFileInfoOtherModality(ModelImage image, ModelImage resultImage)
Copy important file information to resultant image structure.static 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).static void
updateFileInfoStatic(ModelImage image, ModelImage resultImage)
Copy important file information to resultant image structure.static void
updateFileTypeInfo(ModelImage image, int type)
Copy important file information to resultant image structure, including data type.static void
updateFileTypeInfo(ModelImage image, ModelImage resultImage, int type)
Copy important file information to resultant image structure, including data type.void
windowActivated(java.awt.event.WindowEvent event)
Unchanged.void
windowClosed(java.awt.event.WindowEvent event)
Unchanged.void
windowClosing(java.awt.event.WindowEvent event)
Disposes of error dialog, then frame.void
windowDeactivated(java.awt.event.WindowEvent event)
Unchanged.void
windowDeiconified(java.awt.event.WindowEvent event)
Unchanged.void
windowIconified(java.awt.event.WindowEvent event)
Unchanged.void
windowOpened(java.awt.event.WindowEvent event)
Unchanged.-
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
REPLACE
protected static final int REPLACE
REPLACE indicates the current image is replaced after algorithm is run.- See Also:
- Constant Field Values
-
NEW
protected static final int NEW
NEW indicates a new image is created after the algorithm is run.- See Also:
- Constant Field Values
-
LOAD_DEFAULT
private static final java.lang.String LOAD_DEFAULT
Loads default for this dialog- See Also:
- Constant Field Values
-
LOAD_PROFILE
private static final java.lang.String LOAD_PROFILE
Loads profile for this dialog- See Also:
- Constant Field Values
-
SAVE_DEFAULT
private static final java.lang.String SAVE_DEFAULT
Saves default for this dialog- See Also:
- Constant Field Values
-
SAVE_PROFILE
private static final java.lang.String SAVE_PROFILE
Saves profile for this dialog- See Also:
- Constant Field Values
-
HELP
protected static final java.lang.String HELP
Displays help this dialog- See Also:
- Constant Field Values
-
ABOUT_MIPAV
private static final java.lang.String ABOUT_MIPAV
Access about mipav panel- See Also:
- Constant Field Values
-
cancelFlag
public boolean cancelFlag
Flag indicating if the dialog had been cancelled or not.
-
applyButton
protected javax.swing.JButton applyButton
Apply button is used to apply the setting of the dialog.
-
cancelButton
protected javax.swing.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 javax.swing.JButton closeButton
Close button is used to close the dialog.
-
helpButton
protected javax.swing.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 javax.swing.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 javax.swing.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 java.awt.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 istrue
.
-
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 java.awt.Font serif12
Fonts, same asMipavUtil.font12
andMipavUtil.font12B.
-
serif12B
protected java.awt.Font serif12B
Fonts, same asMipavUtil.font12
andMipavUtil.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 javax.swing.JMenuBar bar
JMenuBar for loading/saving defaults
-
profiles
private java.util.ArrayList<java.lang.String> profiles
List of existing default profiles for this dialog
-
-
Constructor Detail
-
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(java.awt.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(java.awt.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(java.awt.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 theJDialog(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 themodal
- Modality of the dialog;true
means the user can't do anything until this dialog is diposed of.
-
JDialogBase
public JDialogBase(java.awt.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 theJDialog(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 themodal
- 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 Detail
-
createMenu
private void createMenu()
-
makeImageName
public static java.lang.String makeImageName(java.lang.String image_name, java.lang.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 nameext
- 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:
image
- Source image.resultImage
- Resultant image.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
focusGained
public void focusGained(java.awt.event.FocusEvent event)
Unchanged.- Specified by:
focusGained
in interfacejava.awt.event.FocusListener
- Parameters:
event
- FocusEvent
-
focusLost
public void focusLost(java.awt.event.FocusEvent event)
Unchanged.- Specified by:
focusLost
in interfacejava.awt.event.FocusListener
- Parameters:
event
- FocusEvent
-
getComponentName
private java.lang.String getComponentName(java.awt.Component comp, java.lang.String longName, java.lang.String profile)
-
getComponentName
private static java.lang.String getComponentName(java.lang.Object parentClassObject, java.awt.Component comp, java.lang.String longName, java.lang.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(java.awt.event.ItemEvent event)
Unchanged.- Specified by:
itemStateChanged
in interfacejava.awt.event.ItemListener
- Parameters:
event
- ItemEvent
-
loadComponents
private boolean loadComponents(java.awt.Component comp, java.lang.String name, java.lang.String profile)
-
loadDefaults
public void loadDefaults()
Loads the defaults of profile 0.- Specified by:
loadDefaults
in interfaceDialogDefaultsInterface
-
loadDefaults
public boolean loadDefaults(java.lang.String profileStr)
Loads default values for gui components in the dialog.
-
loadProfiles
private java.util.ArrayList<java.lang.String> loadProfiles()
Loads profile names that are available for the dialog- Returns:
-
makeString
public java.lang.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(java.awt.Component comp, java.lang.String name, java.lang.String profile)
-
saveDefaults
public void saveDefaults()
Saves the defaults of profile 0.- Specified by:
saveDefaults
in interfaceDialogDefaultsInterface
-
saveDefaults
public void saveDefaults(java.lang.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 classjava.awt.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(java.awt.event.WindowEvent event)
Unchanged.- Specified by:
windowActivated
in interfacejava.awt.event.WindowListener
- Parameters:
event
- WindowEvent
-
windowClosed
public void windowClosed(java.awt.event.WindowEvent event)
Unchanged.- Specified by:
windowClosed
in interfacejava.awt.event.WindowListener
- Parameters:
event
- WindowEvent
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent event)
Disposes of error dialog, then frame. Sets cancelled totrue
.- Specified by:
windowClosing
in interfacejava.awt.event.WindowListener
- Parameters:
event
- WindowEvent
-
windowDeactivated
public void windowDeactivated(java.awt.event.WindowEvent event)
Unchanged.- Specified by:
windowDeactivated
in interfacejava.awt.event.WindowListener
- Parameters:
event
- WindowEvent
-
windowDeiconified
public void windowDeiconified(java.awt.event.WindowEvent event)
Unchanged.- Specified by:
windowDeiconified
in interfacejava.awt.event.WindowListener
- Parameters:
event
- WindowEvent
-
windowIconified
public void windowIconified(java.awt.event.WindowEvent event)
Unchanged.- Specified by:
windowIconified
in interfacejava.awt.event.WindowListener
- Parameters:
event
- WindowEvent
-
windowOpened
public void windowOpened(java.awt.event.WindowEvent event)
Unchanged.- Specified by:
windowOpened
in interfacejava.awt.event.WindowListener
- Parameters:
event
- WindowEvent
-
buildApplyButton
protected javax.swing.JButton buildApplyButton()
Builds the cancel button. Sets it internally as well return the just-built button.- Returns:
- JButton apply button
-
buildButtons
protected javax.swing.JPanel buildButtons()
Builds button panel consisting of OK, Cancel and Help buttons.- Returns:
- JPanel that has ok, cancel, and help buttons
-
buildOKCancelButtons
protected javax.swing.JPanel buildOKCancelButtons()
Builds button panel consisting of OK, Cancel and Help buttons.- Returns:
- JPanel that has ok, cancel, and help buttons
-
buildCancelButton
protected javax.swing.JButton buildCancelButton()
Builds the cancel button. Sets it internally as well return the just-built button.- Returns:
- JButton cancel button
-
buildCancelButton
public static javax.swing.JButton buildCancelButton(java.lang.String actionCommand, java.awt.event.ActionListener parent)
-
buildCloseButton
protected javax.swing.JButton buildCloseButton()
Builds the close button. Sets it internally as well return the just-built button.- Returns:
- JButton close button
-
buildHelpButton
protected javax.swing.JButton buildHelpButton()
Builds the help button. Sets it internally as well return the just-built button.- Returns:
- JButton help button
-
buildImageComboBox
protected javax.swing.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 javax.swing.JButton buildOKButton(java.lang.String actionCommand, java.awt.event.ActionListener parent)
Builds the OK button. Sets it internally as well return the just-built button.- Returns:
- JButton ok button
-
buildOKButton
protected javax.swing.JButton buildOKButton()
Builds the OK button. Sets it internally as well return the just-built button.- Returns:
- JButton ok button
-
buildTitledBorder
public static javax.swing.border.TitledBorder buildTitledBorder(java.lang.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 javax.swing.border.TitledBorder buildTitledBorder(java.lang.String title, java.awt.Color color)
Builds a titled border with the given title, an etched border, and the proper font and color.- Parameters:
title
- Title of the bordercolor
- Color of the border- Returns:
- The titled border.
-
createLabel
protected javax.swing.JLabel createLabel(java.lang.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 javax.swing.JTextField createTextField(java.lang.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(java.lang.String title, AlgorithmBase pListener)
Creates the progress bar that will listen to an algorithm's progress changes- Parameters:
title
- progress bar's titlepListener
- algorithmbase that will notify progress updates to the pBar
-
createProgressBar
protected void createProgressBar(java.lang.String title, java.lang.String msg, AlgorithmBase pListener)
Creates the progress bar (should be created within JDialog's callAlgorithm method- Parameters:
title
- progress bar's titlemsg
- the message to display on the progress bar (initial setting)pListener
- the algorithm that will register the progress bar as a listener
-
getDialogName
protected java.lang.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(java.lang.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(java.lang.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.
-
-