Class BoundedSize
java.lang.Object
com.jgoodies.forms.layout.BoundedSize
- All Implemented Interfaces:
Size, Serializable
Describes sizes that provide lower and upper bounds
as used by the JGoodies FormLayout.
- Version:
- $Revision: 1.18 $
- Author:
- Karsten Lentzsch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBoundedSize(Size basis, Size lowerBound, Size upperBound) Constructs a BoundedSize for the given basis using the specified lower and upper bounds. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDescribes if this Size can be compressed, if container space gets scarce.encode()Returns a parseable string representation of this bounded size.booleanIndicates whether some other BoundedSize is "equal to" this one.getBasis()Returns the base size, which is not-null.Returns the optional lower bound.Returns the optional upper bound.inthashCode()Returns a hash code value for the object.intmaximumSize(Container container, List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure) Returns this size as pixel size.toString()Returns a string representation of this size object.
-
Constructor Details
-
BoundedSize
Constructs a BoundedSize for the given basis using the specified lower and upper bounds.- Parameters:
basis- the base sizelowerBound- the lower bound sizeupperBound- the upper bound size- Throws:
NullPointerException- if the basis isnullIllegalArgumentException- oflowerBoundandupperBoundisnull- Since:
- 1.1
-
-
Method Details
-
getBasis
-
getLowerBound
Returns the optional lower bound.- Returns:
- the optional lower bound
- Since:
- 1.1
-
getUpperBound
Returns the optional upper bound.- Returns:
- the optional upper bound
- Since:
- 1.1
-
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
FormSpecto determine the size of a column or row.- Specified by:
maximumSizein interfaceSize- Parameters:
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- Returns:
- the maximum size in pixels
- See Also:
-
compressible
public boolean compressible()Describes if this Size can be compressed, if container space gets scarce. Used by the FormLayout size computations in#compressedSizesto check whether a column or row can be compressed or not.BoundedSizes are compressible if the base Size is compressible.
- Specified by:
compressiblein interfaceSize- Returns:
trueif and only if the basis is compressible- Since:
- 1.1
-
equals
-
hashCode
-
toString
-
encode
-