Class GPoly

All Implemented Interfaces:
Cloneable, Iterable<GPoint>
Direct Known Subclasses:
GRegPoly

public class GPoly extends GMultiPoint
Author:
Federico Vera <[email protected]>
  • Constructor Details

    • GPoly

      public GPoly(GPoly e)
      Copy constructor
      Parameters:
      e - GPoly to copy
      Throws:
      IllegalArgumentException - if e is null
    • GPoly

      public GPoly()
      Generates an empty polygon
    • GPoly

      public GPoly(int size)
      Generates an empty polygon with the specified reserved space
      Parameters:
      size - the reserved number of points
    • GPoly

      public GPoly(int[] xs, int[] ys)
      Parameters:
      xs - array containing all the x coordinates
      ys - array containing all the y coordinates
      Throws:
      IllegalArgumentException - if either array is null
      InvalidArgumentException - if the array size doesn't match
  • Method Details

    • draw

      public void draw(Graphics2D g)
      Description copied from class: GraphicE
      Draws the component on the given graphics
      Specified by:
      draw in class GraphicE
      Parameters:
      g - where to draw
    • clone

      public GPoly clone()
      Specified by:
      clone in class GFillableE