Search in sources :

Example 6 with LinkButton

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

the class TerraLinkButtonSkin method getPreferredWidth.

@Override
public int getPreferredWidth(int height) {
    LinkButton linkButton = (LinkButton) getComponent();
    Button.DataRenderer dataRenderer = linkButton.getDataRenderer();
    dataRenderer.render(linkButton.getButtonData(), linkButton, false);
    return dataRenderer.getPreferredWidth(height);
}
Also used : LinkButton(org.apache.pivot.wtk.LinkButton) Button(org.apache.pivot.wtk.Button) LinkButton(org.apache.pivot.wtk.LinkButton)

Example 7 with LinkButton

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

the class TerraLinkButtonSkin method getPreferredHeight.

@Override
public int getPreferredHeight(int width) {
    LinkButton linkButton = (LinkButton) getComponent();
    Button.DataRenderer dataRenderer = linkButton.getDataRenderer();
    dataRenderer.render(linkButton.getButtonData(), linkButton, false);
    return dataRenderer.getPreferredHeight(width);
}
Also used : LinkButton(org.apache.pivot.wtk.LinkButton) Button(org.apache.pivot.wtk.Button) LinkButton(org.apache.pivot.wtk.LinkButton)

Example 8 with LinkButton

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

the class TerraLinkButtonSkin method getPreferredSize.

@Override
public Dimensions getPreferredSize() {
    LinkButton linkButton = (LinkButton) getComponent();
    Button.DataRenderer dataRenderer = linkButton.getDataRenderer();
    dataRenderer.render(linkButton.getButtonData(), linkButton, false);
    return dataRenderer.getPreferredSize();
}
Also used : LinkButton(org.apache.pivot.wtk.LinkButton) Button(org.apache.pivot.wtk.Button) LinkButton(org.apache.pivot.wtk.LinkButton)

Example 9 with LinkButton

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

LinkButton (org.apache.pivot.wtk.LinkButton)9 Button (org.apache.pivot.wtk.Button)6 RadioButton (org.apache.pivot.wtk.RadioButton)2 URL (java.net.URL)1 BoxPane (org.apache.pivot.wtk.BoxPane)1 ButtonPressListener (org.apache.pivot.wtk.ButtonPressListener)1 ButtonStateListener (org.apache.pivot.wtk.ButtonStateListener)1 CardPane (org.apache.pivot.wtk.CardPane)1 CardPaneListener (org.apache.pivot.wtk.CardPaneListener)1 Checkbox (org.apache.pivot.wtk.Checkbox)1 Component (org.apache.pivot.wtk.Component)1 ComponentMouseListener (org.apache.pivot.wtk.ComponentMouseListener)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 TablePane (org.apache.pivot.wtk.TablePane)1 ButtonData (org.apache.pivot.wtk.content.ButtonData)1 Image (org.apache.pivot.wtk.media.Image)1