|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.SizeRequirements
Safe:
Field Summary | |
float |
alignment
Suppressed: The alignment, specified as a value between 0.0 and 1.0, inclusive. |
int |
maximum
Suppressed: The maximum size allowed. |
int |
minimum
Suppressed: The minimum size required. |
int |
preferred
Suppressed: The preferred (natural) size. |
Constructor Summary | |
SizeRequirements()
Enabled: 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)
Enabled: Creates a SizeRequirements object with the specified minimum, preferred, and maximum sizes and the specified alignment. |
Method Summary | |
static int[] |
adjustSizes(int delta,
SizeRequirements[] children)
Enabled: Adjust a specified array of sizes by a given amount. |
static void |
calculateAlignedPositions(int allocated,
SizeRequirements total,
SizeRequirements[] children,
int[] offsets,
int[] spans)
Enabled: Creates a bunch of offset/span pairs specifying how to lay out a set of components with the specified alignments. |
static void |
calculateAlignedPositions(int allocated,
SizeRequirements total,
SizeRequirements[] children,
int[] offsets,
int[] spans,
boolean normal)
Enabled: Creates a set 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)
Enabled: Creates a set of offset/span pairs representing how to lay out a set of components end-to-end. |
static void |
calculateTiledPositions(int allocated,
SizeRequirements total,
SizeRequirements[] children,
int[] offsets,
int[] spans,
boolean forward)
Enabled: Creates a set of offset/span pairs representing how to lay out a set of components end-to-end. |
private static void |
compressedTile(int allocated,
long min,
long pref,
long max,
SizeRequirements[] request,
int[] offsets,
int[] spans,
boolean forward)
|
private static void |
expandedTile(int allocated,
long min,
long pref,
long max,
SizeRequirements[] request,
int[] offsets,
int[] spans,
boolean forward)
|
static SizeRequirements |
getAlignedSizeRequirements(SizeRequirements[] children)
Enabled: Determines the total space necessary to align a set of components. |
static SizeRequirements |
getTiledSizeRequirements(SizeRequirements[] children)
Enabled: Determines the total space necessary to place a set of components end-to-end. |
String |
toString()
Suppressed: 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, notify, notifyAll, 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 >= 0pref
- the preferred size >= 0max
- the maximum size >= 0a
- the alignment >= 0.0f && <= 1.0fMethod Detail |
public String toString()
toString
in class Object
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. This argument
is optional and may be null.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 calculateTiledPositions(int allocated, SizeRequirements total, SizeRequirements[] children, int[] offsets, int[] spans, boolean forward)
allocated
- the total span to be allocated >= 0.total
- the total of the children requests. This argument
is optional and may be null.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.forward
- tile with offsets increasing from 0 if true
and with offsets decreasing from the end of the allocated space
if false.private static void compressedTile(int allocated, long min, long pref, long max, SizeRequirements[] request, int[] offsets, int[] spans, boolean forward)
private static void expandedTile(int allocated, long min, long pref, long max, SizeRequirements[] request, int[] offsets, int[] spans, boolean forward)
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.public static void calculateAlignedPositions(int allocated, SizeRequirements total, SizeRequirements[] children, int[] offsets, int[] spans, boolean normal)
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.normal
- when true, the alignment value 0.0f means
left/top; when false, it means right/bottom.public static int[] adjustSizes(int delta, SizeRequirements[] children)
delta
- an int specifying the size differencechildren
- an array of SizeRequirements objects
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |