Example usage for com.jgoodies.forms.layout BoundedSize getLowerBound

List of usage examples for com.jgoodies.forms.layout BoundedSize getLowerBound

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout BoundedSize getLowerBound.

Prototype

public Size getLowerBound() 

Source Link

Document

Returns the optional lower bound.

Usage

From source file:com.intellij.uiDesigner.radComponents.FormLayoutColumnProperties.java

License:Apache License

private void showSize(Size size) {
    Size minimumSize = null;/* www .j  a v a 2  s.  c  om*/
    Size maximumSize = null;
    if (size instanceof BoundedSize) {
        BoundedSize boundedSize = (BoundedSize) size;
        minimumSize = boundedSize.getLowerBound();
        maximumSize = boundedSize.getUpperBound();
        size = boundedSize.getBasis();
    }

    if (size instanceof ConstantSize) {
        myConstantRadioButton.setSelected(true);
        myMinimumCheckBox.setEnabled(false);
        myMinimumCheckBox.setSelected(false);
        myMaximumCheckBox.setEnabled(false);
        myMaximumCheckBox.setSelected(false);
        showConstantSize((ConstantSize) size, myConstantSizeUnitsCombo, myConstantSizeSpinner);
    } else {
        @NonNls
        String s = size.toString();
        if (s.startsWith("m")) {
            myMinimumRadioButton.setSelected(true);
        } else if (s.startsWith("p")) {
            myPreferredRadioButton.setSelected(true);
        } else {
            myDefaultRadioButton.setSelected(true);
        }

        myMinimumCheckBox.setEnabled(true);
        myMaximumCheckBox.setEnabled(true);
        if (minimumSize instanceof ConstantSize) {
            myMinimumCheckBox.setSelected(true);
            myMaximumCheckBox.setEnabled(false); // TODO: remove this code when IDEADEV-9678 is implemented
            showConstantSize((ConstantSize) minimumSize, myMinSizeUnitsCombo, myMinSizeSpinner);
        } else {
            myMinimumCheckBox.setSelected(false);
        }
        if (maximumSize instanceof ConstantSize) {
            myMaximumCheckBox.setSelected(true);
            myMinimumCheckBox.setEnabled(false); // TODO: remove this code when IDEADEV-9678 is implemented 
            showConstantSize((ConstantSize) maximumSize, myMaxSizeUnitsCombo, myMaxSizeSpinner);
        } else {
            myMaximumCheckBox.setSelected(false);
        }
    }
}