com.jgoodies.forms.layout
Class PrototypeSize
java.lang.Object
com.jgoodies.forms.layout.PrototypeSize
- Serializable, Size
public final class PrototypeSize
extends java.lang.Object
implements 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'");
PrototypeSize(String prototype) - Constructs a PrototypeSize for the given String.
|
boolean | compressible() - Describes if this Size can be compressed, if container space gets scarce.
|
String | encode() - Returns a parseable string representation of this prototype size.
|
boolean | equals(Object o) - Indicates whether some other ConstantSize is "equal to" this one.
|
String | getPrototype() - Returns this size's prototype string.
|
int | hashCode() - Returns a hash code value for the object.
|
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.
|
String | toString() - Returns a string representation of this size object.
|
PrototypeSize
public PrototypeSize(String prototype)
Constructs a PrototypeSize for the given String.
prototype
- the String used to compute the width and height.
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.
PrototypeSizes are incompressible.
- compressible in interface Size
encode
public String encode()
Returns a parseable string representation of this prototype size.
- encode in interface Size
- a String that can be parsed by the Forms parser
equals
public boolean equals(Object o)
Indicates whether some other ConstantSize is "equal to" this one.
o
- the Object with which to compare
true
if this object is the same as the obj
argument; false
otherwise.
java.lang.Object.hashCode()
, java.util.Hashtable
getPrototype
public String getPrototype()
Returns this size's prototype string.
hashCode
public int hashCode()
Returns a hash code value for the object. This method is supported
for the benefit of hashtables such as those provided by
java.util.Hashtable
.
- a hash code value for this object.
java.lang.Object.equals(java.lang.Object)
, java.util.Hashtable
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 layout
container
for the default dialog font
provided by
DefaultUnitConverter.getDefaultDialogFont()
.
Invoked by
FormSpec
to determine
the size of a column or row.
- maximumSize in interface Size
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
- the
stringWidth
for this size's prototype string
computed by the container
's FontMetrics for the
DefaultUnitConverter
's default dialog font
toString
public String toString()
Returns a string representation of this size object.
Note: This string representation may change
at any time. It is intended for debugging purposes. For parsing,
use
encode()
instead.
- a string representation of the constant size
Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.