Search in sources :

Example 1 with SmallItem

use of eidolons.swing.components.panels.page.small.SmallItem in project Eidolons by IDemiurge.

the class ContainerIconElement method getPageData.

@Override
protected List<List<SmallItem>> getPageData() {
    if (property == G_PROPS.STANDARD_PASSIVES || property == G_PROPS.PASSIVES) {
        iconSize = GuiManager.getSmallObjSize() / 2;
        pageSize = PAGE_SIZE_SMALL;
        Collection<SmallItem> fullList = new ArrayList<>();
        for (String subString : StringMaster.open(entity.getProperty(G_PROPS.CLASSIFICATIONS))) {
            CLASSIFICATIONS classif = new EnumMaster<CLASSIFICATIONS>().retrieveEnumConst(CLASSIFICATIONS.class, subString);
            if (classif != null) {
                if (classif.isDisplayed()) {
                    fullList.add(new SmallItem(classif, classif.getImagePath(), classif.getName(), classif.getToolTip()));
                }
            }
        }
        for (String subString : StringMaster.open(entity.getProperty(G_PROPS.STANDARD_PASSIVES))) {
            STANDARD_PASSIVES std_pas = new EnumMaster<STANDARD_PASSIVES>().retrieveEnumConst(STANDARD_PASSIVES.class, subString);
            if (std_pas != null) {
                fullList.add(new SmallItem(std_pas, std_pas.getImagePath(), std_pas.getName(), std_pas.getToolTip()));
            }
        }
        for (AbilityObj passive : entity.getPassives()) {
            if (passive == null) {
                continue;
            }
            if (passive.getProperty(G_PROPS.ABILITY_GROUP, true).equalsIgnoreCase(DISPLAYED_PASSIVES)) {
                fullList.add(new SmallItem(passive));
            }
        }
        return splitList(fullList);
    }
    return null;
}
Also used : AbilityObj(main.ability.AbilityObj) SmallItem(eidolons.swing.components.panels.page.small.SmallItem) ArrayList(java.util.ArrayList) STANDARD_PASSIVES(main.content.enums.entity.UnitEnums.STANDARD_PASSIVES) CLASSIFICATIONS(main.content.enums.entity.UnitEnums.CLASSIFICATIONS)

Aggregations

SmallItem (eidolons.swing.components.panels.page.small.SmallItem)1 ArrayList (java.util.ArrayList)1 AbilityObj (main.ability.AbilityObj)1 CLASSIFICATIONS (main.content.enums.entity.UnitEnums.CLASSIFICATIONS)1 STANDARD_PASSIVES (main.content.enums.entity.UnitEnums.STANDARD_PASSIVES)1