Search in sources :

Example 11 with RadioButton

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

the class BoxPanes method initialize.

@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
    boxPane = (BoxPane) namespace.get("boxPane");
    horizontalOrientationButton = (RadioButton) namespace.get("horizontalOrientationButton");
    verticalOrientationButton = (RadioButton) namespace.get("verticalOrientationButton");
    horizontalAlignmentRightButton = (RadioButton) namespace.get("horizontalAlignmentRightButton");
    horizontalAlignmentLeftButton = (RadioButton) namespace.get("horizontalAlignmentLeftButton");
    horizontalAlignmentCenterButton = (RadioButton) namespace.get("horizontalAlignmentCenterButton");
    verticalAlignmentTopButton = (RadioButton) namespace.get("verticalAlignmentTopButton");
    verticalAlignmentBottomButton = (RadioButton) namespace.get("verticalAlignmentBottomButton");
    verticalAlignmentCenterButton = (RadioButton) namespace.get("verticalAlignmentCenterButton");
    fillCheckbox = (Checkbox) namespace.get("fillCheckbox");
    ButtonStateListener buttonStateListener = new ButtonStateListener() {

        @Override
        public void stateChanged(Button button, Button.State previousState) {
            updateBoxPaneState();
        }
    };
    horizontalOrientationButton.getButtonStateListeners().add(buttonStateListener);
    verticalOrientationButton.getButtonStateListeners().add(buttonStateListener);
    horizontalAlignmentLeftButton.getButtonStateListeners().add(buttonStateListener);
    horizontalAlignmentRightButton.getButtonStateListeners().add(buttonStateListener);
    horizontalAlignmentCenterButton.getButtonStateListeners().add(buttonStateListener);
    verticalAlignmentTopButton.getButtonStateListeners().add(buttonStateListener);
    verticalAlignmentBottomButton.getButtonStateListeners().add(buttonStateListener);
    verticalAlignmentCenterButton.getButtonStateListeners().add(buttonStateListener);
    fillCheckbox.getButtonStateListeners().add(buttonStateListener);
    updateBoxPaneState();
}
Also used : RadioButton(org.apache.pivot.wtk.RadioButton) Button(org.apache.pivot.wtk.Button) ButtonStateListener(org.apache.pivot.wtk.ButtonStateListener)

Example 12 with RadioButton

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

the class FlowPanes method initialize.

@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
    flowPane = (FlowPane) namespace.get("flowPane");
    leftRadioButton = (RadioButton) namespace.get("leftRadioButton");
    rightRadioButton = (RadioButton) namespace.get("rightRadioButton");
    centerRadioButton = (RadioButton) namespace.get("centerRadioButton");
    alignToBaselineCheckbox = (Checkbox) namespace.get("alignToBaselineCheckbox");
    ButtonStateListener buttonStateListener = new ButtonStateListener() {

        @Override
        public void stateChanged(Button button, Button.State previousState) {
            updateFlowPaneState();
        }
    };
    leftRadioButton.getButtonStateListeners().add(buttonStateListener);
    rightRadioButton.getButtonStateListeners().add(buttonStateListener);
    centerRadioButton.getButtonStateListeners().add(buttonStateListener);
    alignToBaselineCheckbox.getButtonStateListeners().add(buttonStateListener);
    updateFlowPaneState();
}
Also used : RadioButton(org.apache.pivot.wtk.RadioButton) Button(org.apache.pivot.wtk.Button) ButtonStateListener(org.apache.pivot.wtk.ButtonStateListener)

Example 13 with RadioButton

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

the class CardPanes method initialize.

@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
    cardPane = (CardPane) namespace.get("cardPane");
    previousButton = (LinkButton) namespace.get("previousButton");
    nextButton = (LinkButton) namespace.get("nextButton");
    sizeToSelectionCheckbox = (Checkbox) namespace.get("sizeToSelectionCheckbox");
    crossfadeRadioButton = (RadioButton) namespace.get("crossfadeRadioButton");
    horizontalSlideRadioButton = (RadioButton) namespace.get("horizontalSlideRadioButton");
    verticalSlideRadioButton = (RadioButton) namespace.get("verticalSlideRadioButton");
    horizontalFlipRadioButton = (RadioButton) namespace.get("horizontalFlipRadioButton");
    verticalFlipRadioButton = (RadioButton) namespace.get("verticalFlipRadioButton");
    zoomRadioButton = (RadioButton) namespace.get("zoomRadioButton");
    noneRadioButton = (RadioButton) namespace.get("noneRadioButton");
    cardPane.getCardPaneListeners().add(new CardPaneListener() {

        @Override
        public void selectedIndexChanged(CardPane cardPaneArgument, int previousSelectedIndex) {
            updateLinkButtonState();
        }
    });
    previousButton.getButtonPressListeners().add(new ButtonPressListener() {

        @Override
        public void buttonPressed(Button button) {
            cardPane.setSelectedIndex(cardPane.getSelectedIndex() - 1);
        }
    });
    nextButton.getButtonPressListeners().add(new ButtonPressListener() {

        @Override
        public void buttonPressed(Button button) {
            cardPane.setSelectedIndex(cardPane.getSelectedIndex() + 1);
        }
    });
    ButtonStateListener checkboxStateListener = new ButtonStateListener() {

        @Override
        public void stateChanged(Button button, Button.State previousState) {
            updateCardPane();
        }
    };
    sizeToSelectionCheckbox.getButtonStateListeners().add(checkboxStateListener);
    ButtonStateListener radioButtonStateListener = new ButtonStateListener() {

        @Override
        public void stateChanged(Button button, Button.State previousState) {
            if (button.isSelected()) {
                updateCardPane();
            }
        }
    };
    crossfadeRadioButton.getButtonStateListeners().add(radioButtonStateListener);
    horizontalSlideRadioButton.getButtonStateListeners().add(radioButtonStateListener);
    verticalSlideRadioButton.getButtonStateListeners().add(radioButtonStateListener);
    horizontalFlipRadioButton.getButtonStateListeners().add(radioButtonStateListener);
    verticalFlipRadioButton.getButtonStateListeners().add(radioButtonStateListener);
    zoomRadioButton.getButtonStateListeners().add(radioButtonStateListener);
    noneRadioButton.getButtonStateListeners().add(radioButtonStateListener);
    updateCardPane();
    updateLinkButtonState();
}
Also used : ButtonPressListener(org.apache.pivot.wtk.ButtonPressListener) CardPane(org.apache.pivot.wtk.CardPane) LinkButton(org.apache.pivot.wtk.LinkButton) RadioButton(org.apache.pivot.wtk.RadioButton) Button(org.apache.pivot.wtk.Button) ButtonStateListener(org.apache.pivot.wtk.ButtonStateListener) CardPaneListener(org.apache.pivot.wtk.CardPaneListener)

Aggregations

RadioButton (org.apache.pivot.wtk.RadioButton)13 Button (org.apache.pivot.wtk.Button)10 Paint (java.awt.Paint)5 RadialGradientPaint (java.awt.RadialGradientPaint)5 ButtonStateListener (org.apache.pivot.wtk.ButtonStateListener)5 LinkButton (org.apache.pivot.wtk.LinkButton)2 BasicStroke (java.awt.BasicStroke)1 Color (java.awt.Color)1 Graphics2D (java.awt.Graphics2D)1 Rectangle2D (java.awt.geom.Rectangle2D)1 URL (java.net.URL)1 Vote (org.apache.pivot.util.Vote)1 ButtonPressListener (org.apache.pivot.wtk.ButtonPressListener)1 CardPane (org.apache.pivot.wtk.CardPane)1 CardPaneListener (org.apache.pivot.wtk.CardPaneListener)1 Checkbox (org.apache.pivot.wtk.Checkbox)1 Dimensions (org.apache.pivot.wtk.Dimensions)1 ImageView (org.apache.pivot.wtk.ImageView)1 Label (org.apache.pivot.wtk.Label)1 PushButton (org.apache.pivot.wtk.PushButton)1