|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.ui.Spacer
public class 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. Instances of this class are immutable.
In general, using RectangleInsets
is preferred to this class.
Field Summary | |
---|---|
static int |
ABSOLUTE
A constant for 'absolute' spacing. |
static Spacer |
NO_SPACE
A spacer that adds no space around a rectangle. |
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 | |
---|---|
double |
calculateExtendedHeight(double height)
Calculates the extended height after adding the top and bottom spacing amounts. |
double |
calculateExtendedWidth(double width)
Returns the width after adding the left and right spacing amounts. |
boolean |
equals(java.lang.Object obj)
Tests this object for equality with another object. |
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. |
int |
hashCode()
Returns a hashcode for this instance. |
void |
trim(java.awt.geom.Rectangle2D area)
Calculates the margins and trims them from the supplied area. |
double |
trimWidth(double w)
Reduces the specified width according to the left and right space settings. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RELATIVE
public static final int ABSOLUTE
public static final Spacer NO_SPACE
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)
width
- the overall width of the rectangular area.
public double getRightSpace(double width)
width
- the overall width of the rectangular area.
public double getTopSpace(double height)
height
- the overall height of the rectangular area.
public double getBottomSpace(double height)
height
- the overall height of the rectangular area.
public double calculateExtendedWidth(double width)
width
- the original width.
public double calculateExtendedHeight(double height)
height
- the original height.
public void trim(java.awt.geom.Rectangle2D area)
area
- the area to be trimmed (null
not permitted).public double trimWidth(double w)
w
- the width.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other object (null
permitted).
true
or false
.public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |