public class Rectangle extends Rectangle2D implements Shape, Serializable
Rectangle2D.Double, Rectangle2D.Float
Modifier and Type | Field and Description |
---|---|
double |
height |
double |
width |
double |
x |
double |
y |
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
Constructor and Description |
---|
Rectangle() |
Rectangle(Dimension d) |
Rectangle(double x, double y, double width, double height) |
Rectangle(int width, int height) |
Rectangle(Point p) |
Rectangle(Point p, Dimension d) |
Rectangle(Rectangle r) |
Rectangle(Rectangle r) |
Modifier and Type | Method and Description |
---|---|
void |
add(double px, double py) |
void |
add(int px, int py) |
void |
add(Point p) |
void |
add(Rectangle r) |
boolean |
contains(double px, double py) |
boolean |
contains(double rx, double ry, double rw, double rh) |
boolean |
contains(int px, int py) |
boolean |
contains(int rx, int ry, int rw, int rh) |
boolean |
contains(Point p) |
boolean |
contains(Rectangle r) |
Rectangle2D |
createIntersection(Rectangle2D r) |
Rectangle2D |
createUnion(Rectangle2D r) |
boolean |
equals(Object obj) |
Rectangle |
getBounds() |
Rectangle2D |
getBounds2D() |
double |
getHeight() |
Point |
getLocation() |
Dimension |
getSize() |
double |
getWidth() |
double |
getX() |
double |
getY() |
void |
grow(double dx, double dy) |
void |
grow(int mx, int my) |
Rectangle |
intersection(Rectangle r) |
boolean |
intersects(Rectangle r) |
boolean |
isEmpty() |
int |
outcode(double px, double py) |
void |
setBounds(double x, double y, double width, double height) |
void |
setBounds(int x, int y, int width, int height) |
void |
setBounds(Rectangle r) |
void |
setLocation(double x, double y) |
void |
setLocation(int mx, int my) |
void |
setLocation(Point p) |
void |
setRect(double x, double y, double width, double height) |
void |
setSize(Dimension d) |
void |
setSize(double width, double height) |
void |
setSize(int mx, int my) |
String |
toString() |
void |
translate(double mx, double my) |
void |
translate(int mx, int my) |
Rectangle |
union(Rectangle r) |
add, add, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
finalize, getClass, notify, notifyAll, wait, wait, wait
contains, contains, getPathIterator, getPathIterator, intersects, intersects
public double x
public double y
public double width
public double height
public Rectangle()
public Rectangle(Point p)
public Rectangle(double x, double y, double width, double height)
public Rectangle(int width, int height)
public Rectangle(Rectangle r)
public Rectangle(Rectangle r)
public Rectangle(Dimension d)
public double getX()
getX
in class RectangularShape
public double getY()
getY
in class RectangularShape
public double getHeight()
getHeight
in class RectangularShape
public double getWidth()
getWidth
in class RectangularShape
public boolean isEmpty()
isEmpty
in class RectangularShape
public Dimension getSize()
public void setSize(int mx, int my)
public void setSize(double width, double height)
public void setSize(Dimension d)
public Point getLocation()
public void setLocation(int mx, int my)
public void setLocation(double x, double y)
public void setLocation(Point p)
public void setRect(double x, double y, double width, double height)
setRect
in class Rectangle2D
public Rectangle getBounds()
getBounds
in interface Shape
getBounds
in class RectangularShape
public Rectangle2D getBounds2D()
getBounds2D
in interface Shape
getBounds2D
in class Rectangle2D
public void setBounds(int x, int y, int width, int height)
public void setBounds(double x, double y, double width, double height)
public void setBounds(Rectangle r)
public void grow(int mx, int my)
public void grow(double dx, double dy)
public void translate(int mx, int my)
public void translate(double mx, double my)
public void add(int px, int py)
public void add(double px, double py)
add
in class Rectangle2D
public void add(Point p)
public void add(Rectangle r)
public boolean contains(int px, int py)
public boolean contains(double px, double py)
contains
in interface Shape
contains
in class Rectangle2D
public boolean contains(Point p)
public boolean contains(int rx, int ry, int rw, int rh)
public boolean contains(double rx, double ry, double rw, double rh)
contains
in interface Shape
contains
in class Rectangle2D
public boolean contains(Rectangle r)
public Rectangle2D createIntersection(Rectangle2D r)
createIntersection
in class Rectangle2D
public boolean intersects(Rectangle r)
public int outcode(double px, double py)
outcode
in class Rectangle2D
public Rectangle2D createUnion(Rectangle2D r)
createUnion
in class Rectangle2D
public boolean equals(Object obj)
equals
in class Rectangle2D
Copyright © 1998–2018. All rights reserved.