Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.ui.RectangleInsets
Field Summary | |
static RectangleInsets |
|
Constructor Summary | |
| |
|
Method Summary | |
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
Rectangle2D |
|
Rectangle2D |
|
Rectangle2D |
|
Rectangle2D |
|
Rectangle2D |
|
boolean |
|
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
UnitType |
|
int |
|
String |
|
void |
|
double |
|
double |
|
public static final RectangleInsets ZERO_INSETS
A useful constant representing zero insets.
public RectangleInsets(double top, double left, double bottom, double right)
Creates a new instance with the specified insets (as 'absolute' units).
- Parameters:
top
- the top insets.left
- the left insets.bottom
- the bottom insets.right
- the right insets.
public RectangleInsets(UnitType unitType, double top, double left, double bottom, double right)
Creates a new instance.
- Parameters:
unitType
- absolute or relative units (null
not permitted).top
- the top insets.left
- the left insets.bottom
- the bottom insets.right
- the right insets.
public double calculateBottomInset(double height)
Returns the bottom margin.
- Parameters:
height
- the height of the base rectangle.
- Returns:
- The bottom margin (in Java2D units).
public double calculateBottomOutset(double height)
Returns the bottom margin.
- Parameters:
height
- the height of the base rectangle.
- Returns:
- The bottom margin (in Java2D units).
public double calculateLeftInset(double width)
Returns the left margin.
- Parameters:
width
- the width of the base rectangle.
- Returns:
- The left margin (in Java2D units).
public double calculateLeftOutset(double width)
Returns the left margin.
- Parameters:
width
- the width of the base rectangle.
- Returns:
- The left margin (in Java2D units).
public double calculateRightInset(double width)
Returns the right margin.
- Parameters:
width
- the width of the base rectangle.
- Returns:
- The right margin (in Java2D units).
public double calculateRightOutset(double width)
Returns the right margin.
- Parameters:
width
- the width of the base rectangle.
- Returns:
- The right margin (in Java2D units).
public double calculateTopInset(double height)
Returns the top margin.
- Parameters:
height
- the height of the base rectangle.
- Returns:
- The top margin (in Java2D units).
public double calculateTopOutset(double height)
Returns the top margin.
- Parameters:
height
- the height of the base rectangle.
- Returns:
- The top margin (in Java2D units).
public Rectangle2D createAdjustedRectangle(Rectangle2D base, LengthAdjustmentType horizontal, LengthAdjustmentType vertical)
Creates an adjusted rectangle using the supplied rectangle, the insets specified by this instance, and the horizontal and vertical adjustment types.
- Parameters:
base
- the base rectangle (null
not permitted).horizontal
- the horizontal adjustment type (null
not permitted).vertical
- the vertical adjustment type (null
not permitted).
- Returns:
- The inset rectangle.
public Rectangle2D createInsetRectangle(Rectangle2D base)
Creates an 'inset' rectangle.
- Parameters:
base
- the base rectangle (null
not permitted).
- Returns:
- The inset rectangle.
public Rectangle2D createInsetRectangle(Rectangle2D base, boolean horizontal, boolean vertical)
Creates an 'inset' rectangle.
- Parameters:
base
- the base rectangle (null
not permitted).horizontal
- apply horizontal insets?vertical
- apply vertical insets?
- Returns:
- The inset rectangle.
public Rectangle2D createOutsetRectangle(Rectangle2D base)
Creates an outset rectangle.
- Parameters:
base
- the base rectangle (null
not permitted).
- Returns:
- An outset rectangle.
public Rectangle2D createOutsetRectangle(Rectangle2D base, boolean horizontal, boolean vertical)
Creates an outset rectangle.
- Parameters:
base
- the base rectangle (null
not permitted).horizontal
- apply horizontal insets?vertical
- apply vertical insets?
- Returns:
- An outset rectangle.
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
- Parameters:
obj
- the object (null
permitted).
- Returns:
- A boolean.
public double extendHeight(double height)
Extends the given height to allow for the insets.
- Parameters:
height
- the height.
- Returns:
- The extended height.
public double extendWidth(double width)
Extends the given width to allow for the insets.
- Parameters:
width
- the width.
- Returns:
- The extended width.
public UnitType getUnitType()
Returns the unit type (absolute or relative). This specifies whether the insets are measured as Java2D units or percentages.
- Returns:
- The unit type (never
null
).
public String toString()
Returns a textual representation of this instance, useful for debugging purposes.
- Returns:
- A string representing this instance.
public void trim(Rectangle2D area)
Shrinks the given rectangle by the amount of these insets.
- Parameters:
area
- the area (null
not permitted).
public double trimHeight(double height)
Trims the given height to allow for the insets.
- Parameters:
height
- the height.
- Returns:
- The trimmed height.
public double trimWidth(double width)
Trims the given width to allow for the insets.
- Parameters:
width
- the width.
- Returns:
- The trimmed width.