/* * File: MyPolygon.java * * MyPolygon class * * Copyright: Northeast Parallel Architectures Center * */ import java.awt.Polygon; import java.awt.Graphics; import java.awt.Point; class MyPolygon extends Polygon { // Instance methods: public void draw( Graphics g ) { g.drawPolygon( this ); } public void fill( Graphics g ) { g.fillPolygon( this ); } // Overload Polygon.addPoint( int, int ): public void addPoint( Point p ) { super.addPoint( p.x, p.y ); } }