Search in sources :

Example 11 with GraphicComponent

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

the class CustomList method updateDisplayImage.

private void updateDisplayImage() {
    // TODO
    displayImage = ImageManager.getNewBufferedImage(getWidth(), getHeight());
    int n = 0;
    for (E e : getData()) {
        Component comp = comps.get(n);
        int h = comp.getWidth();
        int w = comp.getHeight();
        Point p = getIndexPosition(n);
        n++;
        int x = p.x;
        int y = p.y;
        Image image;
        if (comp instanceof ListItem) {
            ListItem listItem = (ListItem) comp;
            listItem.refresh();
            if (listItem.getIcon() == null) {
                continue;
            }
            image = listItem.getImage();
        } else if (comp instanceof GraphicComponent) {
            GraphicComponent graphicComponent = (GraphicComponent) comp;
            image = graphicComponent.getImg();
        } else {
            if (w == 0) {
                w = 64;
            }
            if (h == 0) {
                h = 64;
            }
            image = ImageManager.getNewBufferedImage(w, h);
            Graphics g = image.getGraphics();
            comp.paintAll(g);
            mouseMap.put(new Rectangle(x, y, w, h), e);
            displayImage.getGraphics().drawImage(image, x, y, null);
            continue;
        }
        w = image.getWidth(null);
        h = image.getHeight(null);
        mouseMap.put(new Rectangle(x, y, w, h), e);
        displayImage.getGraphics().drawImage(image, x, y, null);
    }
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) GraphicComponent(main.swing.generic.components.misc.GraphicComponent)

Example 12 with GraphicComponent

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

the class HT_View method initTabPanel.

protected HC_TabPanel initTabPanel(List<HC_Tab> tabList) {
    HC_TabPanel tabPanel = new HC_TabPanel(tabList) {

        @Override
        public void notifyListener() {
            listener.tabSelected(getSelectedTabName());
        }

        @Override
        public Component generateEmptyTabComp() {
            return new GraphicComponent(ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompHeight()));
        }

        @Override
        protected STD_SOUNDS getClickSound() {
            return STD_SOUNDS.ON_OFF;
        // return STD_SOUNDS.DIS__OPEN_MENU;
        }

        @Override
        public Component getSelectedTabComponent() {
            return super.getSelectedTabComponent();
        }

        @Override
        public ComponentVisuals getTAB() {
            // empty
            if (TAB == null) {
                TAB = new CompVisuals(ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompHeight()));
            }
            return TAB;
        }

        public int getPageSize() {
            return getTabPageSize();
        }
    };
    tabPanel.setChangeListener(this);
    return tabPanel;
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) HC_TabPanel(eidolons.client.cc.gui.neo.tabs.HC_TabPanel) CompVisuals(main.swing.generic.components.CompVisuals)

Example 13 with GraphicComponent

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

the class StatsControlComponent method addComps.

protected void addComps() {
    add(mstrPanel, "id mstrPanel, pos 0 0");
    add(attrPanel, "id attrPanel, pos 0 mstrGoldCostPool.y2");
    add(buyAttrXP, "id buyAttrXP, pos 0 mstrPanel.y2");
    add(attrXpCostPool, "id attrXpCostPool, pos buyAttrXP.x2 mstrPanel.y2");
    add(xpPool, "id xpPool, pos attrXpCostPool.x2 mstrPanel.y2");
    add(new GraphicComponent(STD_COMP_IMAGES.XP), "id xp, pos attrXpCostPool.x2+" + (xpPool.getVisuals().getWidth() - STD_COMP_IMAGES.XP.getWidth()) / 2 + " mstrPanel.y2+" + STD_COMP_IMAGES.XP.getHeight());
    add(mstrXpCostPool, "id mstrXpCostPool, pos xpPool.x2 mstrPanel.y2");
    add(buyMstrXP, "id buyMstrXP, pos mstrXpCostPool.x2 mstrPanel.y2");
    add(attrPool, "id attrPool, pos 0 " + Y_POINTS);
    add(mstrPool, "id mstrPool, pos " + (attrPanel.getVisuals().getWidth() - mstrPool.getVisuals().getWidth()) + " " + Y_POINTS);
    add(okButton, "id okButton, pos " + MigMaster.getCenteredPosition(attrPanel.getVisuals().getWidth(), okButton.getVisuals().getWidth() * 2) + " " + (Y_POINTS - 15));
    add(cancelButton, "id cancelButton, pos okButton.x2 " + (Y_POINTS - 15));
    add(buyAttrGold, "id buyAttrGold, pos 0 " + Y_GOLD);
    add(attrGoldCostPool, "id attrGoldCostPool, pos buyAttrGold.x2 " + Y_GOLD);
    add(goldPool, "id goldPool, pos attrGoldCostPool.x2 " + Y_GOLD);
    add(new GraphicComponent(STD_COMP_IMAGES.GOLD), "id gold, pos attrGoldCostPool.x2+" + (goldPool.getVisuals().getWidth() - STD_COMP_IMAGES.GOLD.getWidth()) / 2 + " " + (Y_GOLD - STD_COMP_IMAGES.GOLD.getHeight()));
    add(mstrGoldCostPool, "id mstrGoldCostPool, pos goldPool.x2 " + Y_GOLD);
    add(buyMstrGold, "id buyMstrGold, pos mstrGoldCostPool.x2 " + Y_GOLD);
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent)

Example 14 with GraphicComponent

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

the class PrincipleMiddlePanel method init.

public void init() {
    add(new GraphicComponent(STD_IMAGES.GUARDIAN), "@pos 0 max_bottom");
    add(new GraphicComponent(ImageTransformer.flipHorizontally(ImageManager.getBufferedImage(STD_IMAGES.GUARDIAN.getImage()))), "@pos max_right max_bottom");
    integrityBar = new SpecialValueBar(false, PARAMS.INTEGRITY);
    integrityBar.setObj(hero);
    rpgDescription = new TextCompDC(null, "", 18, FONT.AVQ);
    bonusTextComp = new WrappedTextComp(null, false);
    bonusTextComp.setPanelSize(new Dimension(250, 170));
    add(integrityBar, "@id bar, pos center_x 0");
    add(bonusTextComp, "@id text, pos center_x rpg.y2");
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) SpecialValueBar(eidolons.client.cc.gui.neo.bars.SpecialValueBar) TextCompDC(eidolons.swing.components.panels.page.info.element.TextCompDC) WrappedTextComp(eidolons.swing.components.panels.page.log.WrappedTextComp)

Example 15 with GraphicComponent

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

the class MapComp method addSpecialIcons.

private void addSpecialIcons() {
    Place dest = MacroGame.getGame().getPlayerParty().getCurrentDestination();
    if (dest != null) {
        Coordinates c = new Coordinates(true, dest.getCoordinates().x + DEST_OFFSET_X, dest.getCoordinates().y + DEST_OFFSET_Y);
        add(new GraphicComponent(STD_IMAGES.FLAG), c);
    }
    Place lastLocation = MacroGame.getGame().getPlayerParty().getLastLocation();
    if (lastLocation != null) {
        Coordinates c = new Coordinates(true, lastLocation.getCoordinates().x + LAST_OFFSET_X, lastLocation.getCoordinates().y + LAST_OFFSET_Y);
        add(new GraphicComponent(STD_IMAGES.FOOT), c);
    }
// last battle to be displayed?
// cities - special comps? select icon-mode - display known taverns,
// shop, ...
// ++ active route should be enlarged or so...
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) Coordinates(main.game.bf.Coordinates)

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