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,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,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,JDialogLargestCircle,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,JDialogMotionDetection,JDialogMRIShadingCorrection,JDialogMSER,JDialogMSFuzzyCMeans,JDialogMultiResolutionBilateralFilter,JDialogMultiResolutionGuidedFilter,JDialogMultiScaleHornSchunk,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,JDialogSingleScaleHornSchunk,JDialogSkeletonize,JDialogSlantTransform,JDialogSliceAveraging,JDialogSM2,JDialogSobel,JDialogSpatialBroxOpticalFlow,JDialogSpectralClustering,JDialogSplitAndMergeWatershed,JDialogStandaloneScriptablePlugin,JDialogStandardDeviationThreshold,JDialogSubsample,JDialogSubset,JDialogSubtractVOI,JDialogSwap34,JDialogSwapDims,JDialogSwapSlicesVolumes,JDialogSWI,JDialogSymmetricNearestNeighbor,JDialogTamuraTexture,JDialogTemporalBroxOpticalFlow,JDialogTextureAnalysis,JDialogTextureSegmentation,JDialogThinning2D,JDialogThreshold,JDialogThresholdRGB,JDialogTiltCorrection,JDialogTimeFitting,JDialogTopHat,JDialogTransformBSpline,JDialogTreMethod,JDialogTreT2,JDialogTrilateralFilter,JDialogTVL1FLOW,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:
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested 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 TypeFieldDescriptionprotected booleanprotected booleanIndicates whether the scripted algorithm completed successfully.protected AlgorithmParametersContains parameters used to run or record the dialog action, along with some common helper methods.private static final longUse 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, voiManagerFields 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
ConstructorsConstructorDescriptionPassthrough to JDialogBase constructor.JDialogScriptableBase(boolean modal) Passthrough to JDialogBase constructor.JDialogScriptableBase(Dialog parent, boolean modal) Passthrough to JDialogBase constructor.JDialogScriptableBase(Dialog parent, boolean modal, boolean menuVisible) Passthrough to JDialogBase constructor.JDialogScriptableBase(Frame parent, boolean modal) Passthrough to JDialogBase constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidStarts the algorithm.protected voidUsed to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table).static final StringgetDialogActionString(Class<? extends JDialogScriptableBase> dialogClass) Extracts the scripting action string which should be used for a given class.voidIf a script is being recorded and the action (read: algorithm) is done, add an entry for this action.protected booleanReturns whether the algorithm completed successfully.voidscriptRun(ParameterTable parameters) Sets up the action dialog state and then executes it.protected voidsetComplete(boolean success) Sets the flag to indicate whether the algorithm completed successfully.protected abstract voidSet the dialog GUI using the script parameters while running this algorithm as part of a script.protected abstract voidRecord 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, windowOpenedMethods 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:
-
scriptParameters
Contains parameters used to run or record the dialog action, along with some common helper methods. -
displayInNewFrame
protected boolean displayInNewFrame -
isComplete
protected boolean isCompleteIndicates whether the scripted algorithm completed successfully. Used to retain the status after the dialog has finalized the algorithm handle(s) in algorithmPerformed.
-
-
Constructor Details
-
JDialogScriptableBase
public JDialogScriptableBase()Passthrough to JDialogBase constructor.- See Also:
-
JDialogScriptableBase
public JDialogScriptableBase(boolean modal) Passthrough to JDialogBase constructor.- Parameters:
modal- Whether the dialog is modal.- See Also:
-
JDialogScriptableBase
Passthrough to JDialogBase constructor.- Parameters:
parent- The parent frame.modal- Whether the dialog is modal.- See Also:
-
JDialogScriptableBase
Passthrough to JDialogBase constructor.- Parameters:
parent- The parent dialog.modal- Whether this dialog is modal.- See Also:
-
JDialogScriptableBase
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:
-
-
Method Details
-
getDialogActionString
public static final String getDialogActionString(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:
insertScriptLinein interfaceScriptableActionInterface
-
scriptRun
Sets up the action dialog state and then executes it.- Specified by:
scriptRunin interfaceScriptableActionInterface- Parameters:
parameters- Table of parameters for the script to use.- Throws:
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
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.
-