Class JDialogConvertType

  • All Implemented Interfaces:
    AlgorithmInterface, 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

    public class JDialogConvertType
    extends JDialogScriptableBase
    implements AlgorithmInterface, java.awt.event.ItemListener
    Simple dialog to convert the type of an image.
    Version:
    1.0 Jan 25, 1999
    Author:
    Matthew J. McAuliffe, Ph.D.
    See Also:
    Serialized Form
    • 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
      JDialogConvertType()
      Empty constructor needed for dynamic instantiation (used during scripting).
      JDialogConvertType​(java.awt.Frame theParentFrame, ModelImage _image)
      Creates new dialog for converting type of image.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Closes dialog box when the OK button is pressed and sets the variables.
      void algorithmPerformed​(AlgorithmBase algorithm)
      This method is required if the AlgorithmPerformed interface is implemented.
      protected void callAlgorithm()
      Once all the necessary variables are set, call the Change Type algorithm based on what type of image this is and whether or not there is a separate destination image.
      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).
      int getDataType()
      Accessor that returns the data type.
      ModelImage getResultImage()
      Accessor that returns the image.
      private void init()
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
      void itemStateChanged​(java.awt.event.ItemEvent event)
      Sets the flags for the checkboxes and resets labels.
      void setDataType​(int type)
      Accessor that sets the data type for what the converted image is to be.
      void setDefaultRanges()
      Sets the default values for the input and output range.
      void setDisplayLocNew()
      Accessor that sets the display loc variable to new, so that a new image is created once the algorithm completes.
      void setDisplayLocReplace()
      Accessor that sets the display loc variable to replace, so the current image is replaced once the algorithm completes.
      void setEndianess​(boolean endns)
      Accessor that sets the endianess.
      protected void setGUIFromParams()
      Set the dialog GUI using the script parameters while running this algorithm as part of a script.
      void setInputRangeMax​(double max)
      Accessor that sets the maximum input range to the parameter.
      void setInputRangeMin​(double min)
      Accessor that sets the minimum input range to the parameter.
      void setOutputRangeMax​(double max)
      Accessor that sets the maximum output range to the parameter.
      void setOutputRangeMin​(double min)
      Accessor that sets the minimum output range to the parameter.
      void setUseDefaultRanges​(boolean useDefault)
      Accessor that sets the useDefaultRanges to the parameter.
      private boolean setVariables()
      Use the GUI results to set up the variables needed to run the algorithm.
      protected 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
      • bigEnd

        private javax.swing.JRadioButton bigEnd
        DOCUMENT ME!
      • dataType

        private int dataType
        DOCUMENT ME!
      • displayLoc

        private int displayLoc
        DOCUMENT ME!
      • endianess

        private boolean endianess
        DOCUMENT ME!
      • fullRangeRadio

        private javax.swing.JRadioButton fullRangeRadio
        DOCUMENT ME!
      • inEnd

        private javax.swing.JLabel inEnd
        DOCUMENT ME!
      • inMin

        private double inMin
        DOCUMENT ME!
      • inMax

        private double inMax
        DOCUMENT ME!
      • inputRangeGroup

        private javax.swing.ButtonGroup inputRangeGroup
        DOCUMENT ME!
      • inStart

        private javax.swing.JLabel inStart
        DOCUMENT ME!
      • inTempMin

        private double inTempMin
        DOCUMENT ME!
      • inTempMax

        private double inTempMax
        DOCUMENT ME!
      • littleEnd

        private javax.swing.JRadioButton littleEnd
        DOCUMENT ME!
      • newImage

        private javax.swing.JRadioButton newImage
        DOCUMENT ME!
      • outEnd

        private javax.swing.JLabel outEnd
        DOCUMENT ME!
      • outMin

        private double outMin
        DOCUMENT ME!
      • outMax

        private double outMax
        DOCUMENT ME!
      • outStart

        private javax.swing.JLabel outStart
        DOCUMENT ME!
      • outTempMin

        private double outTempMin
        DOCUMENT ME!
      • outTempMax

        private double outTempMax
        DOCUMENT ME!
      • processIndep

        private boolean processIndep
        DOCUMENT ME!
      • processIndepBox

        private javax.swing.JCheckBox processIndepBox
        DOCUMENT ME!
      • radioARGB

        private javax.swing.JRadioButton radioARGB
        DOCUMENT ME!
      • radioARGB_FLOAT

        private javax.swing.JRadioButton radioARGB_FLOAT
        DOCUMENT ME!
      • radioARGB_USHORT

        private javax.swing.JRadioButton radioARGB_USHORT
        DOCUMENT ME!
      • radioComplex

        private javax.swing.JRadioButton radioComplex
      • radioDComplex

        private javax.swing.JRadioButton radioDComplex
      • radioBool

        private javax.swing.JRadioButton radioBool
        DOCUMENT ME!
      • radioByte

        private javax.swing.JRadioButton radioByte
        DOCUMENT ME!
      • radioDouble

        private javax.swing.JRadioButton radioDouble
        DOCUMENT ME!
      • radioFloat

        private javax.swing.JRadioButton radioFloat
        DOCUMENT ME!
      • radioInt

        private javax.swing.JRadioButton radioInt
        DOCUMENT ME!
      • radioLong

        private javax.swing.JRadioButton radioLong
        DOCUMENT ME!
      • radioShort

        private javax.swing.JRadioButton radioShort
        DOCUMENT ME!
      • radioUByte

        private javax.swing.JRadioButton radioUByte
        DOCUMENT ME!
      • radioUInt

        private javax.swing.JRadioButton radioUInt
        DOCUMENT ME!
      • radioUShort

        private javax.swing.JRadioButton radioUShort
        DOCUMENT ME!
      • replaceImage

        private javax.swing.JRadioButton replaceImage
        DOCUMENT ME!
      • resultImage

        private ModelImage resultImage
        DOCUMENT ME!
      • textInEnd

        private javax.swing.JTextField textInEnd
        DOCUMENT ME!
      • textInStart

        private javax.swing.JTextField textInStart
        DOCUMENT ME!
      • textOutEnd

        private javax.swing.JTextField textOutEnd
        DOCUMENT ME!
      • textOutStart

        private javax.swing.JTextField textOutStart
        DOCUMENT ME!
      • titles

        private java.lang.String[] titles
        DOCUMENT ME!
      • useDefaultRanges

        private boolean useDefaultRanges
        DOCUMENT ME!
      • userRangeRadio

        private javax.swing.JRadioButton userRangeRadio
        DOCUMENT ME!
    • Constructor Detail

      • JDialogConvertType

        public JDialogConvertType()
        Empty constructor needed for dynamic instantiation (used during scripting).
      • JDialogConvertType

        public JDialogConvertType​(java.awt.Frame theParentFrame,
                                  ModelImage _image)
        Creates new dialog for converting type of image.
        Parameters:
        theParentFrame - Parent frame.
        _image - Source image.
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Closes dialog box when the OK button is pressed and sets the variables.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        event - Event that triggers this function
      • algorithmPerformed

        public void algorithmPerformed​(AlgorithmBase algorithm)
        This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithms when it has completed or failed to to complete, so that the dialog can be display the result image and/or clean up.
        Specified by:
        algorithmPerformed in interface AlgorithmInterface
        Parameters:
        algorithm - Algorithm that caused the event.
      • getDataType

        public int getDataType()
        Accessor that returns the data type.
        Returns:
        the data type
      • getResultImage

        public ModelImage getResultImage()
        Accessor that returns the image.
        Returns:
        The result image.
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent event)
        Sets the flags for the checkboxes and resets labels.
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
        Overrides:
        itemStateChanged in class JDialogBase
        Parameters:
        event - Event that triggered this function.
      • setDataType

        public void setDataType​(int type)
        Accessor that sets the data type for what the converted image is to be.
        Parameters:
        type - New data type.
      • setDefaultRanges

        public void setDefaultRanges()
        Sets the default values for the input and output range.
      • setDisplayLocNew

        public void setDisplayLocNew()
        Accessor that sets the display loc variable to new, so that a new image is created once the algorithm completes.
      • setDisplayLocReplace

        public void setDisplayLocReplace()
        Accessor that sets the display loc variable to replace, so the current image is replaced once the algorithm completes.
      • setEndianess

        public void setEndianess​(boolean endns)
        Accessor that sets the endianess.
        Parameters:
        endns - Endianess.
      • setInputRangeMax

        public void setInputRangeMax​(double max)
        Accessor that sets the maximum input range to the parameter.
        Parameters:
        max - Maximum input range.
      • setInputRangeMin

        public void setInputRangeMin​(double min)
        Accessor that sets the minimum input range to the parameter.
        Parameters:
        min - Minimum input range.
      • setOutputRangeMax

        public void setOutputRangeMax​(double max)
        Accessor that sets the maximum output range to the parameter.
        Parameters:
        max - Maximum output range.
      • setOutputRangeMin

        public void setOutputRangeMin​(double min)
        Accessor that sets the minimum output range to the parameter.
        Parameters:
        min - Minimum output range.
      • setUseDefaultRanges

        public void setUseDefaultRanges​(boolean useDefault)
        Accessor that sets the useDefaultRanges to the parameter.
        Parameters:
        useDefault - Value for useDefaultRanges variable.
      • callAlgorithm

        protected void callAlgorithm()
        Once all the necessary variables are set, call the Change Type algorithm based on what type of image this is and whether or not there is a separate destination image.
        Specified by:
        callAlgorithm in class JDialogScriptableBase
      • 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.
        Overrides:
        doPostAlgorithmActions in class JDialogScriptableBase
      • setGUIFromParams

        protected void setGUIFromParams()
        Set the dialog GUI using the script parameters while running this algorithm as part of a script.
        Specified by:
        setGUIFromParams in class JDialogScriptableBase
      • init

        private void init()
        Sets up the GUI (panels, buttons, etc) and displays it on the screen.
      • setVariables

        private boolean setVariables()
        Use the GUI results to set up the variables needed to run the algorithm.
        Returns:
        true if parameters set successfully, false otherwise.