use of com.haulmont.cuba.gui.components.AbstractFrame in project cuba by cuba-platform.
the class MigLayoutHelper method getConstraints.
public static CC getConstraints(Component component) {
boolean expandX = false;
boolean expandY = false;
// for latter comparing with AutoExpanding
if (component instanceof AbstractFrame) {
component = (Component) ((AbstractFrame) component).getComponent();
}
if (component instanceof AutoExpanding) {
expandX = ((AutoExpanding) component).expandsWidth();
expandY = ((AutoExpanding) component).expandsHeight();
}
int width = (int) component.getWidth();
int widthUnits = component.getWidthUnits();
int height = (int) component.getHeight();
int heightUnits = component.getHeightUnits();
CC cc = new CC();
applyWidth(cc, width, widthUnits, expandX);
applyHeight(cc, height, heightUnits, expandY);
applyAlignment(cc, component.getAlignment());
return cc;
}
Aggregations