Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jfree.chart.block
Class RectangleConstraint  view RectangleConstraint download RectangleConstraint.java

java.lang.Object
  extended byorg.jfree.chart.block.RectangleConstraint

public class RectangleConstraint
extends java.lang.Object

A description of a constraint for resizing a rectangle. Constraints are immutable.


Field Summary
private  double height
          The fixed or maximum height.
private  LengthConstraintType heightConstraintType
          The constraint type.
private  org.jfree.data.Range heightRange
           
static RectangleConstraint NONE
          An instance representing no constraint.
private  double width
          The width.
private  LengthConstraintType widthConstraintType
          The width constraint type.
private  org.jfree.data.Range widthRange
          The width range.
 
Constructor Summary
RectangleConstraint(double w, double h)
          Creates a new "fixed width and height" instance.
RectangleConstraint(double w, org.jfree.data.Range h)
          Creates a new constraint with a fixed width and a range for the height.
RectangleConstraint(double w, org.jfree.data.Range widthRange, LengthConstraintType widthConstraintType, double h, org.jfree.data.Range heightRange, LengthConstraintType heightConstraintType)
          Creates a new constraint.
RectangleConstraint(org.jfree.data.Range w, double h)
          Creates a new constraint with a range for the width and a fixed height.
RectangleConstraint(org.jfree.data.Range w, org.jfree.data.Range h)
          Creates a new "range width and height" instance.
 
Method Summary
 org.jfree.ui.Size2D calculateConstrainedSize(org.jfree.ui.Size2D base)
          Returns the new size that reflects the constraints defined by this instance.
 double getHeight()
          Returns the fixed height.
 LengthConstraintType getHeightConstraintType()
          Returns the constraint type.
 org.jfree.data.Range getHeightRange()
          Returns the width range.
 double getWidth()
          Returns the fixed width.
 LengthConstraintType getWidthConstraintType()
          Returns the constraint type.
 org.jfree.data.Range getWidthRange()
          Returns the width range.
 RectangleConstraint toFixedHeight(double height)
          Returns a constraint that matches this one on the width attributes, but has a fixed height constraint.
 RectangleConstraint toFixedWidth(double width)
          Returns a constraint that matches this one on the height attributes, but has a fixed width constraint.
 RectangleConstraint toRangeHeight(org.jfree.data.Range range)
          Returns a constraint that matches this one on the width attributes, but has a range height constraint.
 RectangleConstraint toRangeWidth(org.jfree.data.Range range)
          Returns a constraint that matches this one on the height attributes, but has a range width constraint.
 java.lang.String toString()
          Returns a string representation of this instance, mostly used for debugging purposes.
 RectangleConstraint toUnconstrainedHeight()
          Returns a constraint that matches this one on the width attributes, but has no height constraint.
 RectangleConstraint toUnconstrainedWidth()
          Returns a constraint that matches this one on the height attributes, but has no width constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final RectangleConstraint NONE
An instance representing no constraint.


width

private double width
The width.


widthRange

private org.jfree.data.Range widthRange
The width range.


widthConstraintType

private LengthConstraintType widthConstraintType
The width constraint type.


height

private double height
The fixed or maximum height.


heightRange

private org.jfree.data.Range heightRange

heightConstraintType

private LengthConstraintType heightConstraintType
The constraint type.

Constructor Detail

RectangleConstraint

public RectangleConstraint(double w,
                           double h)
Creates a new "fixed width and height" instance.


RectangleConstraint

public RectangleConstraint(org.jfree.data.Range w,
                           org.jfree.data.Range h)
Creates a new "range width and height" instance.


RectangleConstraint

public RectangleConstraint(org.jfree.data.Range w,
                           double h)
Creates a new constraint with a range for the width and a fixed height.


RectangleConstraint

public RectangleConstraint(double w,
                           org.jfree.data.Range h)
Creates a new constraint with a fixed width and a range for the height.


RectangleConstraint

public RectangleConstraint(double w,
                           org.jfree.data.Range widthRange,
                           LengthConstraintType widthConstraintType,
                           double h,
                           org.jfree.data.Range heightRange,
                           LengthConstraintType heightConstraintType)
Creates a new constraint.

Method Detail

getWidth

public double getWidth()
Returns the fixed width.


getWidthRange

public org.jfree.data.Range getWidthRange()
Returns the width range.


getWidthConstraintType

public LengthConstraintType getWidthConstraintType()
Returns the constraint type.


getHeight

public double getHeight()
Returns the fixed height.


getHeightRange

public org.jfree.data.Range getHeightRange()
Returns the width range.


getHeightConstraintType

public LengthConstraintType getHeightConstraintType()
Returns the constraint type.


toUnconstrainedWidth

public RectangleConstraint toUnconstrainedWidth()
Returns a constraint that matches this one on the height attributes, but has no width constraint.


toUnconstrainedHeight

public RectangleConstraint toUnconstrainedHeight()
Returns a constraint that matches this one on the width attributes, but has no height constraint.


toFixedWidth

public RectangleConstraint toFixedWidth(double width)
Returns a constraint that matches this one on the height attributes, but has a fixed width constraint.


toFixedHeight

public RectangleConstraint toFixedHeight(double height)
Returns a constraint that matches this one on the width attributes, but has a fixed height constraint.


toRangeWidth

public RectangleConstraint toRangeWidth(org.jfree.data.Range range)
Returns a constraint that matches this one on the height attributes, but has a range width constraint.


toRangeHeight

public RectangleConstraint toRangeHeight(org.jfree.data.Range range)
Returns a constraint that matches this one on the width attributes, but has a range height constraint.


toString

public java.lang.String toString()
Returns a string representation of this instance, mostly used for debugging purposes.


calculateConstrainedSize

public org.jfree.ui.Size2D calculateConstrainedSize(org.jfree.ui.Size2D base)
Returns the new size that reflects the constraints defined by this instance.