Class JDialogHoughCircle

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

public class JDialogHoughCircle extends JDialogBase implements AlgorithmInterface, ItemListener, WindowListener
Dialog to create Hough transform with x0, y0, rad output for circle detection in binary image, where (x - x0)**2 + (y - y0)**2 = rad**2
See Also:
  • Field Details

    • serialVersionUID

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

      private AlgorithmHoughCircle hAlgo
      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • x0

      private int x0
      DOCUMENT ME!
    • x0Text

      private JTextField x0Text
      DOCUMENT ME!
    • y0

      private int y0
      DOCUMENT ME!
    • y0Text

      private JTextField y0Text
    • rad

      private int rad
    • radText

      private JTextField radText
      DOCUMENT ME!
    • numCircles

      private int numCircles
    • numCirclesText

      private JTextField numCirclesText
  • Constructor Details

    • JDialogHoughCircle

      public JDialogHoughCircle(ModelImage image)
      Creates a new JDialogHoughCircle object.
      Parameters:
      image - DOCUMENT ME!
    • JDialogHoughCircle

      public JDialogHoughCircle(Frame theParentFrame, ModelImage im)
      Creates new 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.
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      itemStateChanged.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      event - DOCUMENT ME!
    • windowClosing

      public void windowClosing(WindowEvent event)
      Disposes of error dialog, then frame. Sets cancelled to true.
      Specified by:
      windowClosing in interface WindowListener
      Overrides:
      windowClosing in class JDialogBase
      Parameters:
      event - DOCUMENT ME!
    • callAlgorithm

      private void callAlgorithm()
      DOCUMENT ME!
    • init

      private void init()
      Initializes GUI components and displays dialog.
    • 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.