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,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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classHandler for keys which should invoke the Cancel button (such as ESC).protected classHandler for keys which should invoke the Help button (such as F1).protected classHandler for keys which should invoke the OK button (such as ENTER).Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringAccess about mipav panelprotected JButtonApply button is used to apply the setting of the dialog.protected JMenuBarJMenuBar for loading/saving defaultsprotected JButtonCancel button is used on most dialogs.booleanFlag indicating if the dialog had been cancelled or not.protected JButtonClose button is used to close the dialog.protected static final StringDisplays help this dialogprotected JButtonHelp button is used on most dialogs.private static final StringLoads default for this dialogprivate static final StringLoads profile for this dialogprotected JPanelThe main panel of the dialog.protected static final intNEW indicates a new image is created after the algorithm is run.protected JButtonOK button is used on most dialogs.protected FrameParent frame of this dialog, usually of type ViewJFrameImage.List of existing default profiles for this dialogprotected ViewJProgressBarProgress bar that will listen to a dialog's algorithm (and reflect current progress)protected static final intREPLACE indicates the current image is replaced after algorithm is run.protected booleanFlag indicating if the algorithm should run in a separate thread.protected booleanWhether we are using this dialog as part of a script.protected booleanWhether algorithm is running in quiet mode (such as part of a script, in headless environment, within other algorithm )private static final StringSaves default for this dialogprivate static final StringSaves profile for this dialogprivate static final longUse serialVersionUID for interoperability.protected FontFonts, same asMipavUtil.font12andMipavUtil.font12B.protected FontFonts, same asMipavUtil.font12andMipavUtil.font12B.protected VOIManagerInterfaceFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionConstructor that sets the dialog to not modal.JDialogBase(boolean modal) Constructor that only sets the dialog to modal or not modal.JDialogBase(Dialog parent, boolean modal) Constructor that forwards the parent dialog whether or not the dialog is modal.JDialogBase(Dialog parent, boolean modal, boolean displayMenu) Constructor that forwards the parent dialog whether or not the dialog is modal.JDialogBase(Frame parent, boolean modal) Constructor that sets the parent frame of the dialog and whether or not the dialog is modal.JDialogBase(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
Modifier and TypeMethodDescriptionvoidprotected JButtonBuilds the cancel button.protected JPanelBuilds button panel consisting of OK, Cancel and Help buttons.protected JButtonBuilds the cancel button.static JButtonbuildCancelButton(String actionCommand, ActionListener parent) protected JButtonBuilds the close button.protected JButtonBuilds the help button.protected JComboBoxbuildImageComboBox(ModelImage image) Builds a list of images.protected JButtonBuilds the OK button.static JButtonbuildOKButton(String actionCommand, ActionListener parent) Builds the OK button.protected JPanelBuilds button panel consisting of OK, Cancel and Help buttons.static TitledBorderbuildTitledBorder(String title) Builds a titled border with the given title, an etched border, and the proper font and color.static TitledBorderbuildTitledBorder(String title, Color color) Builds a titled border with the given title, an etched border, and the proper font and color.protected JLabelcreateLabel(String title) Helper method to create a label with the proper font and font color.private voidprotected voidcreateProgressBar(String title, AlgorithmBase pListener) Creates the progress bar that will listen to an algorithm's progress changesprotected voidcreateProgressBar(String title, String msg, AlgorithmBase pListener) Creates the progress bar (should be created within JDialog's callAlgorithm methodprotected JTextFieldcreateTextField(String title) Helper method to create a text field with the proper font and font color.voidfocusGained(FocusEvent event) Unchanged.voidfocusLost(FocusEvent event) Unchanged.private StringgetComponentName(Component comp, String longName, String profile) private static StringgetComponentName(Object parentClassObject, Component comp, String longName, String profile) protected StringReturns the name of the dialog (e.g.booleanAccessor that returns whether or not the dialog has been cancelled.booleanbooleanReturns whether this dialog's algorithm should be run in a new thread.booleanReturns whether the current dialog is being run from within a script.voiditemStateChanged(ItemEvent event) Unchanged.private booleanloadComponents(Component comp, String name, String profile) voidLoads the defaults of profile 0.booleanloadDefaults(String profileStr) Loads default values for gui components in the dialog.Loads profile names that are available for the dialogstatic StringmakeImageName(String image_name, String ext) Helper method for making the result image's name.makeString(float number, int decPts) Makes a string of a floating point number with a specific number of decimal points.protected ViewJFrameImageopenNewFrame(ModelImage image) JDialogs that create result image's in new frame should call this method instead of creating a new ViewJFrameImageprivate voidsaveComponents(Component comp, String name, String profile) voidSaves the defaults of profile 0.voidsaveDefaults(String profile) Saves the defaults of the dialog base to the mipav preferences file, assigning it to the given profile name.voidsetLeftHandSystem(boolean leftHandSys) Sets the left-hand coordinate flag.voidsetQuietRunning(boolean runQuiet) voidsetScriptRunning(boolean flag) Sets whether the dialog is being run by a script.voidsetSeparateThread(boolean flag) Accessor that sets the separate thread flag.voidMakes the dialog visible in center of screen.voidsetVisible(boolean status) Makes the dialog visible in center of screen.voidsetVisibleMenuBar(boolean visible) voidsetVisibleStandard(boolean status) Makes the dialog visible by calling super method.voidsetVOIManager(VOIManagerInterface voiManager) Sets the VOIManagerInterfacevoidsetWCSystem(boolean wcSys) Sets the world coordinate flag.static booleantestParameter(String str, double minValue, double maxValue) Tests that the entered parameter is in range from [minValue, maxValue].static booleantestParameterMin(String str, double minValue) Tests that the entered parameter is larger than the specified value.static final voidupdateFFTFileInfo(ModelImage image, ModelImage resultImage, int type) Copy important file information to resultant image structure.static final voidupdateFileInfo(ModelImage image, ModelImage resultImage) Copy important file information to resultant image structure.static final voidupdateFileInfoOtherModality(ModelImage image, ModelImage resultImage) Copy important file information to resultant image structure.static final voidupdateFileInfoStatic(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 voidupdateFileInfoStatic(ModelImage image, ModelImage resultImage) Copy important file information to resultant image structure.static final voidupdateFileTypeInfo(ModelImage image, int type) Copy important file information to resultant image structure, including data type.static final voidupdateFileTypeInfo(ModelImage image, ModelImage resultImage, int type) Copy important file information to resultant image structure, including data type.voidwindowActivated(WindowEvent event) Unchanged.voidwindowClosed(WindowEvent event) Unchanged.voidwindowClosing(WindowEvent event) Disposes of error dialog, then frame.voidwindowDeactivated(WindowEvent event) Unchanged.voidwindowDeiconified(WindowEvent event) Unchanged.voidwindowIconified(WindowEvent event) Unchanged.voidwindowOpened(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, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, toFrontMethods 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, validateTreeMethods 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 Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
REPLACE
protected static final int REPLACEREPLACE indicates the current image is replaced after algorithm is run.- See Also:
-
NEW
protected static final int NEWNEW indicates a new image is created after the algorithm is run.- See Also:
-
LOAD_DEFAULT
Loads default for this dialog- See Also:
-
LOAD_PROFILE
Loads profile for this dialog- See Also:
-
SAVE_DEFAULT
Saves default for this dialog- See Also:
-
SAVE_PROFILE
Saves profile for this dialog- See Also:
-
HELP
Displays help this dialog- See Also:
-
ABOUT_MIPAV
Access about mipav panel- See Also:
-
cancelFlag
public boolean cancelFlagFlag indicating if the dialog had been cancelled or not. -
applyButton
Apply button is used to apply the setting of the dialog. -
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
Close button is used to close the dialog. -
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
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
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
Parent frame of this dialog, usually of type ViewJFrameImage. -
runInSeparateThread
protected boolean runInSeparateThreadFlag indicating if the algorithm should run in a separate thread. Default istrue. -
runningScriptFlag
protected boolean runningScriptFlagWhether we are using this dialog as part of a script. -
runQuiet
protected boolean runQuietWhether algorithm is running in quiet mode (such as part of a script, in headless environment, within other algorithm ) -
serif12
Fonts, same asMipavUtil.font12andMipavUtil.font12B. -
serif12B
Fonts, same asMipavUtil.font12andMipavUtil.font12B. -
progressBar
Progress bar that will listen to a dialog's algorithm (and reflect current progress) -
voiManager
-
bar
JMenuBar for loading/saving defaults -
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-trueindicates modal dialog,falseotherwise.
-
JDialogBase
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;truemeans the user can't do anything until this dialog is diposed of.
-
JDialogBase
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;truemeans 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
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;truemeans the user can't do anything until this dialog is diposed of.
-
JDialogBase
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;truemeans 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
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
Copy important file information to resultant image structure.- Parameters:
image- Source image.resultImage- Resultant image.
-
updateFileInfoStatic
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
- Specified by:
actionPerformedin interfaceActionListener
-
focusGained
Unchanged.- Specified by:
focusGainedin interfaceFocusListener- Parameters:
event- FocusEvent
-
focusLost
Unchanged.- Specified by:
focusLostin interfaceFocusListener- Parameters:
event- FocusEvent
-
getComponentName
-
getComponentName
-
isCancelled
public boolean isCancelled()Accessor that returns whether or not the dialog has been cancelled.- Returns:
trueindicates cancelled,falseindicates 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
Unchanged.- Specified by:
itemStateChangedin interfaceItemListener- Parameters:
event- ItemEvent
-
loadComponents
-
loadDefaults
public void loadDefaults()Loads the defaults of profile 0.- Specified by:
loadDefaultsin interfaceDialogDefaultsInterface
-
loadDefaults
Loads default values for gui components in the dialog. -
loadProfiles
Loads profile names that are available for the dialog- Returns:
-
makeString
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
-
saveDefaults
public void saveDefaults()Saves the defaults of profile 0.- Specified by:
saveDefaultsin interfaceDialogDefaultsInterface
-
saveDefaults
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-trueindicates run in separate thread,falseotherwise.
-
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:
setVisiblein classDialog- 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
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
Copy important file information to resultant image structure.- Parameters:
image- Source image.resultImage- Resultant image.
-
updateFileInfoOtherModality
Copy important file information to resultant image structure.- Parameters:
image- Source image.resultImage- Resultant image.
-
updateFileTypeInfo
Copy important file information to resultant image structure, including data type.- Parameters:
image- Source image.type- Data type to set in file info.
-
updateFileTypeInfo
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
Unchanged.- Specified by:
windowActivatedin interfaceWindowListener- Parameters:
event- WindowEvent
-
windowClosed
Unchanged.- Specified by:
windowClosedin interfaceWindowListener- Parameters:
event- WindowEvent
-
windowClosing
Disposes of error dialog, then frame. Sets cancelled totrue.- Specified by:
windowClosingin interfaceWindowListener- Parameters:
event- WindowEvent
-
windowDeactivated
Unchanged.- Specified by:
windowDeactivatedin interfaceWindowListener- Parameters:
event- WindowEvent
-
windowDeiconified
Unchanged.- Specified by:
windowDeiconifiedin interfaceWindowListener- Parameters:
event- WindowEvent
-
windowIconified
Unchanged.- Specified by:
windowIconifiedin interfaceWindowListener- Parameters:
event- WindowEvent
-
windowOpened
Unchanged.- Specified by:
windowOpenedin interfaceWindowListener- Parameters:
event- WindowEvent
-
buildApplyButton
Builds the cancel button. Sets it internally as well return the just-built button.- Returns:
- JButton apply button
-
buildButtons
Builds button panel consisting of OK, Cancel and Help buttons.- Returns:
- JPanel that has ok, cancel, and help buttons
-
buildOKCancelButtons
Builds button panel consisting of OK, Cancel and Help buttons.- Returns:
- JPanel that has ok, cancel, and help buttons
-
buildCancelButton
Builds the cancel button. Sets it internally as well return the just-built button.- Returns:
- JButton cancel button
-
buildCancelButton
-
buildCloseButton
Builds the close button. Sets it internally as well return the just-built button.- Returns:
- JButton close button
-
buildHelpButton
Builds the help button. Sets it internally as well return the just-built button.- Returns:
- JButton help button
-
buildImageComboBox
Builds a list of images. Returns combobox.- Parameters:
image- ModelImage to exclude from the box- Returns:
- Newly created combo box.
-
buildOKButton
Builds the OK button. Sets it internally as well return the just-built button.- Returns:
- JButton ok button
-
buildOKButton
Builds the OK button. Sets it internally as well return the just-built button.- Returns:
- JButton ok button
-
buildTitledBorder
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
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
Helper method to create a label with the proper font and font color.- Parameters:
title- Text of the label.- Returns:
- New label.
-
createTextField
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
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
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
Returns the name of the dialog (e.g. JDialogBase -> Base)- Returns:
- String dialog name
-
openNewFrame
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
Sets the VOIManagerInterface- Parameters:
voiManager-
-
testParameter
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:
trueif parameters passed range test,falseif failed.
-
testParameterMin
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:
trueif parameters passed range test,falseif failed.
-