* In Forte, the minimum size of a button is a fraction bigger than the ones
* in Java, so we'll adjust this here.
*/
@Override
public Dimension getMinimumSize() {
GridCell cell = GridField.getConstraints(this);
Dimension d = new Dimension();
// If we're natural or to_parent then the minimum size is
// the UI minimum size
// TF:8/11/07: The above rule applies only to explicit size, not parent
// size
// as we can actually shrink the widget if we need to.
if (cell.getWidthPolicy() == Constants.SP_NATURAL /*
* ||
* cell.getWidthPolicy() ==
* Constants.SP_TO_PARENT
*/) {
d.width = this.getIcon().getIconWidth();
} else if (cell.getWidthPolicy() == Constants.SP_EXPLICIT) {
// Must be the same as the current size
d.width = getWidth();
} else {
d.width = 0;
}
if (cell.getHeightPolicy() == Constants.SP_NATURAL /*
* ||
* cell.getHeightPolicy() ==
* Constants.SP_TO_PARENT
*/) {
d.height = this.getIcon().getIconHeight();
} else if (cell.getHeightPolicy() == Constants.SP_EXPLICIT) {
// Must be the same as the current size
d.height = getHeight();
} else {
d.height = 0;
}