Class JDialogColorSaturation

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

public class JDialogColorSaturation extends JDialogScriptableBase implements AlgorithmInterface
Dialog for adjusting color saturation
See Also:
  • Field Details

    • csAlgo

      private AlgorithmColorSaturation csAlgo
      DOCUMENT ME!
    • image

      private ModelImage image
      Source image.
    • resultImage

      private ModelImage resultImage
      Result image.
    • paramsPanel

      private JPanel paramsPanel
      DOCUMENT ME!
    • a

      private float a
    • mainLabel

      private JLabel mainLabel
    • mainLabel2

      private JLabel mainLabel2
    • mainLabel3

      private JLabel mainLabel3
    • mainLabel4

      private JLabel mainLabel4
    • mainLabel5

      private JLabel mainLabel5
    • aLabel

      private JLabel aLabel
    • aText

      private JTextField aText
  • Constructor Details

    • JDialogColorSaturation

      public JDialogColorSaturation()
      Empty constructor needed for dynamic instantiation.
    • JDialogColorSaturation

      public JDialogColorSaturation(Frame theParentFrame, ModelImage im)
      Construct the saturation adjustment dialog.
      Parameters:
      theParentFrame - Parent frame.
      im - Source image.
  • Method Details

    • actionPerformed

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

      public void algorithmPerformed(AlgorithmBase algorithm)
      This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithm 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.
    • getResultImage

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

      public void setA(float a)
      Accessor that sets a.
      Parameters:
      a - .
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the Color Saturation Adjustment algorithm based on what type of image this is
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • doPostAlgorithmActions

      protected void doPostAlgorithmActions()
      Perform any actions required after the running of the algorithm is complete.
      Overrides:
      doPostAlgorithmActions in class JDialogScriptableBase
    • setGUIFromParams

      protected void setGUIFromParams()
      Set up the dialog GUI based on the parameters before running the algorithm as part of a script.
      Specified by:
      setGUIFromParams in class JDialogScriptableBase
    • storeParamsFromGUI

      protected void storeParamsFromGUI() throws ParserException
      Store the parameters from the dialog to record the execution of this algorithm.
      Specified by:
      storeParamsFromGUI in class JDialogScriptableBase
      Throws:
      ParserException - If there is a problem creating one of the new parameters.
    • 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.