Class Sizes.ComponentSize
java.lang.Object
com.jgoodies.forms.layout.Sizes.ComponentSize
- All Implemented Interfaces:
Size, Serializable
- Enclosing class:
Sizes
An ordinal-based serializable typesafe enumeration that implements
the
Size interface for the component sizes:
min, pref, default.- Version:
- $Revision: 1.19 $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDescribes if this Size can be compressed, if container space gets scarce.encode()Returns a parseable string representation of this ComponentSize.intmaximumSize(Container container, List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure) Computes the maximum size for the given list of components, using this form spec and the specified measure.private ObjecttoString()(package private) static Sizes.ComponentSizeReturns an instance ofComponentSizethat corresponds to the specified string.
-
Field Details
-
name
-
nextOrdinal
private static int nextOrdinal -
ordinal
private final int ordinal
-
-
Constructor Details
-
ComponentSize
-
-
Method Details
-
valueOf
Returns an instance ofComponentSizethat corresponds to the specified string.- Parameters:
str- the encoded component size- Returns:
- the corresponding ComponentSize or null if none matches
-
maximumSize
public int maximumSize(Container container, List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure) Computes the maximum size for the given list of components, using this form spec and the specified measure.Invoked by FormLayout to determine the size of one of my elements
- 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 for the given list of components
-
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.The DEFAULT ComponentSize is compressible, MINIMUM and PREFERRED are incompressible.
- Specified by:
compressiblein interfaceSize- Returns:
truefor the DEFAULT size,falseotherwise- Since:
- 1.1
-
toString
-
encode
-
readResolve
-