java.lang.Object
org.jgrapht.alg.drawing.model.Box2D
- All Implemented Interfaces:
 Serializable
A 2-dimensional box (rectangle).
- Author:
 - Dimitrios Michail
 - See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[]The coordinates of the lower cornerprotected double[]The side lengths - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleandoubleGet the heightdoublegetMaxX()Get the maximum x coordinatedoublegetMaxY()Get the maximum y coordinatedoublegetMinX()Get the minimum x coordinatedoublegetMinY()Get the minimum y coordinatedoublegetWidth()Get the widthinthashCode()static Box2Dof(double width, double height) Create a new boxstatic Box2Dof(double x, double y, double width, double height) Create a new boxtoString() 
- 
Field Details
- 
coordinates
protected double[] coordinatesThe coordinates of the lower corner - 
sides
protected double[] sidesThe side lengths 
 - 
 - 
Constructor Details
- 
Box2D
public Box2D(double width, double height) Create a new box- Parameters:
 width- the widthheight- the height
 - 
Box2D
public Box2D(double x, double y, double width, double height) Create a new box- Parameters:
 x- the x coordinate of the lower-left cornery- the y coordinate of the lower-left cornerwidth- the widthheight- the height
 - 
Box2D
public Box2D(double[] coordinates, double[] sides) Create a new box- Parameters:
 coordinates- the lower left corner coordinatessides- width and height
 
 - 
 - 
Method Details
- 
getMinX
public double getMinX()Get the minimum x coordinate- Returns:
 - the minimum x coordinate
 
 - 
getMinY
public double getMinY()Get the minimum y coordinate- Returns:
 - the minimum y coordinate
 
 - 
getWidth
public double getWidth()Get the width- Returns:
 - the width
 
 - 
getHeight
public double getHeight()Get the height- Returns:
 - the height
 
 - 
getMaxX
public double getMaxX()Get the maximum x coordinate- Returns:
 - the maximum x coordinate
 
 - 
getMaxY
public double getMaxY()Get the maximum y coordinate- Returns:
 - the maximum y coordinate
 
 - 
hashCode
public int hashCode() - 
equals
 - 
toString
 - 
of
Create a new box- Parameters:
 width- the widthheight- the height- Returns:
 - the box
 
 - 
of
Create a new box- Parameters:
 x- the x coordinate of the lower-left cornery- the y coordinate of the lower-left cornerwidth- the widthheight- the height- Returns:
 - the box
 
 
 -