nodebox.graphics
Class Rect

java.lang.Object
  extended by nodebox.graphics.Rect
All Implemented Interfaces:
Iterable

public class Rect
extends Object
implements Iterable


Field Summary
 double height
           
 double width
           
 double x
           
 double y
           
 
Constructor Summary
Rect()
           
Rect(double x, double y, double width, double height)
           
Rect(Rect r)
           
Rect(Rectangle2D r)
           
 
Method Summary
static Rect centeredRect(double cx, double cy, double width, double height)
           
static Rect centeredRect(Rect r)
           
 boolean contains(Point p)
           
 boolean contains(Rect r)
           
static Rect corneredRect(double cx, double cy, double width, double height)
           
static Rect corneredRect(Rect r)
           
 boolean equals(Object o)
           
 Point getCentroid()
           
 double getHeight()
           
 Point getPosition()
           
 Rectangle2D getRectangle2D()
           
 double getWidth()
           
 double getX()
           
 double getY()
           
 int hashCode()
           
 boolean intersects(Rect r)
           
 boolean isEmpty()
           
 Iterator<Double> iterator()
           
 Rect normalized()
           
 String toString()
           
 Rect united(Rect r)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public final double x

y

public final double y

width

public final double width

height

public final double height
Constructor Detail

Rect

public Rect()

Rect

public Rect(double x,
            double y,
            double width,
            double height)

Rect

public Rect(Rect r)

Rect

public Rect(Rectangle2D r)
Method Detail

centeredRect

public static Rect centeredRect(double cx,
                                double cy,
                                double width,
                                double height)

centeredRect

public static Rect centeredRect(Rect r)

corneredRect

public static Rect corneredRect(double cx,
                                double cy,
                                double width,
                                double height)

corneredRect

public static Rect corneredRect(Rect r)

getHeight

public double getHeight()

getWidth

public double getWidth()

getX

public double getX()

getY

public double getY()

getPosition

public Point getPosition()

getCentroid

public Point getCentroid()

isEmpty

public boolean isEmpty()

normalized

public Rect normalized()

united

public Rect united(Rect r)

intersects

public boolean intersects(Rect r)

contains

public boolean contains(Point p)

contains

public boolean contains(Rect r)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getRectangle2D

public Rectangle2D getRectangle2D()

iterator

public Iterator<Double> iterator()
Specified by:
iterator in interface Iterable


Copyright © 2013. All Rights Reserved.