com.jrefinery.chart
Class Spacer

java.lang.Object
  extended by com.jrefinery.chart.Spacer
All Implemented Interfaces:
java.lang.Cloneable

public class Spacer
extends java.lang.Object
implements java.lang.Cloneable

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
           
protected  double bottom
           
protected  double left
           
static int RELATIVE
           
protected  double right
           
protected  double top
           
protected  int type
           
 
Constructor Summary
Spacer(int type, double left, double top, double right, double bottom)
           
 
Method Summary
 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)
           
 double getLeftSpace(double width)
           
 double getRightSpace(double width)
           
 double getTopSpace(double height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELATIVE

public static final int RELATIVE
See Also:
Constant Field Values

ABSOLUTE

public static final int ABSOLUTE
See Also:
Constant Field Values

type

protected int type

left

protected double left

top

protected double top

right

protected double right

bottom

protected double bottom
Constructor Detail

Spacer

public Spacer(int type,
              double left,
              double top,
              double right,
              double bottom)
Method Detail

getLeftSpace

public double getLeftSpace(double width)

getRightSpace

public double getRightSpace(double width)

getTopSpace

public double getTopSpace(double height)

getBottomSpace

public double getBottomSpace(double height)

getAdjustedWidth

public double getAdjustedWidth(double width)
Returns the width after adding the left and right spacing amounts.


getAdjustedHeight

public double getAdjustedHeight(double height)
Returns the height after adding the top and bottom spacing amounts.



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.