Search in sources :

Example 1 with HC_Tab

use of eidolons.client.cc.gui.neo.tabs.HC_Tab 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)

Example 2 with HC_Tab

use of eidolons.client.cc.gui.neo.tabs.HC_Tab 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 3 with HC_Tab

use of eidolons.client.cc.gui.neo.tabs.HC_Tab in project Eidolons by IDemiurge.

the class LE_Palette method deletePalettes.

protected void deletePalettes(boolean removeFile) {
    // int i = DialogMaster.optionChoice(paletteTabs.getTabs().toArray(),
    // "choose palette to remove");
    // paletteTabs.removeTab(i);
    List<String> list = new ArrayList<>();
    for (HC_Tab tab : paletteTabs.getTabs()) {
        list.add(tab.getName());
    }
    String string = new ListChooser(SELECTION_MODE.MULTIPLE, list, false).choose();
    for (String ws : StringMaster.open(string)) {
        int i = list.indexOf(ws);
        paletteTabs.removeTab(i);
        if (removeFile) {
            FileManager.getFile(getWorkspaceFolder() + ws + ".xml").delete();
        }
    }
    // if (!removeFile) {
    // if (DialogMaster.confirm("Remove File?"))
    // FileManager.getFile(getWorkspaceFolder()).delete();
    // } else
    refresh();
}
Also used : ArrayList(java.util.ArrayList) HC_Tab(eidolons.client.cc.gui.neo.tabs.HC_Tab) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 4 with HC_Tab

use of eidolons.client.cc.gui.neo.tabs.HC_Tab in project Eidolons by IDemiurge.

the class MainViewPanel method goToSkillTree.

public void goToSkillTree(PARAMETER param) {
    if (treeView == null || !treeViewMode) {
        toggleTreeView();
    }
    treeArg = param;
    // if (!treeViewMode)
    // else {
    int i = 0;
    // if (treeView.isAlt)
    for (HC_Tab tab : treeView.getTabList()) {
        if (tab.getName().equalsIgnoreCase(param.getName())) {
            break;
        }
        i++;
    }
    treeView.getDisplayedTabPanel().adjustPageIndexToSelectTab(treeView.getTabList().get(i));
    treeView.getDisplayedTabPanel().select(i);
    treeView.tabSelected(param.getName());
    treeView.refresh();
// }
}
Also used : HC_Tab(eidolons.client.cc.gui.neo.tabs.HC_Tab)

Aggregations

HC_Tab (eidolons.client.cc.gui.neo.tabs.HC_Tab)4 ArrayList (java.util.ArrayList)3 HC_TabPanel (eidolons.client.cc.gui.neo.tabs.HC_TabPanel)2 G_Component (main.swing.generic.components.G_Component)2 G_Panel (main.swing.generic.components.G_Panel)2 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)2 CLASS_GROUP (main.content.enums.entity.HeroEnums.CLASS_GROUP)1 PARAMETER (main.content.values.parameters.PARAMETER)1 ListChooser (main.swing.generic.components.editors.lists.ListChooser)1