Search in sources :

Example 1 with VerticalAlignment

use of org.apache.pivot.wtk.VerticalAlignment in project pivot by apache.

the class BoxPanes method updateBoxPaneState.

private void updateBoxPaneState() {
    Orientation orientation = null;
    if (horizontalOrientationButton.isSelected()) {
        orientation = Orientation.HORIZONTAL;
    } else if (verticalOrientationButton.isSelected()) {
        orientation = Orientation.VERTICAL;
    }
    if (orientation != null) {
        boxPane.setOrientation(orientation);
    }
    HorizontalAlignment horizontalAlignment = null;
    if (horizontalAlignmentLeftButton.isSelected()) {
        horizontalAlignment = HorizontalAlignment.LEFT;
    } else if (horizontalAlignmentRightButton.isSelected()) {
        horizontalAlignment = HorizontalAlignment.RIGHT;
    } else if (horizontalAlignmentCenterButton.isSelected()) {
        horizontalAlignment = HorizontalAlignment.CENTER;
    }
    if (horizontalAlignment != null) {
        boxPane.getStyles().put(Style.horizontalAlignment, horizontalAlignment);
    }
    VerticalAlignment verticalAlignment = null;
    if (verticalAlignmentTopButton.isSelected()) {
        verticalAlignment = VerticalAlignment.TOP;
    } else if (verticalAlignmentBottomButton.isSelected()) {
        verticalAlignment = VerticalAlignment.BOTTOM;
    } else if (verticalAlignmentCenterButton.isSelected()) {
        verticalAlignment = VerticalAlignment.CENTER;
    }
    if (verticalAlignment != null) {
        boxPane.getStyles().put(Style.verticalAlignment, verticalAlignment);
    }
    boxPane.getStyles().put(Style.fill, fillCheckbox.isSelected());
}
Also used : VerticalAlignment(org.apache.pivot.wtk.VerticalAlignment) Orientation(org.apache.pivot.wtk.Orientation) HorizontalAlignment(org.apache.pivot.wtk.HorizontalAlignment)

Aggregations

HorizontalAlignment (org.apache.pivot.wtk.HorizontalAlignment)1 Orientation (org.apache.pivot.wtk.Orientation)1 VerticalAlignment (org.apache.pivot.wtk.VerticalAlignment)1