Search in sources :

Example 6 with GraphicComponent

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

the class G_ScrolledPanel method addArrows.

protected void addArrows(final boolean forward) {
    String y;
    String x;
    // if (forward) {
    y = vertical ? "" + spaceTaken : "center_y@";
    x = !vertical ? "" + spaceTaken : "center_x@";
    // } else {
    // y = vertical ? "0" : "center_y@";
    // x = !vertical ? "0" : "center_x@";
    // }
    String pos = "pos " + x + " " + y;
    GraphicComponent arrow = new GraphicComponent(getArrowImage(forward));
    arrow.addMouseListener(new MouseClickListener() {

        public void mouseClicked(MouseEvent arg0) {
            arrowPressed(forward);
        }
    });
    add(arrow, pos);
    spaceTaken += (vertical ? getArrowImage(true).getHeight(null) : getArrowImage(true).getWidth(null));
}
Also used : MouseClickListener(main.swing.generic.services.listener.MouseClickListener) GraphicComponent(main.swing.generic.components.misc.GraphicComponent) MouseEvent(java.awt.event.MouseEvent)

Example 7 with GraphicComponent

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

the class AddRemoveComponent method addComps.

protected void addComps() {
    addBuffComps();
    if (CharacterCreator.getInfoSelected() != null) {
        if (CharacterCreator.getInfoSelected().getOBJ_TYPE_ENUM() == DC_TYPE.ACTIONS) {
            addIconComps();
            return;
        }
    }
    addPools();
    addIconComps();
    if (!isBuffPanelNeeded(upperPanel.getEntity())) {
        add(new GraphicComponent(VISUALS.ADD_REMOVE.getImage()), "id arc, pos " + FULL_WIDTH + "/2-" + VISUALS.ADD_REMOVE.getWidth() + "/2 " + GuiManager.getSmallObjSize());
    }
    addRemoveComp();
    addAddComp();
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent)

Example 8 with GraphicComponent

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

the class HC_PointComp method addComps.

protected void addComps() {
    if (icon != null) {
        // pos
        add(icon, "id icon, pos " + getIconOffsetX() + " " + getIconOffsetY());
        // 6
        // 6");
        setComponentZOrder(icon, getComponentCount() - 1);
    }
    if (isLocked()) {
        if (lock == null) {
            lock = new GraphicComponent(STD_COMP_IMAGES.LOCK);
            lock.addMouseListener(this);
        }
        add(lock, "id lock, pos c.x2+" + StringMaster.wrapInParenthesis("" + (getArrowOffsetX() - arrowWidth)) + " " + getArrowOffsetY() * 3 / 2);
        setComponentZOrder(lock, getComponentCount() - 1);
    } else if (editable) {
        add(upArrow, "id ua, pos c.x2+" + StringMaster.wrapInParenthesis("" + (getArrowOffsetX() - arrowWidth)) + " " + getArrowOffsetY());
        setComponentZOrder(upArrow, getComponentCount() - 1);
        add(downArrow, "id da, pos c.x2+" + StringMaster.wrapInParenthesis("" + (getArrowOffsetX() - arrowWidth)) + " ua.y2");
        setComponentZOrder(downArrow, getComponentCount() - 1);
    }
    add(textComp, "id c, pos 0 0");
    setComponentZOrder(textComp, getComponentCount() - 1);
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent)

Example 9 with GraphicComponent

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

the class HeroPanel method addComps.

private void addComps() {
    add(header, "id header, pos " + X_OFFSET + " " + Y_OFFSET);
    if (deityMode) {
        if (deityComp == null) {
            deityComp = new JLabel(hero.getDeity().getType().getIcon());
        }
        add(deityComp, "id dc, pos header.x+12 header.y2");
        add(infoPanel, "id ip, pos header.x dc.y2");
        infoPanel.setEntity(hero.getDeity());
        infoPanel.refresh();
        return;
    }
    TextCompDC xpText = new TextCompDC(null, "Level " + hero.getLevel()) {

        protected Font getDefaultFont() {
            return FontMaster.getFont(FONT.AVQ, 18, Font.BOLD);
        }
    };
    add(xpText, "@id xpText, pos center_x header.y2-6");
    add(new GraphicComponent(ImageManager.getValueIcon(PARAMS.XP), "Experience"), "@id xpIcon, pos 52 xpText.y2-30");
    xpBar.refresh();
    add(xpBar, "id xpBar, pos xpIcon.x2-2 xpText.y2-17");
    add(new GraphicComponent(ImageManager.getValueIcon(PARAMS.INTEGRITY), "integrity"), "@id integrityIcon, pos 52 xpBar.y2-3");
    integrityBar.refresh();
    add(integrityBar, "id integrityBar, pos integrityIcon.x2-2 xpBar.y2");
    TextCompDC integrityText = new TextCompDC(null, "", 16) {

        protected String getText() {
            return IntegrityRule.getDescription(hero);
        }
    };
    add(integrityText, "@id integrityText, pos center_x integrityBar.y2");
    // xp label
    add(buffPanel, "id buffs, pos header.x integrityText.y2");
    add(infoPanel, "id ip, pos header.x buffs.y2");
    infoPanel.setEntity(selectedObj != null ? selectedObj : hero);
    infoPanel.refresh();
    add(values, "id center, pos header.x ip.y2");
}
Also used : GraphicComponent(main.swing.generic.components.misc.GraphicComponent) TextCompDC(eidolons.swing.components.panels.page.info.element.TextCompDC)

Example 10 with GraphicComponent

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

the class ChoicePanel method addItemComp.

private void addItemComp(T t, int n) {
    Image img = getImage(t);
    GraphicComponent comp = new GraphicComponent(img);
    comp.setDataObject(t);
    int x = getX(n);
    int y = getY(n);
    compMap.put(comp, new Point(x, y));
    mouseMap.put(new Rectangle(getLocation().x + x, getLocation().y + y, getObjWidth(), getObjHeight()), t);
}
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