Package org.gephi.graph.api
Class Rect2D
- java.lang.Object
-
- org.gephi.graph.api.Rect2D
-
public class Rect2D extends Object
Represents a 2D axis-aligned immutable rectangle.- Author:
- Eduardo Ramos
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]
center()
boolean
contains(float minX, float minY, float maxX, float maxY)
boolean
contains(Rect2D rect)
float
height()
boolean
intersects(float minX, float minY, float maxX, float maxY)
boolean
intersects(Rect2D rect)
float
radius()
String
toString()
String
toString(NumberFormat formatter)
float
width()
-
-
-
Constructor Detail
-
Rect2D
public Rect2D(Rect2D source)
Create a newRect2D
as a copy of the givensource
.- Parameters:
source
- theRect2D
to copy from
-
Rect2D
public Rect2D(float minX, float minY, float maxX, float maxY)
Create a newRect2D
with the given minimum and maximum corner coordinates.- Parameters:
minX
- the x coordinate of the minimum cornerminY
- the y coordinate of the minimum cornermaxX
- the x coordinate of the maximum cornermaxY
- the y coordinate of the maximum corner
-
-
Method Detail
-
width
public float width()
-
height
public float height()
-
center
public float[] center()
-
radius
public float radius()
-
toString
public String toString(NumberFormat formatter)
-
contains
public boolean contains(Rect2D rect)
-
intersects
public boolean intersects(Rect2D rect)
-
contains
public boolean contains(float minX, float minY, float maxX, float maxY)
-
intersects
public boolean intersects(float minX, float minY, float maxX, float maxY)
-
-