Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.SizeRequirements
- tiled
- The components are placed end-to-end, starting at coordinate 0 (the leftmost or topmost position).
- aligned
- The components are aligned as specified by each component's X or Y alignment value.
Each SizeRequirements object contains information about either the width (and X alignment) or height (and Y alignment) of a single component or a group of components:
minimum
- The smallest reasonable width/height of the component or component group, in pixels.
preferred
- The natural width/height of the component or component group, in pixels.
maximum
- The largest reasonable width/height of the component or component group, in pixels.
alignment
- The X/Y alignment of the component or component group.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Field Summary | |
float | alignment
The alignment, specified as a value between 0.0 and 1.0, inclusive. |
int | maximum
The maximum size allowed. |
int | minimum
The minimum size required. |
int | preferred
The preferred (natural) size. |
Constructor Summary | |
SizeRequirements()
Creates a SizeRequirements object with the minimum, preferred, and maximum sizes set to zero and an alignment value of 0.5 (centered). |
|
SizeRequirements(int min,
int pref,
int max,
float a)
Creates a SizeRequirements object with the specified minimum, preferred, and maximum sizes and the specified alignment. |
Method Summary | |
static void | calculateAlignedPositions(int allocated,
SizeRequirements total,
SizeRequirements[] children,
int[] offsets,
int[] spans)
Creates a bunch of offset/span pairs specifying how to lay out a set of components with the specified alignments. |
static void | calculateTiledPositions(int allocated,
SizeRequirements total,
SizeRequirements[] children,
int[] offsets,
int[] spans)
Creates a bunch of offset/span pairs representing how to lay out a set of components end-to-end. |
static SizeRequirements | getAlignedSizeRequirements(SizeRequirements[] children)
Determines the total space necessary to align a set of components. |
static SizeRequirements | getTiledSizeRequirements(SizeRequirements[] children)
Determines the total space necessary to place a set of components end-to-end. |
java.lang.String | toString()
Returns a string describing the minimum, preferred, and maximum size requirements, along with the alignment. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public int minimum
comp
, this should be equal to either
comp.getMinimumSize().width
or
comp.getMinimumSize().height
.public int preferred
comp
, this should be equal to either
comp.getPreferredSize().width
or
comp.getPreferredSize().height
.public int maximum
comp
, this should be equal to either
comp.getMaximumSize().width
or
comp.getMaximumSize().height
.public float alignment
Constructor Detail |
public SizeRequirements()
public SizeRequirements(int min, int pref, int max, float a)
min
- the minimum size >= 0
pref
- the preferred size >= 0
max
- the maximum size >= 0
a
- the alignment >= 0.0f && <= 1.0fMethod Detail |
public java.lang.String toString()
public static SizeRequirements getTiledSizeRequirements(SizeRequirements[] children)
children
- the space requirements for a set of components.
The vector may be of zero length, which will result in a
default SizeRequirements object instance being passed back.public static SizeRequirements getAlignedSizeRequirements(SizeRequirements[] children)
children
- the set of child requirements. If of zero length,
the returns result will be a default instance of SizeRequirements.public static void calculateTiledPositions(int allocated, SizeRequirements total, SizeRequirements[] children, int[] offsets, int[] spans)
allocated
- the total span to be allocated >= 0.
total
- the total of the children requests.
children
- the size requirements for each component.
offsets
- the offset from 0 for each child where
the spans were allocated (determines placement of the span).
spans
- the span allocated for each child to make the
total target span.public static void calculateAlignedPositions(int allocated, SizeRequirements total, SizeRequirements[] children, int[] offsets, int[] spans)
allocated
- the total span to be allocated >= 0.
total
- the total of the children requests.
children
- the size requirements for each component.
offsets
- the offset from 0 for each child where
the spans were allocated (determines placement of the span).
spans
- the span allocated for each child to make the
total target span.Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |