|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.library.layout.HeightManager
final class HeightManager
This is a utility class that layout managers use. Its job is to determine the start pixel and height of each row in a list of rows. It does not need components. You tell it the minimum and preferred sizes of each row as well as a row weighting factor. You may also give it top and bottom margins and a row gap.
HeightManager usually sets each row to its preferred size. If no row has a non-zero weight, then it distributes extra space to the gaps and margins. If one or more rows has non-zero weight, it gives those rows all extra space proportional to the weight.
If the container is smaller than HeightManager's preferred size, then it sets each row to its minimum size. It then distributes extra space as it did above depending on whether or not any row has non-zero weight.
Nested Class Summary | |
---|---|
(package private) class |
HeightManager.Row
|
Field Summary | |
---|---|
private int |
_bottomMargin
|
private int |
_minimumHeight
|
private int |
_preferredHeight
|
private HeightManager.Row[] |
_row
|
private int |
_topMargin
|
private float |
_totalWeight
|
private boolean |
_valid
|
private int |
_vgap
|
Constructor Summary | |
---|---|
HeightManager(int rows,
int vgap)
Construct a HeightManager object. |
Method Summary | |
---|---|
(package private) void |
doLayout(java.awt.Container parent)
Lay out the rows. |
(package private) int |
getMinimumHeight()
Get the total minimum height of all rows. |
(package private) int |
getPreferredHeight()
Get the total preferred height of all rows. |
(package private) int |
getRowHeight(int rowIndex)
Get a row's pixel height. |
(package private) int |
getRowStart(int rowIndex)
Get a row's start pixel. |
private int |
giveFatToComponents(int fat)
|
(package private) void |
print()
|
(package private) void |
setGap(int g)
Set a pixel gap between rows. |
(package private) void |
setMargins(int top,
int bottom)
Set the top and bottom margins. |
(package private) void |
setMinimumRowHeight(int rowIndex,
int h)
Set a minimum pixel height for an indicated row. |
(package private) void |
setPreferredRowHeight(int rowIndex,
int h)
Set a preferred pixel height for an indicated row. |
(package private) void |
setRowWeight(float w)
Set a weight for all rows. |
(package private) void |
setRowWeight(int rowIndex,
float w)
Set a weight for an indicated row. |
(package private) void |
validate()
Validate the layout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean _valid
private HeightManager.Row[] _row
private int _vgap
private int _topMargin
private int _bottomMargin
private int _minimumHeight
private int _preferredHeight
private float _totalWeight
Constructor Detail |
---|
HeightManager(int rows, int vgap)
Method Detail |
---|
void setRowWeight(float w)
void setRowWeight(int rowIndex, float w)
void setMinimumRowHeight(int rowIndex, int h)
void setPreferredRowHeight(int rowIndex, int h)
void setGap(int g)
void setMargins(int top, int bottom)
int getPreferredHeight()
int getMinimumHeight()
void validate()
void doLayout(java.awt.Container parent)
private int giveFatToComponents(int fat)
final int getRowStart(int rowIndex)
final int getRowHeight(int rowIndex)
void print()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |