|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.forms.layout.PrototypeSize
public final class PrototypeSize
A Size
implementation that computes its width and height
by a prototype String.
Examples:
new PrototypeSize("123-456-789"); new FormLayout("p, 2dlu, 'MMMM'");
Size
,
Sizes
,
Serialized FormConstructor Summary | |
---|---|
PrototypeSize(java.lang.String prototype)
Constructs a PrototypeSize for the given String. |
Method Summary | |
---|---|
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 prototype size. |
boolean |
equals(java.lang.Object o)
Indicates whether some other ConstantSize is "equal to" this one. |
java.lang.String |
getPrototype()
Returns this size's prototype string. |
int |
hashCode()
Returns a hash code value for the object. |
int |
maximumSize(java.awt.Container container,
java.util.List components,
FormLayout.Measure minMeasure,
FormLayout.Measure prefMeasure,
FormLayout.Measure defaultMeasure)
Computes and returns the width of this Size's prototype in pixel. |
java.lang.String |
toString()
Returns a string representation of this size object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PrototypeSize(java.lang.String prototype)
prototype
- the String used to compute the width and height.
java.lang.NullPointerException
- if prototype
is null
.Method Detail |
---|
public java.lang.String getPrototype()
public int maximumSize(java.awt.Container container, java.util.List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure)
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
stringWidth
for this size's prototype string
computed by the container
's FontMetrics for the
DefaultUnitConverter
's default dialog fontpublic boolean compressible()
#compressedSizes
to check whether a column or row can be compressed or not.PrototypeSizes are incompressible.
compressible
in interface Size
false
public java.lang.String encode()
encode
in interface Size
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the Object with which to compare
true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
Hashtable
public int hashCode()
java.util.Hashtable
.
hashCode
in class java.lang.Object
Object.equals(java.lang.Object)
,
Hashtable
public java.lang.String toString()
encode()
instead.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |