Class JDialogBarrelDistortion

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

public class JDialogBarrelDistortion extends JDialogScriptableBase implements AlgorithmInterface
Dialog for correcting barrel and/or pincushion distortion
See Also:
  • Field Details

    • bdAlgo

      private AlgorithmBarrelDistortion bdAlgo
      DOCUMENT ME!
    • image

      private ModelImage image
      Source image.
    • resultImage

      private ModelImage resultImage
      Result image.
    • paramsPanel

      private JPanel paramsPanel
      DOCUMENT ME!
    • a

      private float a
    • b

      private float b
    • c

      private float c
    • d

      private float d
    • mainLabel

      private JLabel mainLabel
    • mainLabel2

      private JLabel mainLabel2
    • aLabel

      private JLabel aLabel
    • bLabel

      private JLabel bLabel
    • cLabel

      private JLabel cLabel
    • dLabel

      private JLabel dLabel
    • aText

      private JTextField aText
    • bText

      private JTextField bText
    • cText

      private JTextField cText
    • dText

      private JTextField dText
    • noScalingDCheckBox

      private JCheckBox noScalingDCheckBox
    • noScalingD

      private boolean noScalingD
  • Constructor Details

    • JDialogBarrelDistortion

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

      public JDialogBarrelDistortion(Frame theParentFrame, ModelImage im)
      Construct the barrel/pin cushion correction 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.
    • setNoScalingD

      public void setNoScalingD(boolean noScalingD)
      Accessor that sets whether or not d is read in from the text or calculated from d = 1 - a - b - c. Calculation is used if it is desired that no image scaling occurs.
      Parameters:
      noScalingD - true indicates d = 1 - a - b - c for no image scaling.
    • setA

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

      public void setB(float b)
      Accessor that sets b.
      Parameters:
      b - .
    • setC

      public void setC(float c)
      Accessor that sets c.
      Parameters:
      c - .
    • setD

      public void setD(float d)
      Accessor that sets d.
      Parameters:
      d - .
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the Barrel/Pincushion Distortion Correction 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.