Class JDialogReplaceValue

All Implemented Interfaces:
AlgorithmInterface, ScriptableActionInterface, DialogDefaultsInterface, ActionDiscovery, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

Dialog which replaces all occurances of one value in an image with another value. The value replaced may be NaN, -Inf, Inf, or a real number. The replacement value must be a real number.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • algoReplace

      private AlgorithmReplaceValue algoReplace
      DOCUMENT ME!
    • displayLoc

      private int displayLoc
      DOCUMENT ME!
    • entireImage

      private boolean entireImage
    • image

      private ModelImage image
      DOCUMENT ME!
    • inputVal

      private double inputVal
      DOCUMENT ME!
    • newImage

      private JRadioButton newImage
      DOCUMENT ME!
    • outputField

      private JTextField outputField
      DOCUMENT ME!
    • outputVal

      private double outputVal
      DOCUMENT ME!
    • rangeString

      private String rangeString
      DOCUMENT ME!
    • rangesVector

      private Vector<JDialogReplaceValue.Values> rangesVector
      DOCUMENT ME!
    • replaceImage

      private JRadioButton replaceImage
      DOCUMENT ME!
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • setChoiceBox

      private JComboBox setChoiceBox
      DOCUMENT ME!
    • setChoiceButton

      private JRadioButton setChoiceButton
      DOCUMENT ME!
    • userDefinedButton

      private JRadioButton userDefinedButton
      DOCUMENT ME!
    • userDefinedField

      private JTextField userDefinedField
      DOCUMENT ME!
    • outputOptionsPanel

      private JPanelAlgorithmOutputOptions outputOptionsPanel
  • Constructor Details

    • JDialogReplaceValue

      public JDialogReplaceValue()
      Empty constructor used for running scripts.
    • JDialogReplaceValue

      public JDialogReplaceValue(Frame frame, ModelImage img)
      Construct the replace value dialog window and wait for user action.
      Parameters:
      frame - the window this dialog is attached to
      img - the image to process
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Invoked when an action occurs.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      e - ActionEvent
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algo)
      If the destination image is not null, put in frame.
      Specified by:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algo - AlgorithmBase algorithm that was performed
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Handle selection changes to the user defined value/preset radio buttons.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      event - the event to handle
    • callAlgorithm

      protected void callAlgorithm()
      Calls the algorithm.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • doPostAlgorithmActions

      protected void doPostAlgorithmActions()
      Store the result image in the script runner's image table now that the action execution is finished.
      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
    • storeParamsFromGUI

      protected void storeParamsFromGUI() throws ParserException
      Record the parameters just used to run this algorithm in a script.
      Specified by:
      storeParamsFromGUI in class JDialogScriptableBase
      Throws:
      ParserException - If there is a problem creating/recording the new parameters.
    • init

      private void init()
      Set up the dialog GUI.
    • parseRanges

      private boolean parseRanges()
      DOCUMENT ME!
      Returns:
      boolean
    • setVariables

      private boolean setVariables()
      Sets up the algorithm's parameters.
      Returns:
      DOCUMENT ME!
    • getActionMetadata

      public ActionMetadata getActionMetadata()
      Return meta-information about this discoverable action for categorization and labeling purposes.
      Specified by:
      getActionMetadata in interface ActionDiscovery
      Returns:
      Metadata for this action.
    • createInputParameters

      public ParameterTable createInputParameters()
      Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used in setGUIFromParams()).
      Specified by:
      createInputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the inputs of this algorithm.
    • createOutputParameters

      public ParameterTable createOutputParameters()
      Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).
      Specified by:
      createOutputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the outputs of this algorithm.
    • getOutputImageName

      public String getOutputImageName(String imageParamName)
      Returns the name of an image output by this algorithm, the image returned depends on the parameter label given (which can be used to retrieve the image object from the image registry).
      Specified by:
      getOutputImageName in interface ActionDiscovery
      Parameters:
      imageParamName - The output image parameter label for which to get the image name.
      Returns:
      The image name of the requested output image parameter label.
    • isActionComplete

      public boolean isActionComplete()
      Returns whether the action has successfully completed its execution.
      Specified by:
      isActionComplete in interface ActionDiscovery
      Returns:
      True, if the action is complete. False, if the action failed or is still running.