public final class Rectangle
extends java.lang.Object
implements java.io.Serializable
Title: Rectangle class
Description:
Copyright (c) 2005-2019 by Steema Software SL. All Rights Reserved.
Company: Steema Software SL
Modifier and Type | Field and Description |
---|---|
static Rectangle |
EMPTY |
int |
height |
int |
width |
int |
x |
int |
y |
Constructor and Description |
---|
Rectangle() |
Rectangle(int ax,
int ay,
int awidth,
int aheight) |
Rectangle(Point location,
Dimension size) |
Rectangle(Rectangle r) |
Modifier and Type | Method and Description |
---|---|
void |
add(Rectangle r) |
Point |
center()
Returns the center point of the rectangle
|
boolean |
contains(int x2,
int y2) |
boolean |
contains(Point pos) |
Rectangle |
copy() |
static Rectangle |
fromLTRB(int left,
int top,
int right,
int bottom) |
int |
getBottom()
Gets rectangle Bottom coordinate.
|
double |
getHeight() |
int |
getLeft()
Gets rectangle Left coordinate.
|
Point |
getLocation() |
int |
getRight()
Gets rectangle Right coordinate.
|
int |
getTop()
Gets rectangle Top coordinate.
|
double |
getWidth() |
void |
grow(int i,
int j) |
void |
inflate(int horizontal,
int vertical) |
void |
intersect(Rectangle value) |
static void |
intersect(Rectangle r1,
Rectangle r2,
Rectangle dest) |
boolean |
intersects(Rectangle r) |
boolean |
isEmpty() |
void |
offset(int w,
int h) |
void |
setBottom(int value)
Sets rectangle Bottom coordinate.
|
void |
setLeft(int value)
Sets rectangle Left coordinate.
|
void |
setRight(int value)
Sets rectangle Right coordinate.
|
void |
setTop(int value)
Sets rectangle Top coordinate.
|
void |
union(Rectangle r) |
public static final Rectangle EMPTY
public int x
public int y
public int width
public int height
public Rectangle()
public Rectangle(int ax, int ay, int awidth, int aheight)
public Rectangle(Rectangle r)
public Point center()
public Rectangle copy()
public int getLeft()
public void setLeft(int value)
public int getRight()
public void setRight(int value)
public int getTop()
public void setTop(int value)
public int getBottom()
public void setBottom(int value)
public static Rectangle fromLTRB(int left, int top, int right, int bottom)
public void inflate(int horizontal, int vertical)
public void intersect(Rectangle value)
public void offset(int w, int h)
w
- h
- public Point getLocation()
public void grow(int i, int j)
public boolean contains(int x2, int y2)
public boolean contains(Point pos)
public void add(Rectangle r)
public void union(Rectangle r)
public double getWidth()
public double getHeight()
public boolean isEmpty()
public boolean intersects(Rectangle r)