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());
}
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);
}
}
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());
}
Aggregations