Search in sources :

Example 1 with HorizontalAlignment

use of org.apache.pivot.wtk.HorizontalAlignment 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)

Example 2 with HorizontalAlignment

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

the class Block method setHorizontalAlignment.

public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment) {
    Utils.checkNull(horizontalAlignment, "horizontalAlignment");
    HorizontalAlignment previousHorizontalAlignment = this.horizontalAlignment;
    if (previousHorizontalAlignment != horizontalAlignment) {
        this.horizontalAlignment = horizontalAlignment;
        blockListeners.horizontalAlignmentChanged(this, previousHorizontalAlignment);
    }
}
Also used : HorizontalAlignment(org.apache.pivot.wtk.HorizontalAlignment)

Example 3 with HorizontalAlignment

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

the class FlowPanes method updateFlowPaneState.

private void updateFlowPaneState() {
    HorizontalAlignment alignment = null;
    if (leftRadioButton.isSelected()) {
        alignment = HorizontalAlignment.LEFT;
    } else if (rightRadioButton.isSelected()) {
        alignment = HorizontalAlignment.RIGHT;
    } else if (centerRadioButton.isSelected()) {
        alignment = HorizontalAlignment.CENTER;
    }
    if (alignment != null) {
        flowPane.getStyles().put(Style.alignment, alignment);
    }
    flowPane.getStyles().put(Style.alignToBaseline, alignToBaselineCheckbox.isSelected());
}
Also used : HorizontalAlignment(org.apache.pivot.wtk.HorizontalAlignment)

Aggregations

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