Search in sources :

Example 1 with DialogContainer

use of mage.client.components.ext.dlg.DialogContainer in project mage by magefree.

the class ChoiceDialog method getJButtonCancel.

/**
 * This method initializes jButtonCancel
 *
 * @return javax.swing.JButton
 */
private HoverButton getJButtonCancel() {
    if (jButtonCancel == null) {
        jButtonCancel = new HoverButton("", ImageManagerImpl.instance.getDlgCancelButtonImage(), ImageManagerImpl.instance.getDlgActiveCancelButtonImage(), ImageManagerImpl.instance.getDlgCancelButtonImage(), new Rectangle(60, 60));
        int w = getDlgParams().rect.width - 75;
        int h = getDlgParams().rect.height - 90;
        jButtonCancel.setBounds(new Rectangle(w / 2 + 150, h - 50, 60, 60));
        jButtonCancel.setToolTipText("Cancel");
        jButtonCancel.setVisible(isOptional);
        if (!isCancelStopsPlaying) {
            jButtonCancel.setToolTipText("Done (enough)");
            jButtonCancel.setBounds(new Rectangle(w / 2 + 150, h - 50, 60, 60));
        }
        jButtonCancel.setObserver(new Command() {

            private static final long serialVersionUID = -567322540616089486L;

            public void execute() {
                DialogManager.getManager(gameId).fadeOut((DialogContainer) getParent());
            /*
                    try {
                        ConnectionManager.sendAddChosenCard(null);
                    } catch (RemoteException re) {
                        re.printStackTrace();
                    }
                    */
            }
        });
    }
    return jButtonCancel;
}
Also used : Command(mage.client.util.Command) HoverButton(mage.client.components.HoverButton) DialogContainer(mage.client.components.ext.dlg.DialogContainer)

Example 2 with DialogContainer

use of mage.client.components.ext.dlg.DialogContainer in project mage by magefree.

the class ChoiceDialog method getJButtonOK.

private HoverButton getJButtonOK() {
    if (jButtonOK == null) {
        jButtonOK = new HoverButton("", ImageManagerImpl.instance.getDlgAcceptButtonImage(), ImageManagerImpl.instance.getDlgActiveAcceptButtonImage(), ImageManagerImpl.instance.getDlgAcceptButtonImage(), new Rectangle(60, 60));
        int w = getDlgParams().rect.width - 75;
        int h = getDlgParams().rect.height - 90;
        jButtonOK.setBounds(new Rectangle(w / 2 - 40, h - 50, 60, 60));
        jButtonOK.setToolTipText("Ok");
        jButtonOK.setObserver(() -> DialogManager.getManager(gameId).fadeOut((DialogContainer) getParent()));
    }
    return jButtonOK;
}
Also used : HoverButton(mage.client.components.HoverButton) DialogContainer(mage.client.components.ext.dlg.DialogContainer)

Aggregations

HoverButton (mage.client.components.HoverButton)2 DialogContainer (mage.client.components.ext.dlg.DialogContainer)2 Command (mage.client.util.Command)1