Search in sources :

Example 6 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class SessionWindow method initBoxPanel.

private G_Panel initBoxPanel() {
    G_Panel boxPanel = new G_Panel("flowy");
    int i = 0;
    for (Class c : comboBoxes) {
        List<String> list = ListMaster.toStringList(true, null, c.getEnumConstants());
        JComboBox<String> box = new JComboBox<>(list.toArray(new String[list.size()]));
        // int x = 0, y = 0;
        // String pos = "pos " + x + " " + y;
        String pos = "";
        i++;
        if (i >= wrapComboBoxes) {
            i = 0;
            pos = "wrap";
        }
        boxPanel.add(box, pos);
    }
    return boxPanel;
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 7 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class EntityChoiceDialog method createComponent.

@Override
public Component createComponent() {
    G_Panel comp = new G_Panel();
    choicePanel = getChoicePanel();
    CustomButton okButton = new CustomButton(VISUALS.OK) {

        @Override
        public void handleClick() {
            ok();
        }
    };
    CustomButton closeButton = new CustomButton(VISUALS.CANCEL) {

        @Override
        public void handleClick() {
            WaitMaster.interrupt(getWaitOperation());
            close();
        }
    };
    comp.setOpaque(true);
    comp.setBackground(ColorManager.BACKGROUND);
    int x = choicePanel.getPanelWidth();
    // n * getObjSize();
    comp.add(choicePanel);
    comp.add(okButton, "id ok, pos " + x + " 0");
    comp.add(closeButton, "pos ok.x @max_bottom, id close");
    // comp.add(list, "id list, pos 0 0");
    comp.setPanelSize(getSize());
    return comp;
}
Also used : G_Panel(main.swing.generic.components.G_Panel) CustomButton(eidolons.swing.components.buttons.CustomButton)

Example 8 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class OperationWindow method createComponent.

public Component createComponent() {
    panel = new G_Panel(getVisuals());
    operationsPool = new PoolComp(getPoolText(), getPoolTooltip(), false);
    // 
    CustomButton okButton = new CustomButton(OK) {

        public void handleClick() {
            done();
        }

        protected boolean isMoreY() {
            return true;
        }
    };
    CustomButton cancelButton = new CustomButton(CANCEL) {

        protected boolean isMoreY() {
            return true;
        }

        public void handleClick() {
            cancel();
        }
    };
    panel.add(getComponent(), "id tab, pos " + GuiManager.PANEL_FRAME_WIDTH + " " + GuiManager.PANEL_FRAME_HEIGHT);
    panel.add(okButton, "@id ok, pos max_right-" + GuiManager.PANEL_FRAME_WIDTH + " max_top-" + GuiManager.PANEL_FRAME_HEIGHT);
    panel.add(cancelButton, "@id cancel, pos max_right-" + GuiManager.PANEL_FRAME_WIDTH + " ok.y2");
    panel.add(operationsPool, "@id op, pos max_right-" + GuiManager.PANEL_FRAME_WIDTH + " cancel.y2");
    panel.setBackground(ColorManager.BACKGROUND);
    return panel;
}
Also used : PoolComp(eidolons.client.cc.gui.misc.PoolComp) G_Panel(main.swing.generic.components.G_Panel) CustomButton(eidolons.swing.components.buttons.CustomButton)

Example 9 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class T3InfoPanel method init.

public void init() {
    Entity skill = null;
    try {
        skill = CharacterCreator.getHero().getSkills().get(flipped ? 1 : 0);
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    infoPanel = new DC_PagedInfoPanel(skill);
    ImageIcon icon = ImageManager.getEmptyItemIcon(flipped);
    if (skill != null) {
        icon = skill.getIcon();
    }
    label = new JLabel(icon);
    controlPanel = new G_Panel();
    controlPanel.setPanelSize(new Dimension(122, getPanelSize().height));
    costPool = new PoolComp(skill, PARAMS.XP_COST, "Experience cost", false);
    xpPool = new PoolComp(CharacterCreator.getHero(), PARAMS.XP, "Experience points", true) {
    };
    addComps();
}
Also used : Entity(main.entity.Entity) DC_PagedInfoPanel(eidolons.swing.components.panels.page.info.DC_PagedInfoPanel) PoolComp(eidolons.client.cc.gui.misc.PoolComp) G_Panel(main.swing.generic.components.G_Panel)

Example 10 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class ClassTreeView method initTabList.

@Override
protected List<HC_Tab> initTabList() {
    List<HC_Tab> tabList = new ArrayList<>();
    List<CLASS_GROUP> classes = new ArrayList<>(Arrays.asList(HeroEnums.CLASS_GROUP.values()));
    // }
    for (final CLASS_GROUP classGroup : classes) {
        if (classGroup == HeroEnums.CLASS_GROUP.MULTICLASS) {
            continue;
        }
        HC_Tab tab = tabMap.get(classGroup);
        if (tab == null) {
            G_Component comp = new G_Panel(getPanelVisuals()) {

                public boolean isBackgroundVisuals() {
                    return !super.isBackgroundVisuals();
                }
            };
            int index = 0;
            tab = new HC_Tab(classGroup.getName(), comp, index) {

                @Override
                public Component generateTabComp(HC_TabPanel panel) {
                    return new GraphicComponent(ImageManager.getNewBufferedImage(isSelected() ? getSelectedTabCompWidth() : getTabCompWidth(), getTabCompHeight())) {

                        public Image getImg() {
                            boolean locked = !hasClass(classGroup);
                            try {
                                image = HC_Master.generateClassIcon(classGroup, isSelected(), locked, hero);
                            } catch (Exception e) {
                                main.system.ExceptionMaster.printStackTrace(e);
                                image = ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompWidth());
                            }
                            setCompSize(new Dimension(image.getWidth(null), image.getHeight(null)));
                            return image;
                        }
                    };
                }
            };
        }
        tabList.add(tab);
        tabMap.put(classGroup, tab);
    }
    return tabList;
}
Also used : CLASS_GROUP(main.content.enums.entity.HeroEnums.CLASS_GROUP) G_Panel(main.swing.generic.components.G_Panel) HC_Tab(eidolons.client.cc.gui.neo.tabs.HC_Tab) ArrayList(java.util.ArrayList) G_Component(main.swing.generic.components.G_Component) HC_TabPanel(eidolons.client.cc.gui.neo.tabs.HC_TabPanel) GraphicComponent(main.swing.generic.components.misc.GraphicComponent) G_Component(main.swing.generic.components.G_Component) GraphicComponent(main.swing.generic.components.misc.GraphicComponent)

Aggregations

G_Panel (main.swing.generic.components.G_Panel)59 CustomButton (eidolons.swing.components.buttons.CustomButton)6 List (java.util.List)4 PARAMETER (main.content.values.parameters.PARAMETER)4 ObjType (main.entity.type.ObjType)4 TextComp (main.swing.components.TextComp)4 ArrayList (java.util.ArrayList)3 XLinkedMap (main.data.XLinkedMap)3 MigLayout (net.miginfocom.swing.MigLayout)3 PoolComp (eidolons.client.cc.gui.misc.PoolComp)2 HC_Tab (eidolons.client.cc.gui.neo.tabs.HC_Tab)2 HC_TabPanel (eidolons.client.cc.gui.neo.tabs.HC_TabPanel)2 WrappedTextComp (eidolons.swing.components.panels.page.log.WrappedTextComp)2 MusicList (main.music.entity.MusicList)2 MusicListPanel (main.music.gui.MusicListPanel)2 G_Component (main.swing.generic.components.G_Component)2 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)2 PortraitComp (eidolons.client.cc.gui.neo.header.PortraitComp)1 HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)1 PartyComp (eidolons.game.module.adventure.gui.map.obj.PartyComp)1