Java Reference
In-Depth Information
"EntryLayout: widths must be fractions < 1"
);
widthPercentages
[
i
] =
relWidths
[
i
];
}
validWidths
=
true
true
;
hpad
=
h
;
vpad
=
v
;
}
/** Construct an EntryLayout with widths and with default padding amounts.
* @param relWidths Array of doubles specifying column widths.
*/
public
public
EntryLayout
(
double
double
[]
relWidths
) {
this
this
(
relWidths
,
HPAD
,
VPAD
);
}
/** Adds the specified component with the specified constraint
* to the layout; required by LayoutManager but not used.
*/
public
public
void
void
addLayoutComponent
(
String name
,
Component comp
) {
// nothing to do
}
/** Removes the specified component from the layout;
* required by LayoutManager, but does nothing.
*/
public
public
void
void
removeLayoutComponent
(
Component comp
) {
// nothing to do
}
/** Calculates the preferred size dimensions for the specified panel
* given the components in the specified parent container. */
public
public
Dimension
preferredLayoutSize
(
Container parent
) {
// System.out.println("preferredLayoutSize");
return
return
computeLayoutSize
(
parent
,
hpad
,
vpad
);
}
/** Find the minimum Dimension for the
* specified container given the components therein.
*/
public
public
Dimension
minimumLayoutSize
(
Container parent
) {
// System.out.println("minimumLayoutSize");
return
return
computeLayoutSize
(
parent
,
0
,
0
);
}
/** The width of each column, as found by computLayoutSize(). */
int
int
[]
widths
;