Here you can find the source of makeArea(Polygon polygon, int steps, int dX, int dY)
public static Polygon makeArea(Polygon polygon, int steps, int dX, int dY)
//package com.java2s; //License from project: Apache License import java.awt.Polygon; public class Main { public static Polygon makeArea(Polygon polygon, int steps, int dX, int dY) { // make this an area! for (int i = steps - 1; i >= 0; --i) { polygon.addPoint(polygon.xpoints[i] + dX, polygon.ypoints[i] + dY); }// ww w . j a v a 2 s .c o m return polygon; } }