Search in sources :

Example 1 with HC_TabPanel

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

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

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

the class VendorListsPanel method initTabs.

protected void initTabs() {
    tabs = new HC_TabPanel();
    tabs.setENUM(DataManager.getGroupingClass(TYPE));
    tabs.setPageSize(pageSize);
    tabs.setPanelSize(VENDOR_DIMENSION);
    List<String> tabGroup = getTabGroups();
    for (String tabName : tabGroup) {
        if (checkTab(tabName)) {
            addTab(tabName);
        }
    }
    tabs.setChangeListener(this);
    if (tabGroup.isEmpty()) {
        return;
    }
    initTab(tabGroup.get(0));
    tabs.select(0);
    selectedTabName = tabGroup.get(0);
}
Also used : HC_TabPanel(eidolons.client.cc.gui.neo.tabs.HC_TabPanel)

Example 4 with HC_TabPanel

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

the class MainPanel method initTabs.

private void initTabs() {
    Chronos.mark("tabs");
    tabs = new HC_TabPanel();
    tabs.setPageSize(PAGE_SIZE);
    statsTab = new HC_StatsTab(mvp, getHero());
    classTab = new ClassTab(mvp, getHero());
    skillTab = new SkillTabNew(mvp, getHero());
    spellTab = new SpellTab(mvp, getHero());
    itemTab = new ItemsTab(mvp, getHero());
    tabArray = new HeroPanelTab[] { skillTab, statsTab, spellTab, itemTab, classTab };
    tabs.addTab(SKILLS, skillTab);
    tabs.addTab(MAIN_INFO, statsTab);
    tabs.addTab(SPELLS, spellTab);
    tabs.addTab(ITEMS, itemTab);
    tabs.addTab(CLASSES, classTab);
    tabs.setChangeListener(this);
    Chronos.logTimeElapsedForMark("tabs");
}
Also used : HC_StatsTab(eidolons.client.cc.gui.neo.tabs.HC_StatsTab) HC_TabPanel(eidolons.client.cc.gui.neo.tabs.HC_TabPanel)

Example 5 with HC_TabPanel

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

the class MainPanel method tabSelected.

@Override
public void tabSelected(int index) {
    this.index = index;
    currentTab = tabArray[index];
    currentTab.activate();
    if (currentTab.isDirty()) {
        currentTab.refresh();
    }
    view = currentTab.getLinkedView();
    mvp.activateView(view);
    mp.activateView(view);
    HC_TabPanel tabbedPanel = mvp.getCurrentViewComp().getTabbedPanel();
    Launcher.getHcKeyListener().setTabPanel(tabbedPanel);
    if (tabbedPanel != null) {
        tabbedPanel.requestFocusInWindow();
    }
    specialControls.refresh();
}
Also used : HC_TabPanel(eidolons.client.cc.gui.neo.tabs.HC_TabPanel)

Aggregations

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