Class PrototypeSize
java.lang.Object
com.jgoodies.forms.layout.PrototypeSize
- All Implemented Interfaces:
Size, Serializable
A
Size implementation that computes its width and height
by a prototype String.Examples:
new PrototypeSize("123-456-789");
new FormLayout("p, 2dlu, 'MMMM'");
- Since:
- 1.2
- Version:
- $Revision: 1.4 $
- Author:
- Karsten Lentzsch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPrototypeSize(String prototype) Constructs a PrototypeSize for the given String. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDescribes if this Size can be compressed, if container space gets scarce.encode()Returns a parseable string representation of this prototype size.booleanIndicates whether some other ConstantSize is "equal to" this one.Returns this size's prototype string.inthashCode()Returns a hash code value for the object.intmaximumSize(Container container, List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure) Computes and returns the width of this Size's prototype in pixel.toString()Returns a string representation of this size object.
-
Constructor Details
-
PrototypeSize
Constructs a PrototypeSize for the given String.- Parameters:
prototype- the String used to compute the width and height.- Throws:
NullPointerException- ifprototypeisnull.- Since:
- 1.2
-
-
Method Details
-
getPrototype
-
maximumSize
public int maximumSize(Container container, List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure) Computes and returns the width of this Size's prototype in pixel. Ignores the component list and measures. Obtains the FontMetrics from the given layoutcontainerfor the default dialog font provided byDefaultUnitConverter.getDefaultDialogFont().Invoked by
FormSpecto determine the size of a column or row.- Specified by:
maximumSizein interfaceSize- Parameters:
container- the layout containercomponents- the list of components used to compute the sizeminMeasure- the measure that determines the minimum sizesprefMeasure- the measure that determines the preferred sizesdefaultMeasure- the measure that determines the default sizes- Returns:
- the
stringWidthfor this size's prototype string computed by thecontainer's FontMetrics for theDefaultUnitConverter's default dialog font
-
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.PrototypeSizes are incompressible.
- Specified by:
compressiblein interfaceSize- Returns:
false
-
encode
-
equals
-
hashCode
-
toString
-