Search in sources :

Example 11 with G_Panel

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

the class UnlockDialog method createComponent.

@Override
public Component createComponent() {
    G_Panel panel = new G_Panel(PANEL_WIDE);
    CustomButton xpButton = new UnlockButton(true);
    xpButton.setToolTipText(XP);
    xpButton.setText(xpCost + " xp");
    CustomButton goldButton = new UnlockButton(false);
    goldButton.setText(goldCost + " gold");
    goldButton.setToolTipText(GOLD);
    CustomButton cancelButton = new CustomButton(VISUALS.CANCEL) {

        @Override
        public void handleClick() {
            cancel();
        }
    };
    TextCompDC label = new TextCompDC(VISUALS.PROP_BOX);
    label.setText("Unlock " + param.getName());
    panel.add(label, "pos 20 50");
    if (xpCost > 0) {
        panel.add(xpButton, "pos 50 100");
    }
    panel.add(cancelButton, "pos 300 50");
    if (goldCost > 0) {
        panel.add(goldButton, "pos 300 100");
    }
    return panel;
}
Also used : G_Panel(main.swing.generic.components.G_Panel) CustomButton(eidolons.swing.components.buttons.CustomButton) TextCompDC(eidolons.swing.components.panels.page.info.element.TextCompDC)

Example 12 with G_Panel

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

the class SkillTreeView method initTabList.

protected List<HC_Tab> initTabList() {
    List<HC_Tab> tabList = new ArrayList<>();
    // 'mine only' mode
    // for (SKILL_DISPLAY_GROUPS group : SKILL_DISPLAY_GROUPS.values())
    PARAMETER[] array = getParamsFromMasteryWorkspaceArray();
    if (array == null) {
        array = ValuePages.MASTERIES;
    }
    List<PARAMETER> masteries = new ArrayList<>(Arrays.asList(array));
    if (mineOnly) {
        masteries = DC_MathManager.getUnlockedMasteries(hero);
    }
    DC_ContentManager.sortMasteries(hero, masteries);
    for (final PARAMETER mastery : masteries) {
        // DC_ContentManager.getMasteries()
        HC_Tab tab = tabMap.get(mastery);
        if (tab == null) {
            G_Component comp = new G_Panel(getPanelVisuals());
            int index = 0;
            tab = new HC_Tab(mastery.getName(), comp, index) {

                @Override
                public Component generateTabComp(HC_TabPanel panel) {
                    return new GraphicComponent(ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompWidth())) {

                        public Image getImg() {
                            boolean locked = !DC_MathManager.isMasteryUnlocked(hero, mastery);
                            try {
                                image = HC_Master.generateValueIcon(mastery, isSelected(), locked, true);
                            } catch (Exception e) {
                                main.system.ExceptionMaster.printStackTrace(e);
                                image = ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompWidth());
                            }
                            return image;
                        }
                    };
                }
            };
        }
        tabList.add(tab);
        tabMap.put(mastery, tab);
    }
    return tabList;
}
Also used : 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) PARAMETER(main.content.values.parameters.PARAMETER)

Example 13 with G_Panel

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

the class LE_PlanPanel method refresh.

public void refresh() {
    previontrolGroup = controlGroup;
    controlGroup = DYNAMIC_CONTROL_GROUPS.MISSION;
    if (LevelEditor.isMouseInfoMode()) {
        controlGroup = DYNAMIC_CONTROL_GROUPS.OBJ;
    } else {
        if (LevelEditor.isLevelSelected()) {
            controlGroup = DYNAMIC_CONTROL_GROUPS.LEVEL;
        } else if (getSelectedBlock() != null) {
            controlGroup = DYNAMIC_CONTROL_GROUPS.BLOCK;
        }
    }
    if (previontrolGroup != controlGroup) {
        G_Panel panel = getControlPanel(controlGroup);
        dynamicControlPanel.removeAll();
        dynamicControlPanel.add(panel, "pos 0 0");
        dynamicControlPanel.revalidate();
    }
    prevTree = treePanel;
    treePanel = treePanels.get(getPlan());
    if (treePanel == null) {
        treePanel = new LE_TreePlanPanel(this, getPlan());
        treePanels.put(getPlan(), treePanel);
    }
    if (prevTree != treePanel) {
        resetTree();
    }
    // resetComponents();
    super.refresh();
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 14 with G_Panel

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

the class LE_PlanPanel method resetComponents.

private void resetComponents() {
    int treeHeight = LE_TreePlanPanel.ROW_HEIGHT * LE_TreePlanPanel.ROWS_DISPLAYED;
    treeHolder.setPanelSize(new Dimension(VISUALS.PLAN_PANEL_FRAME.getWidth() - 50, treeHeight));
    removeAll();
    add(treeHolder, "id tree, pos 60 90");
    add(new G_Panel(VISUALS.DRAGON_DIVIDER_SMALL), "id d, pos 52 tree.y2");
    add(dynamicControlPanel, "id dcp, pos 67 d.y2+4");
    add(new G_Panel(VISUALS.DRAGON_DIVIDER_SMALL), "id d2, pos 52 dcp.y2");
    add(controlPanel, "id controlPanel, pos 67 d2.y2+4");
    revalidate();
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 15 with G_Panel

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

the class LE_TreePlanPanel method getBlockComponent.

private Component getBlockComponent(String iconPath, String labelText, boolean selected) {
    // cache?
    G_Panel comp = new G_Panel();
    // extract to m
    ImageIcon icon = ImageManager.getIcon(iconPath);
    JLabel comp2 = new JLabel(icon);
    comp.add(comp2, "id lbl");
    JLabel comp3 = new JLabel(labelText);
    comp3.setForeground(ColorManager.GOLDEN_WHITE);
    comp.add(comp3, "x lbl.x2+4");
    if (selected) {
        // comp3.setBackground(ColorManager.GOLDEN_WHITE);
        // comp3.setForeground(ColorManager.OBSIDIAN);
        comp3.setBackground(ColorManager.PURPLE);
        comp3.setForeground(ColorManager.GOLDEN_WHITE);
        comp3.setOpaque(true);
    }
    // text name?
    return comp;
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

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