com.jgoodies.forms.layout
Class Sizes.ComponentSize

java.lang.Object
  extended by 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 the Size interface for the component sizes: min, pref, default.


Field Summary
private  java.lang.String name
           
private static int nextOrdinal
           
private  int ordinal
           
 
Constructor Summary
private Sizes.ComponentSize(java.lang.String name)
           
 
Method Summary
 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 of ComponentSize that corresponds to the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final transient java.lang.String name

nextOrdinal

private static int nextOrdinal

ordinal

private final int ordinal
Constructor Detail

Sizes.ComponentSize

private Sizes.ComponentSize(java.lang.String name)
Method Detail

valueOf

static Sizes.ComponentSize valueOf(java.lang.String str)
Returns an instance of ComponentSize 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 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 for the given list of components

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

readResolve

private java.lang.Object readResolve()