com.jgoodies.forms.layout
Class BoundedSize
- Serializable, Size
public final class BoundedSize
implements Size, Serializable
Describes sizes that provide lower and upper bounds
as used by the JGoodies FormLayout.
BoundedSize(Size basis, Size lowerBound, Size upperBound) - Constructs a BoundedSize for the given basis using the
specified lower and upper bounds.
|
BoundedSize
public BoundedSize(Size basis,
Size lowerBound,
Size upperBound)
Constructs a BoundedSize for the given basis using the
specified lower and upper bounds.
basis
- the base sizelowerBound
- the lower bound sizeupperBound
- the upper bound size
compressible
public boolean compressible()
Describes if this Size can be compressed, if container space gets scarce.
Used by the FormLayout size computations in
#compressedSizes
to check whether a column or row can be compressed or not.
BoundedSizes are compressible if the base Size is compressible.
- compressible in interface Size
true
if and only if the basis is compressible
encode
public String encode()
Returns a parseable string representation of this bounded size.
- encode in interface Size
- a String that can be parsed by the Forms parser
equals
public boolean equals(Object object)
Indicates whether some other BoundedSize is "equal to" this one.
object
- the object with which to compare
true
if this object is the same as the object
argument, false
otherwise.
getBasis
public Size getBasis()
Returns the base size, which is not-null
.
getLowerBound
public Size getLowerBound()
Returns the optional lower bound.
getUpperBound
public Size getUpperBound()
Returns the optional upper bound.
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
.
- a hash code value for this object.
maximumSize
public int maximumSize(Container container,
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.
- maximumSize in interface Size
container
- the layout containercomponents
- the list of components to measureminMeasure
- the measure used to determine the minimum sizeprefMeasure
- the measure used to determine the preferred sizedefaultMeasure
- the measure used to determine the default size
- the maximum size in pixels
FormSpec.maximumSize(Container, List, FormLayout.Measure, FormLayout.Measure, FormLayout.Measure)
toString
public String toString()
Returns a string representation of this size object.
Note: This string representation may change
at any time. It is intended for debugging purposes. For parsing,
use
encode()
instead.
- a string representation of this bounded size
Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.