Class JDialogPolygonToRectangle

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

public class JDialogPolygonToRectangle extends JDialogBase implements AlgorithmInterface, ItemListener, WindowListener
Dialog to get user input of counterclockwise ordered polygon points, followed by selecting 4 of these vertices in counterclockwise order to be the corners of the rectangle. The first 2 vertices must select the long edge of a rectangle. The output xDim and yDim of rectangle created from transformed polygon
See Also:
  • Field Details

    • serialVersionUID

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

      private final int POLYGON_TO_RECTANGLE
      See Also:
    • CROSSRATIO_POLYGON_TO_RECTANGLE

      private final int CROSSRATIO_POLYGON_TO_RECTANGLE
      See Also:
    • algorithm

      private int algorithm
    • extents

      int[] extents
      DOCUMENT ME!
    • sAlgo

      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • xDim

      private int xDim
      DOCUMENT ME!
    • xSource

      private double[] xSource
      DOCUMENT ME!
    • xText

      private JTextField xText
      DOCUMENT ME!
    • yDim

      private int yDim
      DOCUMENT ME!
    • ySource

      private double[] ySource
      DOCUMENT ME!
    • corners

      private int[] corners
    • yText

      private JTextField yText
      DOCUMENT ME!
    • v0Text

      private JTextField v0Text
    • v1Text

      private JTextField v1Text
    • v2Text

      private JTextField v2Text
    • v3Text

      private JTextField v3Text
    • crossRatioCheckBox

      private JCheckBox crossRatioCheckBox
  • Constructor Details

    • JDialogPolygonToRectangle

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

      public JDialogPolygonToRectangle(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.