com.jgoodies.forms.layout
Class BoundedSize

java.lang.Object
  extended by com.jgoodies.forms.layout.BoundedSize
All Implemented Interfaces:
Size, java.io.Serializable

final class BoundedSize
extends java.lang.Object
implements Size, java.io.Serializable

Describes sizes that provide lower and upper bounds as used by the JGoodies FormLayout.

Version:
$Revision: 54721 $
Author:
Karsten Lentzsch
See Also:
Sizes, ConstantSize, Sizes.ComponentSize

Field Summary
private  Size basis
          Holds the base size.
private  Size lowerBound
          Holds an optional lower bound.
private  Size upperBound
          Holds an optional upper bound.
 
Constructor Summary
BoundedSize(Size basis, Size lowerBound, Size upperBound)
          Constructs a BoundedSize for the given basis using the specified lower and upper bounds.
 
Method Summary
 boolean equals(java.lang.Object object)
          Indicates whether some other BoundedSize is "equal to" this one.
 int hashCode()
          Returns a hash code value for the object.
 int maximumSize(java.awt.Container container, java.util.List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure)
          Returns this size as pixel size.
 java.lang.String toString()
          Returns a string representation of this size object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

basis

private final Size basis
Holds the base size.


lowerBound

private Size lowerBound
Holds an optional lower bound.


upperBound

private Size upperBound
Holds an optional upper bound.

Constructor Detail

BoundedSize

BoundedSize(Size basis,
            Size lowerBound,
            Size upperBound)
Constructs a BoundedSize for the given basis using the specified lower and upper bounds.

Parameters:
basis - the base size
lowerBound - the lower bound size
upperBound - the upper bound size
Throws:
java.lang.NullPointerException - if the basis is null
Method Detail

maximumSize

public int maximumSize(java.awt.Container container,
                       java.util.List components,
                       FormLayout.Measure minMeasure,
                       FormLayout.Measure prefMeasure,
                       FormLayout.Measure defaultMeasure)
Returns this size as pixel size. Neither requires the component list nor the specified measures. Honors the lower and upper bound.

Invoked by FormSpec to determine the size of a column or row.

Specified by:
maximumSize in interface Size
Parameters:
container - the layout container
components - the list of components to measure
minMeasure - the measure used to determine the minimum size
prefMeasure - the measure used to determine the preferred size
defaultMeasure - the measure used to determine the default size
Returns:
the maximum size in pixels
See Also:
FormSpec.maximumSize(Container, List, FormLayout.Measure, FormLayout.Measure, FormLayout.Measure)

equals

public boolean equals(java.lang.Object object)
Indicates whether some other BoundedSize is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object with which to compare
Returns:
true if this object is the same as the object argument, false otherwise.
See Also:
Object.hashCode(), Hashtable

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(Object), Hashtable

toString

public java.lang.String toString()
Returns a string representation of this size object. Note: The string representation may change at any time. It is strongly recommended to not use this string for parsing purposes.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the constant size