public class ShapeFactory extends Object
Modifier and Type  Method and Description 

static Polygon 
createDiamond(double xCentre,
double yCentre,
double pointSize)
Deprecated.
in favour of createDiamond2D. This method will be removed some time after release 2.9.2.

static Shape 
createDiamond2D(double xCentre,
double yCentre,
double pointSize)
Creates a diamond (actually, a square rotated by 45 degrees) at the given position

static Polygon 
createDownTriangle(double xCentre,
double yCentre,
double side)
Deprecated.
in favour of createDownTriangle2D. This method will be removed some time after release 2.9.2.

static Shape 
createDownTriangle2D(double xCentre,
double yCentre,
double side)
Generates a triangle with one horizontal side and a vertex pointing downwards.

static Polygon 
createUpTriangle(double xCentre,
double yCentre,
double side)
Deprecated.
in favour of createUpTriangle2D. This method will be removed some time after release 2.9.2.

static Shape 
createUpTriangle2D(double xCentre,
double yCentre,
double side)
Generates an equilateral triangle with one horizontal side and a vertex pointing upwards.

public static Polygon createDownTriangle(double xCentre, double yCentre, double side)
public static Shape createDownTriangle2D(double xCentre, double yCentre, double side)
Wikipedia says: A median of a triangle is a straight line through a vertex and the midpoint of the opposite side, and divides the triangle into two equal areas. The three medians intersect in a single point, the triangle's centroid. This is also the triangle's center of gravity: if the triangle were made out of wood, say, you could balance it on its centroid, or on any line through the centroid. The centroid cuts every median in the ratio 2:1, i.e. the distance between a vertex and the centroid is twice as large as the distance between the centroid and the midpoint of the opposite side.
xCentre
  the x coordinate of the centroid of the generated triangleyCentre
  the y coordinate of the centroid of the generated triangleside
  the length of the sidejava.awt.Polygon
representing the Trianglepublic static Polygon createUpTriangle(double xCentre, double yCentre, double side)
public static Shape createUpTriangle2D(double xCentre, double yCentre, double side)
Wikipedia says: A median of a triangle is a straight line through a vertex and the midpoint of the opposite side, and divides the triangle into two equal areas. The three medians intersect in a single point, the triangle's centroid. This is also the triangle's center of gravity: if the triangle were made out of wood, say, you could balance it on its centroid, or on any line through the centroid. The centroid cuts every median in the ratio 2:1, i.e. the distance between a vertex and the centroid is twice as large as the distance between the centroid and the midpoint of the opposite side.
xCentre
  the x coordinate of the centroid of the generated triangleyCentre
  the y coordinate of the centroid of the generated triangleside
  the length of the sidejava.awt.Polygon
representing the Trianglepublic static Polygon createDiamond(double xCentre, double yCentre, double pointSize)
public static Shape createDiamond2D(double xCentre, double yCentre, double pointSize)
xCentre
 the x coordinate of the centre of the shapeyCentre
 the y coordinate of the centre of the shapepointSize
 the length of the side of the square