Class Polygon


public class Polygon extends DrawableElement
Polygon is a drawable element, without an x and y coordinate.
  • Constructor Details

    • Polygon

      public Polygon()
  • Method Details

    • addPoint

      public void addPoint(int x, int y)
      Add a point to the polygon
      Parameters:
      x - X-coordinate
      y - Y-coordinate
    • getPoints

      public List<Point> getPoints()
      Get a list with all points in the polygon
      Returns:
      List with all points
    • draw

      public void draw(Graphics2D g)
      Specified by:
      draw in class CanvasElement
    • getBorderSize

      public int getBorderSize()
    • getFillColor

      public Color getFillColor()
    • hasBorder

      public boolean hasBorder()
    • hasFill

      public boolean hasFill()
    • setFillColor

      public void setFillColor(Color fillColor)
    • setBorder

      public void setBorder(int borderSize, Color borderColor)