Search in sources :

Example 11 with CustomButton

use of eidolons.swing.components.buttons.CustomButton in project Eidolons by IDemiurge.

the class ChoiceView method addControls.

protected void addControls() {
    backButton = new CustomButton(VISUALS.BACK) {

        public void handleClick() {
            back();
        }
    };
    add(backButton, getBackButtonPos());
    okButton = new CustomButton(VISUALS.FORWARD_BLOCKED) {

        @Override
        public boolean isEnabled() {
            return !isOkBlocked();
        }

        public void handleClick() {
            ok();
        }
    };
    add(okButton, getOkButtonPos());
}
Also used : CustomButton(eidolons.swing.components.buttons.CustomButton)

Example 12 with CustomButton

use of eidolons.swing.components.buttons.CustomButton in project Eidolons by IDemiurge.

the class T3UpperPanel method init.

public void init() {
    heroPortrait = new PortraitComp(hero);
    controlPanel = new G_Panel();
    for (final String c : controls) {
        controlPanel.add(new CustomButton(VISUALS.BUTTON_NEW_TINY, (c)) {

            public void handleClick() {
                handleControl(c, false);
            }

            @Override
            public void handleAltClick() {
                handleControl(c, true);
            }
        });
    }
    add(controlPanel, "id cp, pos @center_x 0");
    add(heroPortrait.getComp(), "pos @center_x cp.y2");
}
Also used : G_Panel(main.swing.generic.components.G_Panel) CustomButton(eidolons.swing.components.buttons.CustomButton) PortraitComp(eidolons.client.cc.gui.neo.header.PortraitComp)

Example 13 with CustomButton

use of eidolons.swing.components.buttons.CustomButton in project Eidolons by IDemiurge.

the class HT_ControlPanel method addControls.

private void addControls() {
    viewModeButton = new CustomButton(new CompVisuals(STD_IMAGES.SEARCH.getImage())) {

        @Override
        public void handleClick() {
            handleControl(VIEW_MODE);
        }
    };
    viewModeButton.removeMouseListener(viewModeButton);
    viewModeButton.addMouseListener(view);
    add(viewModeButton);
}
Also used : CustomButton(eidolons.swing.components.buttons.CustomButton) CompVisuals(main.swing.generic.components.CompVisuals)

Example 14 with CustomButton

use of eidolons.swing.components.buttons.CustomButton in project Eidolons by IDemiurge.

the class HT_View method mouseClicked.

@Override
public void mouseClicked(MouseEvent e) {
    tree = treeCache.get(arg);
    getTree().setDisplayRequirements(false);
    if (e.getSource() instanceof CustomButton) {
        CustomButton customButton = (CustomButton) e.getSource();
        if (e.isAltDown()) {
            customButton.handleAltClick();
        } else {
            customButton.handleClick();
        }
        return;
    }
    if (e.getClickCount() > 1) {
        // else
        if (SwingUtilities.isRightMouseButton(e)) {
            // toggleViewMode();
            cycleViewMode();
            return;
        }
    }
    Point point = e.getPoint();
    HT_Node node = null;
    for (Rectangle rect : tree.getMap().getMouseMap().keySet()) {
        if (rect.contains(point)) {
            node = tree.getMap().getMouseMap().get(rect);
            break;
        }
    }
    if (node == null) {
        handleSpecialClick(e);
        return;
    }
    ObjType type = node.getValue();
    if (CoreEngine.isArcaneVault()) {
        // ARCANE VAULT ARCANE VAULT ARCANE VAULT
        if (e.isControlDown()) {
            Boolean vertical_horizontal_manual = null;
            // if (e.isShiftDown())
            // vertical_horizontal_manual =
            // SwingUtilities.isRightMouseButton(e);
            adjustLink(vertical_horizontal_manual, node);
            return;
        } else {
            if (e.isAltDown()) {
                editDefaultProp(type);
            } else if (e.isShiftDown()) {
                if (TreeControlPanel.setProp(e.isAltDown(), type)) {
                    rebuildAndSetTree();
                }
                return;
            }
        }
        if (e.getClickCount() > 1) {
            if (!SwingUtilities.isRightMouseButton(e)) {
                editImage(type);
            }
            // if (e.isAltDown()) {
            // editDefaultProp(type);
            // } else {
            // editImage(type);
            // return;
            // }
            ID_OPERATION operation = null;
            if (SwingUtilities.isRightMouseButton(e)) {
                operation = ID_OPERATION.SWAP;
            } else {
            // TODO
            }
            if (operation != null) {
                adjustIds(operation, DataManager.getSublings(type, tree.getTypes()));
                return;
            }
        }
    // NON-AV
    } else if (e.isAltDown() || e.getClickCount() > 1) {
        boolean result = CharacterCreator.getHeroManager().addItem(hero, type, getTYPE(), getPROP());
        if (result) {
            added(type);
        } else {
            DC_SoundMaster.playStandardSound(STD_SOUNDS.CLICK_BLOCKED);
            getTree().setDisplayRequirements(true);
        }
    }
    select(node, type);
// node.refresh();
}
Also used : HT_Node(eidolons.client.cc.gui.neo.tree.HT_Node) ObjType(main.entity.type.ObjType) CustomButton(eidolons.swing.components.buttons.CustomButton)

Example 15 with CustomButton

use of eidolons.swing.components.buttons.CustomButton in project Eidolons by IDemiurge.

the class StatsControlComponent method initYesNoButtons.

protected void initYesNoButtons() {
    okButton = new CustomButton(VISUALS.OK) {

        @Override
        public void handleClick() {
            // TODO enabled?
            OK();
            playClickSound();
        }
    };
    cancelButton = new CustomButton(VISUALS.CANCEL) {

        @Override
        public void handleClick() {
            // TODO dt flag for enabled()?
            resetHero();
            playDisabledSound();
        }
    };
    cancelButton.activateMouseListener();
}
Also used : CustomButton(eidolons.swing.components.buttons.CustomButton)

Aggregations

CustomButton (eidolons.swing.components.buttons.CustomButton)17 G_Panel (main.swing.generic.components.G_Panel)6 TextCompDC (eidolons.swing.components.panels.page.info.element.TextCompDC)2 PoolComp (eidolons.client.cc.gui.misc.PoolComp)1 PortraitComp (eidolons.client.cc.gui.neo.header.PortraitComp)1 HT_Node (eidolons.client.cc.gui.neo.tree.HT_Node)1 ActionButtonEnum (eidolons.swing.components.buttons.ActionButtonEnum)1 PhaseAnimation (eidolons.system.graphics.PhaseAnimation)1 ObjType (main.entity.type.ObjType)1 Coordinates (main.game.bf.Coordinates)1 TASK_COMMAND (main.gui.sub.TaskComponent.TASK_COMMAND)1 ImageButton (main.swing.components.ImageButton)1 CompVisuals (main.swing.generic.components.CompVisuals)1 VISUALS (main.swing.generic.components.G_Panel.VISUALS)1 ANIM (main.system.graphics.ANIM)1 LogEntryNode (main.system.text.LogEntryNode)1 MigLayout (net.miginfocom.swing.MigLayout)1