public class RectangleInsets
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
RectangleInsets(UnitType unitType,
double top,
double bottom,
double left,
double right)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
double |
calculateBottomMargin(double height)
Returns the bottom margin.
|
double |
calculateLeftMargin(double width)
Returns the left margin.
|
double |
calculateRightMargin(double width)
Returns the right margin.
|
double |
calculateTopMargin(double height)
Returns the top margin.
|
java.awt.geom.Rectangle2D |
createInsetRectangle(java.awt.geom.Rectangle2D base)
Creates an 'inset' rectangle.
|
java.awt.geom.Rectangle2D |
createInsetRectangle(java.awt.geom.Rectangle2D base,
boolean horizontal,
boolean vertical)
Creates an 'inset' rectangle.
|
java.awt.geom.Rectangle2D |
createOutsetRectangle(java.awt.geom.Rectangle2D base)
Creates an outset rectangle.
|
java.awt.geom.Rectangle2D |
createOutsetRectangle(java.awt.geom.Rectangle2D base,
boolean horizontal,
boolean vertical)
Creates an outset rectangle.
|
boolean |
equals(java.lang.Object object)
Tests this instance for equality with an arbitrary object.
|
double |
getBottom()
Returns the bottom insets.
|
double |
getLeft()
Returns the left insets.
|
double |
getRight()
Returns the right insets.
|
double |
getTop()
Returns the top insets.
|
UnitType |
getUnitType()
Returns the unit type (absolute or relative).
|
public RectangleInsets(UnitType unitType, double top, double bottom, double left, double right)
unitType
- absolute or relative units (null
not permitted).top
- the top insets.bottom
- the bottom insets.left
- the left insets.right
- the right insets.public UnitType getUnitType()
null
).public double getTop()
public double getBottom()
public double getLeft()
public double getRight()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the object (null
permitted).public java.awt.geom.Rectangle2D createInsetRectangle(java.awt.geom.Rectangle2D base)
base
- the base rectangle (null
not permitted).public java.awt.geom.Rectangle2D createInsetRectangle(java.awt.geom.Rectangle2D base, boolean horizontal, boolean vertical)
base
- the base rectangle (null
not permitted).horizontal
- apply horizontal insets?vertical
- apply vertical insets?public java.awt.geom.Rectangle2D createOutsetRectangle(java.awt.geom.Rectangle2D base)
base
- the base rectangle (null
not permitted).public java.awt.geom.Rectangle2D createOutsetRectangle(java.awt.geom.Rectangle2D base, boolean horizontal, boolean vertical)
base
- the base rectangle (null
not permitted).horizontal
- apply horizontal insets?vertical
- apply vertical insets?public double calculateTopMargin(double height)
height
- the height of the base rectangle.public double calculateBottomMargin(double height)
height
- the height of the base rectangle.public double calculateLeftMargin(double width)
width
- the width of the base rectangle.public double calculateRightMargin(double width)
width
- the width of the base rectangle.