|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.chart.Spacer
Represents an amount of blank space inside (or sometimes outside) a rectangle. This class is similar in function to the Insets class, but allows for the space to be specified in relative terms as well as absolute terms.
Immutable.
Field Summary | |
static int |
ABSOLUTE
A constant for 'absolute' spacing. |
static int |
RELATIVE
A constant for 'relative' spacing. |
Constructor Summary | |
Spacer(int type,
double left,
double top,
double right,
double bottom)
Creates a new Spacer object. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Tests this object for equality with another object. |
double |
getAdjustedHeight(double height)
Returns the height after adding the top and bottom spacing amounts. |
double |
getAdjustedWidth(double width)
Returns the width after adding the left and right spacing amounts. |
double |
getBottomSpace(double height)
Returns the amount of space for the bottom of a rectangular area. |
double |
getLeftSpace(double width)
Returns the amount of space for the left hand side of a rectangular area. |
double |
getRightSpace(double width)
Returns the amount of space for the right hand side of a rectangular area. |
double |
getTopSpace(double height)
Returns the amount of space for the top of a rectangular area. |
void |
trim(java.awt.geom.Rectangle2D area)
Calculates the margins and trims them from the supplied area. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RELATIVE
public static final int ABSOLUTE
Constructor Detail |
public Spacer(int type, double left, double top, double right, double bottom)
The space can be specified in relative or absolute terms (using the constants
RELATIVE
and ABSOLUTE
for the type
argument.
For relative spacing, the margins are specified as percentages (of the overall height
or width). For absolute spacing, the margins are specified in points (1/72 inch).
type
- the type of spacing (relative or absolute).left
- the left margin.top
- the top margin.right
- the right margin.bottom
- the bottom margin.Method Detail |
public double getLeftSpace(double width)
The width argument is only used for calculating 'relative' spacing.
width
- the overall width of the rectangular area.
public double getRightSpace(double width)
The width argument is only used for calculating 'relative' spacing.
width
- the overall width of the rectangular area.
public double getTopSpace(double height)
The height argument is only used for calculating 'relative' spacing.
height
- the overall height of the rectangular area.
public double getBottomSpace(double height)
The height argument is only used for calculating 'relative' spacing.
height
- the overall height of the rectangular area.
public double getAdjustedWidth(double width)
width
- the original width.
public double getAdjustedHeight(double height)
height
- the original height.
public void trim(java.awt.geom.Rectangle2D area)
area
- the area to be trimmed.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other object.
true
or false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |