Package com.jgoodies.forms.layout
Class Sizes.ComponentSize
- java.lang.Object
-
- com.jgoodies.forms.layout.Sizes.ComponentSize
-
- All Implemented Interfaces:
Size
,java.io.Serializable
- Enclosing class:
- Sizes
static final class Sizes.ComponentSize extends java.lang.Object implements Size, java.io.Serializable
An ordinal-based serializable typesafe enumeration that implements theSize
interface for the component sizes: min, pref, default.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
name
private static int
nextOrdinal
private int
ordinal
-
Constructor Summary
Constructors Modifier Constructor Description private
ComponentSize(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compressible()
Describes if this Size can be compressed, if container space gets scarce.java.lang.String
encode()
Returns a parseable string representation of this ComponentSize.int
maximumSize(java.awt.Container container, java.util.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 java.lang.Object
readResolve()
java.lang.String
toString()
(package private) static Sizes.ComponentSize
valueOf(java.lang.String str)
Returns an instance ofComponentSize
that corresponds to the specified string.
-
-
-
Method Detail
-
valueOf
static Sizes.ComponentSize valueOf(java.lang.String str)
Returns an instance ofComponentSize
that corresponds to the specified string.- Parameters:
str
- the encoded component size- Returns:
- the corresponding ComponentSize or null if none matches
-
maximumSize
public int maximumSize(java.awt.Container container, java.util.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:
maximumSize
in 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#compressedSizes
to check whether a column or row can be compressed or not.The DEFAULT ComponentSize is compressible, MINIMUM and PREFERRED are incompressible.
- Specified by:
compressible
in interfaceSize
- Returns:
true
for the DEFAULT size,false
otherwise- Since:
- 1.1
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
encode
public java.lang.String encode()
Returns a parseable string representation of this ComponentSize.
-
readResolve
private java.lang.Object readResolve()
-
-