Package gov.nih.mipav.view.dialogs
Class JDialogScriptableBase
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- gov.nih.mipav.view.dialogs.JDialogBase
-
- gov.nih.mipav.view.dialogs.JDialogScriptableBase
-
- All Implemented Interfaces:
ScriptableActionInterface
,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:
JDialog3DMosaicTo4DSlices
,JDialog4DImageCalculator
,JDialogActiveContoursWithoutEdges
,JDialogAdaptiveKuwaharaFilter
,JDialogAddMargins
,JDialogAGCIE
,JDialogAHE
,JDialogAHElocal
,JDialogAINDANE
,JDialogAnisotropicDiffusion
,JDialogAnonymizeImage
,JDialogAntigradient2
,JDialogAutoCorrelation
,JDialogAutoCovariance
,JDialogAutoSeedWatershed
,JDialogBarrelDistortion
,JDialogBGAndFGDistanceMap
,JDialogBGDistanceMap
,JDialogBilateralFilter
,JDialogBiorthogonalWavelets
,JDialogBM3D
,JDialogBorderClearing
,JDialogBottomHat
,JDialogBoundaryAttenuation
,JDialogBoxCount
,JDialogBrainSurfaceExtractor
,JDialogBRISK
,JDialogBulkImageCalculator
,JDialogCannyEdgeDetection
,JDialogCenterOfMass
,JDialogCenterOfMassRGB
,JDialogClose
,JDialogCoherenceEnhancingDiffusion
,JDialogColocalizationEM
,JDialogColocalizationRegression
,JDialogColorEdge
,JDialogColorSaturation
,JDialogConcat
,JDialogConcatMult2Dto3D
,JDialogConcatMult3Dto3D
,JDialogConcatMult3Dto4D
,JDialogConstrainedOAR3D
,JDialogContrastEnhancementUsingExposureFusion
,JDialogConvergenceField
,JDialogConvert3Dto4D
,JDialogConvert4Dto3D
,JDialogConvert4DtoMultiple3D
,JDialogConvert4DtoRGB
,JDialogConvertType
,JDialogCorrectSpacing
,JDialogCrop
,JDialogCropBoundaryParam
,JDialogCropPointParam
,JDialogCropTiltedCuboid
,JDialogCropTiltedRectangle
,JDialogCyclicPermutation
,JDialogDBSCANClusteringSegment
,JDialogDeconvolution
,JDialogDeleteObjects
,JDialogDemonsLite
,JDialogDEMRI3
,JDialogDicomTagSelector
,JDialogDilate
,JDialogDirectResample
,JDialogDiscreteCosineTransform
,JDialogDiscreteSineTransform
,JDialogDistanceMap
,JDialogDSC_MRI_toolbox
,JDialogEdgeDetection3D
,JDialogEdgeLaplacian
,JDialogEdgeNMSuppression
,JDialogEdgePreservingSmoothing
,JDialogEditCircleDiameter
,JDialogEditSquareLength
,JDialogEfficientWatershed
,JDialogEmbeddedConfidenceEdgeDetection
,JDialogEntropicEdgeDetection
,JDialogEntropyMinimization
,JDialogErode
,JDialogEvaluateMaskSegmentation
,JDialogEvaluateSegmentation
,JDialogExtractBrain
,JDialogExtractSlices
,JDialogExtractSlicesVolumes
,JDialogExtractSurfaceCubes
,JDialogFaceAnonymize
,JDialogFaceAnonymizerBET
,JDialogFacetModel
,JDialogFastMarching
,JDialogFFT
,JDialogFileInfoDICOM
,JDialogFillObjects
,JDialogFindEdges
,JDialogFIREEdgeExtraction
,JDialogFlip
,JDialogFrequencyFilter
,JDialogFRETBleedThrough
,JDialogFRETEfficiency
,JDialogFuzzMinDeAndChatterji
,JDialogFuzzyCMeans
,JDialogFuzzyConnectednessSegmentation
,JDialogFuzzyMinimization
,JDialogGaborFilter
,JDialogGaussianBlur
,JDialogGenerateGrid
,JDialogGenerateIsolines
,JDialogGradientInverseWeightedSmoothing
,JDialogGradientMagnitude
,JDialogGraphBasedSegmentation
,JDialogGuidedFilter
,JDialogHaarTransform
,JDialogHaralickTexture
,JDialogHarrisCornerDetector
,JDialogHarrisLaplace
,JDialogHartleyTransform
,JDialogHillClimbingWatershed
,JDialogHistogram2Dim
,JDialogHistogramMatch
,JDialogHistogramSliceMatch
,JDialogHistogramSummary
,JDialogHMRF_EM
,JDialogHomomorphicFilter
,JDialogHurstIndex
,JDialogIAGCWD
,JDialogIDObjects
,JDialogIHN3Correction
,JDialogImageCalculator
,JDialogImageMath
,JDialogImRegPOC
,JDialogIndependentComponents
,JDialogInsertMissingSlices
,JDialogInsertSlice
,JDialogInsertVolume
,JDialogInvert
,JDialogIsophoteCurvature
,JDialogKernelRegression
,JDialogKMeans
,JDialogLaplacian
,JDialogLawsTexture
,JDialogLightboxGen
,JDialogLLE
,JDialogLoadImage
,JDialogLocalNormalization
,JDialogLocalVariance
,JDialogLogSlopeMapping
,JDialogLowerCompletion
,JDialogLuminanceAdaptation
,JDialogMarkovSegment
,JDialogMarkovSmooth
,JDialogMask
,JDialogMatchImages
,JDialogMaximumIntensityProjection
,JDialogMaximumLikelihoodIteratedBlindDeconvolution
,JDialogMean
,JDialogMeanShiftClustering
,JDialogMeanShiftSegmentation
,JDialogMedian
,JDialogMidsagittal
,JDialogMode
,JDialogMorphologicalFilter
,JDialogMorphologicalGradient
,JDialogMorphologicalLaplacian
,JDialogMorphologicalReconstruction
,JDialogMosaicToSlices
,JDialogMRIShadingCorrection
,JDialogMSER
,JDialogMSFuzzyCMeans
,JDialogMultiResolutionBilateralFilter
,JDialogMultiResolutionGuidedFilter
,JDialogN4MRIBiasFieldCorrection
,JDialogNLMeans_filt2D
,JDialogNLNoiseReduction
,JDialogNMSuppression
,JDialogNoise
,JDialogNoiseLevel
,JDialogNonlocalMeansFilter
,JDialogOpen
,JDialogPadImages
,JDialogParticleAnalysisNew
,JDialogPbBoundaryDetection
,JDialogPhasePreservingDenoising
,JDialogPointArea
,JDialogPowerWatershed
,JDialogPrincipalComponents
,JDialogProstateBoundaryFeatureTrain
,JDialogProstateFeaturesClassification
,JDialogProstateFeaturesTrain
,JDialogProstateSaveFeatures
,JDialogPyWavelets
,JDialogQuantify
,JDialogQuantifyMask
,JDialogRandomizeSliceOrder
,JDialogRegionMergingViaBoundaryMelting
,JDialogRegionsFromPartialBorders
,JDialogRegistrationBSpline
,JDialogRegistrationLeastSquares
,JDialogRegistrationOAR25D
,JDialogRegistrationOAR2D
,JDialogRegistrationOAR35D
,JDialogRegistrationOAR3D
,JDialogRegistrationSIFT3D
,JDialogRegistrationTPSpline
,JDialogRegPatientPos
,JDialogRegularizedIsotropicDiffusion
,JDialogRemoveSlices
,JDialogRemoveTSlices
,JDialogReorient
,JDialogReplaceBlankSlicesWithAverages
,JDialogReplaceValue
,JDialogReslice
,JDialogRGBConcat
,JDialogRGBtoGray
,JDialogRGBtoGrays
,JDialogRGBtoHSB
,JDialogRotate
,JDialogRuleBasedContrastEnhancement
,JDialogScaleSaliency
,JDialogSCDSegmentation
,JDialogScriptableTransform
,JDialogSequentialScanningWatershed
,JDialogShortestPathWatershed
,JDialogShowCosts
,JDialogSIFT
,JDialogSIFTImageSimilarity
,JDialogSimulatedExposureFusion
,JDialogSkeletonize
,JDialogSlantTransform
,JDialogSliceAveraging
,JDialogSM2
,JDialogSobel
,JDialogSpectralClustering
,JDialogSplitAndMergeWatershed
,JDialogStandaloneScriptablePlugin
,JDialogStandardDeviationThreshold
,JDialogSubsample
,JDialogSubset
,JDialogSubtractVOI
,JDialogSwap34
,JDialogSwapDims
,JDialogSwapSlicesVolumes
,JDialogSWI
,JDialogSymmetricNearestNeighbor
,JDialogTamuraTexture
,JDialogTextureAnalysis
,JDialogTextureSegmentation
,JDialogThinning2D
,JDialogThreshold
,JDialogThresholdRGB
,JDialogTiltCorrection
,JDialogTimeFitting
,JDialogTopHat
,JDialogTransformBSpline
,JDialogTreMethod
,JDialogTreT2
,JDialogTrilateralFilter
,JDialogUltErode
,JDialogUnionFindComponentLabelling
,JDialogUnionFindWatershed
,JDialogUnsharpMask
,JDialogVesselEnhancement
,JDialogVOIHausdorffDistance
,JDialogVOILogicalOperations
,JDialogVOIStatistics
,JDialogVOIStats
,JDialogWalshHadamardTransform
,JDialogWatershed
,JDialogWaveletFuse
,JDialogWaveletMultiscaleProducts
,JDialogWaveletThreshold
public abstract class JDialogScriptableBase extends JDialogBase implements ScriptableActionInterface
All scriptable dialogs should inherit from this abstract class. It contains helper methods which make script running/recording easier.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
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 protected boolean
displayInNewFrame
protected boolean
isComplete
Indicates whether the scripted algorithm completed successfully.protected AlgorithmParameters
scriptParameters
Contains parameters used to run or record the dialog action, along with some common helper methods.private static long
serialVersionUID
Use serialVersionUID for interoperability.-
Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, 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 JDialogScriptableBase()
Passthrough to JDialogBase constructor.JDialogScriptableBase(boolean modal)
Passthrough to JDialogBase constructor.JDialogScriptableBase(java.awt.Dialog parent, boolean modal)
Passthrough to JDialogBase constructor.JDialogScriptableBase(java.awt.Dialog parent, boolean modal, boolean menuVisible)
Passthrough to JDialogBase constructor.JDialogScriptableBase(java.awt.Frame parent, boolean modal)
Passthrough to JDialogBase constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
callAlgorithm()
Starts the algorithm.protected void
doPostAlgorithmActions()
Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table).static java.lang.String
getDialogActionString(java.lang.Class<? extends JDialogScriptableBase> dialogClass)
Extracts the scripting action string which should be used for a given class.void
insertScriptLine()
If a script is being recorded and the action (read: algorithm) is done, add an entry for this action.protected boolean
isComplete()
Returns whether the algorithm completed successfully.void
scriptRun(ParameterTable parameters)
Sets up the action dialog state and then executes it.protected void
setComplete(boolean success)
Sets the flag to indicate whether the algorithm completed successfully.protected abstract void
setGUIFromParams()
Set the dialog GUI using the script parameters while running this algorithm as part of a script.protected abstract void
storeParamsFromGUI()
Record the parameters just used to run this algorithm in a script.-
Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
actionPerformed, buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
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
-
scriptParameters
protected AlgorithmParameters scriptParameters
Contains parameters used to run or record the dialog action, along with some common helper methods.
-
displayInNewFrame
protected boolean displayInNewFrame
-
isComplete
protected boolean isComplete
Indicates whether the scripted algorithm completed successfully. Used to retain the status after the dialog has finalized the algorithm handle(s) in algorithmPerformed.
-
-
Constructor Detail
-
JDialogScriptableBase
public JDialogScriptableBase()
Passthrough to JDialogBase constructor.- See Also:
JDialogBase
-
JDialogScriptableBase
public JDialogScriptableBase(boolean modal)
Passthrough to JDialogBase constructor.- Parameters:
modal
- Whether the dialog is modal.- See Also:
JDialogBase
-
JDialogScriptableBase
public JDialogScriptableBase(java.awt.Frame parent, boolean modal)
Passthrough to JDialogBase constructor.- Parameters:
parent
- The parent frame.modal
- Whether the dialog is modal.- See Also:
JDialogBase
-
JDialogScriptableBase
public JDialogScriptableBase(java.awt.Dialog parent, boolean modal)
Passthrough to JDialogBase constructor.- Parameters:
parent
- The parent dialog.modal
- Whether this dialog is modal.- See Also:
JDialogBase
-
JDialogScriptableBase
public JDialogScriptableBase(java.awt.Dialog parent, boolean modal, boolean menuVisible)
Passthrough to JDialogBase constructor.- Parameters:
parent
- The parent dialog.modal
- Whether this dialog is modal.menuVisible
- whether the preference loading menu should be displayed- See Also:
JDialogBase
-
-
Method Detail
-
getDialogActionString
public static final java.lang.String getDialogActionString(java.lang.Class<? extends JDialogScriptableBase> dialogClass)
Extracts the scripting action string which should be used for a given class.- Parameters:
dialogClass
- The class to get the script action string for (should be prefixed with JDialog).- Returns:
- The script action string (e.g., 'GaussianBlur' for 'gov.nih.mipav.view.dialogs.JDialogGaussianBlur').
-
insertScriptLine
public void insertScriptLine()
If a script is being recorded and the action (read: algorithm) is done, add an entry for this action.- Specified by:
insertScriptLine
in interfaceScriptableActionInterface
-
scriptRun
public void scriptRun(ParameterTable parameters) throws java.lang.IllegalArgumentException
Sets up the action dialog state and then executes it.- Specified by:
scriptRun
in interfaceScriptableActionInterface
- Parameters:
parameters
- Table of parameters for the script to use.- Throws:
java.lang.IllegalArgumentException
- If there is a problem with the action arguments.
-
callAlgorithm
protected abstract void callAlgorithm()
Starts the algorithm. Already exists in most algorithm dialogs. Should be called during scripted execution and regular operation.
-
setGUIFromParams
protected abstract void setGUIFromParams()
Set the dialog GUI using the script parameters while running this algorithm as part of a script.
-
storeParamsFromGUI
protected abstract void storeParamsFromGUI() throws ParserException
Record the parameters just used to run this algorithm in a script.- Throws:
ParserException
- If there is a problem creating/recording the new parameters.
-
doPostAlgorithmActions
protected void doPostAlgorithmActions()
Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table). Defaults to no action, override to actually have it do something.
-
setComplete
protected void setComplete(boolean success)
Sets the flag to indicate whether the algorithm completed successfully. Used to retain the status after the dialog has finalized the algorithm handle(s) in algorithmPerformed.- Parameters:
success
- True if the algorithm has finished successfully, false if it is not done yet or there was a problem.
-
isComplete
protected boolean isComplete()
Returns whether the algorithm completed successfully. Used to retain the status after the dialog has finalized the algorithm handle(s) in algorithmPerformed.- Returns:
- True if the algorithm has finished successfully, false if it is not done yet or there was a problem.
-
-