Class GPoly

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<GPoint>
    Direct Known Subclasses:
    GRegPoly

    public class GPoly
    extends GMultiPoint
    http://erich.realtimerendering.com/ptinpoly/
    • Constructor Detail

      • GPoly

        public GPoly​(GPoly e)
        Copy constructor
        Parameters:
        e - GPoly to copy
        Throws:
        java.lang.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:
        java.lang.IllegalArgumentException - if either array is null
        InvalidArgumentException - if the array size doesn't match
    • Method Detail

      • draw

        public void draw​(java.awt.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