public static List<ShapeRecord> rectangle(double startX,double startY,double width,double height){
  List<ShapeRecord> shapeRecords=new ArrayList<ShapeRecord>();
  shapeRecords.add(move(startX,startY));
  shapeRecords.addAll(straightEdge(startX,startY,width,startY));
  shapeRecords.addAll(straightEdge(width,startY,width,height));
  shapeRecords.addAll(straightEdge(width,height,startX,height));
  shapeRecords.addAll(straightEdge(startX,height,startX,startY));
  return shapeRecords;
}

public static List < ShapeRecord > rectangle ( double startX , double startY , double width , double height ) { List < ShapeRecord > shapeRecords = new ArrayList < ShapeRecord > ( ) ; shapeRecords . add ( move ( startX , startY ) ) ; shapeRecords . addAll ( straightEdge ( startX , startY , width , startY ) ) ; shapeRecords . addAll ( straightEdge ( width , startY , width , height ) ) ; shapeRecords . addAll ( straightEdge ( width , height , startX , height ) ) ; shapeRecords . addAll ( straightEdge ( startX , height , startX , startY ) ) ; return shapeRecords ; }
creates a list of shaperecord to draw a rectangle from the given origin ( startx , starty ) for the specified width and height ( in pixels ) .
