Class JDialogScriptableBase

    • Nested Class Summary

      • 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
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • 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 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 interface ScriptableActionInterface
      • scriptRun

        public void scriptRun​(ParameterTable parameters)
                       throws java.lang.IllegalArgumentException
        Sets up the action dialog state and then executes it.
        Specified by:
        scriptRun in interface ScriptableActionInterface
        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.