Search in sources :

Example 1 with WrappedTextComp

use of eidolons.swing.components.panels.page.log.WrappedTextComp 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 2 with WrappedTextComp

use of eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.

the class UnitGroupMaster method chooseUnit.

private static ObjType chooseUnit(ObjType factionType, int power, int max_power) {
    Map<ObjType, Integer> pool = initPool(factionType);
    List<ObjType> available = new ArrayList<>();
    for (ObjType l : pool.keySet()) {
        if (getUnitCost(l, factionType) > power) {
            continue;
        }
        if (l.getIntParam(PARAMS.POWER) > max_power) {
            continue;
        }
        available.add(l);
    }
    if (available.isEmpty()) {
        return null;
    }
    // chooseUnit();
    Map<String, String> map = new HashMap<>();
    for (ObjType type : pool.keySet()) {
        map.put(type.getName(), "Cost: " + pool.get(type) + "; Power: " + type.getIntParam(PARAMS.POWER));
    }
    ListChooser.setDecorator(new Decorator() {

        @Override
        public void addComponents(G_Panel panel) {
            G_ListPanel<ObjType> list = // new CustomList<>(getUnitList());
            new G_ListPanel<ObjType>(getUnitList()) {

                @Override
                public void setInts() {
                    wrap = 1;
                    minItems = max;
                    rowsVisible = 1;
                    layoutOrientation = JList.HORIZONTAL_WRAP;
                }

                @Override
                public boolean isVertical() {
                    return false;
                }
            };
            list.setPanelSize(new Dimension(300, 120));
            panel.add(list, "pos tp.x decor_info.y2");
            WrappedTextComp textComp = new WrappedTextComp(null) {

                @Override
                protected Color getColor() {
                    return Color.black;
                }

                @Override
                public synchronized List<String> getTextLines() {
                    List<String> list = new ArrayList<>();
                    list.add(UnitGroupMaster.getRemainingPower() + " points remaining");
                    list.add("Size contraints: between " + min + " and " + max);
                    return list;
                }
            };
            textComp.setDefaultSize(new Dimension(300, 120));
            panel.add(textComp, "id decor_info, pos tp.x tp.y2");
        }
    });
    ListChooser.setTooltipMapForComponent(map);
    ListChooser.setSortingDisabled(true);
    return ListChooser.chooseType_(available, DC_TYPE.UNITS);
// gui - a list per ally
}
Also used : G_ListPanel(main.swing.generic.components.panels.G_ListPanel) HashMap(java.util.HashMap) G_Panel(main.swing.generic.components.G_Panel) ArrayList(java.util.ArrayList) Decorator(main.swing.generic.Decorator) ObjType(main.entity.type.ObjType) WrappedTextComp(eidolons.swing.components.panels.page.log.WrappedTextComp) List(java.util.List) ArrayList(java.util.ArrayList)

Example 3 with WrappedTextComp

use of eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.

the class PartyHeader method createComponents.

public void createComponents() {
    locationComp = new WrappedTextComp(VISUALS.VALUE_BOX_BIG, true);
    header = new Header(new ArrayList<>(Arrays.asList(party_params)), party);
    add(locationComp, "@pos center_x 20, id lc");
    add(header, "@pos center_x lc.y2, id header");
// status: en route, in town, at place, lost, in flight, in battle..
}
Also used : WrappedTextComp(eidolons.swing.components.panels.page.log.WrappedTextComp) ArrayList(java.util.ArrayList)

Example 4 with WrappedTextComp

use of eidolons.swing.components.panels.page.log.WrappedTextComp 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 5 with WrappedTextComp

use of eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.

the class TimeComp method init.

private void init() {
    // ++ area/region?
    removeAll();
    // new GraphicComponent(date.isDay_or_night() ? STD_IMAGES.DAY.getImg()
    // : STD_IMAGES.NIGHT.getImg());
    textComp = new WrappedTextComp(VISUALS.VALUE_BOX_BIG) {

        protected int getDefaultFontSize() {
            return 17;
        }

        public void refresh() {
            String line1 = "The " + StringMaster.getOrdinalEnding(date.getDay()) + (date.getMonth() != null ? " of " + date.getMonth() : "");
            line1 = date.getShortString();
            String line2 = date.getYear() + " of " + date.getEra();
            line2 = date.getStringExtension();
            textLines = new ListMaster<String>().getList(line1, line2);
            super.refresh();
        }

        @Override
        protected boolean isAutoWrapText() {
            return false;
        }
    };
    // textComp.setText(date.getShortString());
    // textComp.setPanelSize(size);
    add(textComp);
    revalidate();
}
Also used : WrappedTextComp(eidolons.swing.components.panels.page.log.WrappedTextComp)

Aggregations

WrappedTextComp (eidolons.swing.components.panels.page.log.WrappedTextComp)6 ArrayList (java.util.ArrayList)2 G_Panel (main.swing.generic.components.G_Panel)2 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)2 SpecialValueBar (eidolons.client.cc.gui.neo.bars.SpecialValueBar)1 TextCompDC (eidolons.swing.components.panels.page.info.element.TextCompDC)1 HashMap (java.util.HashMap)1 List (java.util.List)1 PARAMETER (main.content.values.parameters.PARAMETER)1 ObjType (main.entity.type.ObjType)1 Decorator (main.swing.generic.Decorator)1 G_ListPanel (main.swing.generic.components.panels.G_ListPanel)1 MigLayout (net.miginfocom.swing.MigLayout)1