public final class PrototypeSize extends Object implements Size, Serializable
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 Form| Constructor and Description |
|---|
PrototypeSize(String prototype)
Constructs a PrototypeSize for the given String.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public PrototypeSize(String prototype)
prototype - the String used to compute the width and height.NullPointerException - if prototype is null.public String getPrototype()
public int maximumSize(Container container, 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 Sizecontainer - 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 sizesstringWidth 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 Sizefalsepublic String encode()
public boolean equals(Object o)
equals in class Objecto - the Object with which to comparetrue if this object is the same as the obj argument; false otherwise.Object.hashCode(),
Hashtablepublic int hashCode()
java.util.Hashtable.hashCode in class ObjectObject.equals(java.lang.Object),
HashtableCopyright © 2021. All rights reserved.