Package pointgon

Class PGPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PGPanel extends JPanel
Class for a pointgon viewer panel.
Since:
2005.02.20 (Christian Borgelt)
See Also:
  • Constructor Details

    • PGPanel

      public PGPanel()
      Create a pointgon viewer panel.
      Since:
      2005.02.20 (Christian Borgelt)
    • PGPanel

      public PGPanel(Pointgon pgon)
      Create a pointgon viewer panel.
      Parameters:
      pgon - the pointgon to display
      Since:
      2005.02.20 (Christian Borgelt)
  • Method Details

    • getPointgon

      public Pointgon getPointgon()
      Get the pointgon of the viewer panel.
      Returns:
      the pointgon of the viewer panel
      Since:
      2005.02.20 (Christian Borgelt)
    • setPointgon

      public void setPointgon(Pointgon pgon)
      Set the pointgon of the viewer panel.
      Parameters:
      pgon - the pointgon of the viewer panel
      Since:
      2005.02.20 (Christian Borgelt)
    • getScale

      public double getScale()
      Get the scale of the pointgon viewer panel.
      Returns:
      the scale of the viewer panel
      Since:
      2005.02.20 (Christian Borgelt)
    • setScale

      public void setScale(double scale)
      Set the scale of the pointgon viewer panel.
      Parameters:
      scale - the scale of the viewer panel
      Since:
      2005.02.20 (Christian Borgelt)
    • paint

      public void paint(Graphics g)
      Draw the panel contents.
      Overrides:
      paint in class JComponent
      Parameters:
      g - the graphics context
      Since:
      2005.02.20 (Christian Borgelt)
    • findVertex

      public Vertex findVertex(int x, int y)
      Find the closest vertex to a given point.
      Parameters:
      x - the x-coordinate of the point
      y - the y-coordinate of the point
      Returns:
      the closest vertex to the given point
      Since:
      2005.02.20 (Christian Borgelt)
    • findEdge

      public Edge findEdge(int x, int y)
      Find the closest edge to a given point.
      Parameters:
      x - the x-coordinate of the point
      y - the y-coordinate of the point
      Returns:
      the closest edge to the given point
      Since:
      2005.02.20 (Christian Borgelt)
    • makeImage

      public BufferedImage makeImage()
      Create an image of the panel contents.
      Returns:
      the created image
      Since:
      2005.02.20 (Christian Borgelt)