public class Rectangle extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected float |
height |
protected float |
width |
protected float |
x |
protected float |
y |
Constructor and Description |
---|
Rectangle(float width, float height) |
Rectangle(float x, float y, float width, float height) |
Rectangle(Rectangle rect) |
Modifier and Type | Method and Description |
---|---|
|
applyMargins(float topIndent, float rightIndent, float bottomIndent, float leftIndent, boolean reverse) |
Rectangle |
clone()
Gets the copy of this rectangle.
|
Rectangle |
decreaseHeight(float extra)
Decreases the height of rectangle by the given value.
|
boolean |
equalsWithEpsilon(Rectangle that) |
boolean |
equalsWithEpsilon(Rectangle that, float eps) |
float |
getBottom()
Gets the Y coordinate of the lower edge of the rectangle.
|
static Rectangle |
getCommonRectangle(Rectangle... rectangles)
Calculates the common rectangle which includes all the input rectangles.
|
float |
getHeight()
Gets the height of rectangle.
|
float |
getLeft()
Gets the X coordinate of the left edge of the rectangle.
|
float |
getRight()
Gets the X coordinate of the right edge of the rectangle.
|
float |
getTop()
Gets the Y coordinate of the upper edge of the rectangle.
|
float |
getWidth()
Gets the width of rectangle.
|
float |
getX()
Gets the X coordinate of lower left point.
|
float |
getY()
Gets the Y coordinate of lower left point.
|
Rectangle |
increaseHeight(float extra)
Increases the height of rectangle by the given value.
|
boolean |
intersectsLine(float x1, float y1, float x2, float y2) |
Rectangle |
moveDown(float move) |
Rectangle |
moveLeft(float move) |
Rectangle |
moveRight(float move) |
Rectangle |
moveUp(float move) |
Rectangle |
setBbox(float llx, float lly, float urx, float ury)
Sets the rectangle by the coordinates, specifying its lower left and upper right points.
|
Rectangle |
setHeight(float height)
Sets the height of rectangle.
|
Rectangle |
setWidth(float width)
Sets the width of rectangle.
|
Rectangle |
setX(float x)
Sets the X coordinate of lower left point.
|
Rectangle |
setY(float y)
Sets the Y coordinate of lower left point.
|
String |
toString() |
protected float x
protected float y
protected float width
protected float height
public Rectangle(float x, float y, float width, float height)
public Rectangle(float width, float height)
public Rectangle(Rectangle rect)
public static Rectangle getCommonRectangle(Rectangle... rectangles)
rectangles
- list of input rectangles.
public Rectangle setBbox(float llx, float lly, float urx, float ury)
llx
- the X coordinate of lower left point
lly
- the Y coordinate of lower left point
urx
- the X coordinate of upper right point
ury
- the Y coordinate of upper right point
Rectangle
instance.
public float getX()
public Rectangle setX(float x)
x
- the X coordinate of lower left point to be set.
Rectangle
instance.
public float getY()
public Rectangle setY(float y)
y
- the Y coordinate of lower left point to be set.
Rectangle
instance.
public float getWidth()
public Rectangle setWidth(float width)
width
- the the width of rectangle to be set.
Rectangle
instance.
public float getHeight()
public Rectangle setHeight(float height)
height
- the the width of rectangle to be set.
Rectangle
instance.
public Rectangle increaseHeight(float extra)
extra
- the value of the extra height to be added.
Rectangle
instance.
public Rectangle decreaseHeight(float extra)
extra
- the value of the extra height to be subtracted.
Rectangle
instance.
public float getLeft()
getX()
.
public float getRight()
getX() + getWidth()
.
public float getTop()
getY() + getHeight()
.
public float getBottom()
getY()
.
public Rectangle moveDown(float move)
public Rectangle moveUp(float move)
public Rectangle moveRight(float move)
public Rectangle moveLeft(float move)
publicRectangle> T applyMargins(float topIndent, float rightIndent, float bottomIndent, float leftIndent, boolean reverse)
public boolean intersectsLine(float x1, float y1, float x2, float y2)
public Rectangle clone()
public boolean equalsWithEpsilon(Rectangle that)
public boolean equalsWithEpsilon(Rectangle that, float eps)
Copyright © 1998–2016 iText Group NV. All rights reserved.