Search in sources :

Example 1 with GraphicComponent

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

the class ChoicePanel method refresh.

@Override
public void refresh() {
    for (Component c : compMap.keySet()) {
        if (c instanceof GraphicComponent) {
            GraphicComponent graphicComponent = (GraphicComponent) c;
            graphicComponent.setImg(getImage((T) graphicComponent.getDataObject()));
        }
    }
    if (lastSelected != null) {
        initTooltip(lastSelected);
    }
    super.refresh();
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) GraphicComponent(main.swing.generic.components.misc.GraphicComponent)

Example 2 with GraphicComponent

use of main.swing.generic.components.misc.GraphicComponent 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 3 with GraphicComponent

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

the class HC_PointView method addComps.

private void addComps() {
    paramBonusInfoComp = new WrappedTextComp(null, // VISUALS.OPTION_PANEL_3
    false) {

        @Override
        public Dimension getPanelSize() {
            return new Dimension(400, 140);
        }
    };
    // wtc.setPanelSize(size)
    paramBonusInfoComp.setDefaultSize(new Dimension(400, getDefaultY() - 15));
    paramBonusInfoComp.setDefaultFont(FontMaster.getFont(FONT.AVQ, 18, Font.PLAIN));
    // centering?
    add(paramBonusInfoComp, "id wtc, pos " + 0 + " " + 0);
    add(new GraphicComponent(VISUALS.DRAGON_DIVIDER.getImage()), "id div, @pos center_x+24 wtc.y2-24");
    // DIVIDER
    X = getDefaultX();
    Y = getDefaultY();
    i = 0;
    if (!attributes) {
        if (editable) {
            DC_ContentManager.sortMasteries(hero, params);
        }
    }
    for (PARAMETER p : params) {
        boolean editable = isEditable(p);
        HC_PointComp comp = new HC_PointComp(editable, hero, buffer, p, (attributes) ? PARAMS.ATTR_POINTS : PARAMS.MASTERY_POINTS);
        addComponent(comp, p);
    }
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) WrappedTextComp(eidolons.swing.components.panels.page.log.WrappedTextComp) PARAMETER(main.content.values.parameters.PARAMETER)

Example 4 with GraphicComponent

use of main.swing.generic.components.misc.GraphicComponent 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 5 with GraphicComponent

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

the class MasteryIconColumn method getMasteryIconComp.

public Component getMasteryIconComp(PARAMETER mastery) {
    // boolean locked = DC_MathManager.isMasteryUnlocked(hero, mastery);
    Image img = HC_Master.generateValueIcon(mastery, false);
    GraphicComponent comp = new GraphicComponent(img);
    comp.addMouseListener(this);
    comp.setDataObject(mastery);
    return comp;
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent)

Aggregations

GraphicComponent (main.swing.generic.components.misc.GraphicComponent)17 HC_TabPanel (eidolons.client.cc.gui.neo.tabs.HC_TabPanel)3 HC_Tab (eidolons.client.cc.gui.neo.tabs.HC_Tab)2 TextCompDC (eidolons.swing.components.panels.page.info.element.TextCompDC)2 WrappedTextComp (eidolons.swing.components.panels.page.log.WrappedTextComp)2 BufferedImage (java.awt.image.BufferedImage)2 ArrayList (java.util.ArrayList)2 PARAMETER (main.content.values.parameters.PARAMETER)2 G_Component (main.swing.generic.components.G_Component)2 G_Panel (main.swing.generic.components.G_Panel)2 SpecialValueBar (eidolons.client.cc.gui.neo.bars.SpecialValueBar)1 MouseEvent (java.awt.event.MouseEvent)1 CLASS_GROUP (main.content.enums.entity.HeroEnums.CLASS_GROUP)1 ObjType (main.entity.type.ObjType)1 Coordinates (main.game.bf.Coordinates)1 CompVisuals (main.swing.generic.components.CompVisuals)1 MouseClickListener (main.swing.generic.services.listener.MouseClickListener)1