Search in sources :

Example 1 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class HT_View method adjustLink.

public void adjustLink(Boolean vertical_horizontal_manual, HT_Node node) {
    ObjType type = node.getType();
    LINK_VARIANT variant = null;
    if (tree.getMap().getLinkForChildType(type) != null) {
        variant = tree.getMap().getLinkForChildType(type).getVariant();
    }
    if (variant == null || vertical_horizontal_manual == null) {
        variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
    } else {
        variant = HT_MapBuilder.getShiftedLinkVariant(variant, vertical_horizontal_manual);
    }
    if (variant == null) {
        LogMaster.log(1, type + "'s LINK_VARIANT null !!! ");
        return;
    }
    type.setProperty(PROPS.LINK_VARIANT, variant.toString());
    if (!CoreEngine.isArcaneVault()) {
        XML_Writer.writeXML_ForType(type, isSkill() ? DC_TYPE.SKILLS : DC_TYPE.CLASSES);
    }
    LogMaster.log(1, type + "'s LINK_VARIANT set for " + variant);
    rebuildAndSetTree();
}
Also used : ObjType(main.entity.type.ObjType) EnumMaster(main.system.auxiliary.EnumMaster) LINK_VARIANT(eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 2 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class LE_Palette method newPalette.

public void newPalette() {
    int optionChoice = DialogMaster.optionChoice("Choose object TYPE...", default_palette);
    OBJ_TYPE TYPE;
    List<ObjType> typeList;
    if (optionChoice == -1) {
        if (DialogMaster.confirm("Multi-type Palette?")) {
            optionChoice = DialogMaster.optionChoice("Choose object multi TYPE...", multi_types);
            if (optionChoice == -1) {
                return;
            }
            TYPE = multi_types[optionChoice];
            typeList = DataManager.getTypes(TYPE);
        } else {
            return;
        }
    } else {
        TYPE = default_palette[optionChoice];
        typeList = DataManager.getTypes(TYPE);
    }
    // int index = DialogMaster.optionChoice("Choose object TYPE...",
    // palettes.toArray());
    // PaletteWorkspace ws = palettes.getOrCreate(index);
    List<String> listData = DataManager.toStringList(typeList);
    List<String> secondListData = (TYPE instanceof C_OBJ_TYPE) ? new ArrayList<>() : DataManager.toStringList(typeList);
    // if (ws != null) {
    // secondListData = DataManager.convertToStringList(ws.getTypeList());
    // }
    String data = new ListChooser(listData, secondListData, false, TYPE).choose();
    if (data == null) {
        return;
    }
    List<ObjType> list = DataManager.toTypeList(data, TYPE);
    String name = DialogMaster.inputText();
    imagePath = new ImageChooser().launch(imagePath, "");
    PaletteWorkspace ws = new PaletteWorkspace(name, list, imagePath);
    addWorkspaceTab(ws);
    saveWorkspace(ws);
}
Also used : C_OBJ_TYPE(main.content.C_OBJ_TYPE) C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType) ImageChooser(main.swing.generic.components.editors.ImageChooser) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 3 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class LE_Palette method chooseWorkspaces.

public List<PaletteWorkspace> chooseWorkspaces() {
    List<String> list = new ArrayList<>();
    List<PaletteWorkspace> chosenPalettes = new ArrayList<>();
    for (PaletteWorkspace ws : workspaces) {
        ObjType type = new ObjType(ws.getName());
        type.setOBJ_TYPE_ENUM(DC_TYPE.META);
        type.setImage(imagePath);
        list.add(type.getName());
    }
    List<String> chosen = StringMaster.openContainer(new ListChooser(list, new ArrayList<>(), false, DC_TYPE.META).choose());
    for (String name : chosen) {
        for (PaletteWorkspace p : palettes) {
            if (p.getName().equals(name)) {
                chosenPalettes.add(p);
            }
        }
    }
    return chosenPalettes;
}
Also used : ObjType(main.entity.type.ObjType) ArrayList(java.util.ArrayList) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 4 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class HeroCreator method chooseBaseType.

public ObjType chooseBaseType() {
    List<String> listData = DataManager.getHeroList(RANK.NEW_HERO.toString());
    ListChooser lc = new ListChooser(listData, false, DC_TYPE.CHARS);
    lc.setColumns(3);
    String name = lc.getString();
    return DataManager.getType(name, DC_TYPE.CHARS);
}
Also used : ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 5 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class AV_ButtonPanel method cleanUp.

private void cleanUp() {
    String string = "What do I clean up now?..";
    String TRUE = "Group";
    String FALSE = "Subgroup";
    String NULL = "XML";
    Boolean result = DialogMaster.askAndWait(string, TRUE, FALSE, NULL);
    if (result == null) {
        XML_Transformer.cleanUp();
        return;
    }
    OBJ_TYPE TYPE = ArcaneVault.getSelectedOBJ_TYPE();
    String subgroup = (result) ? ArcaneVault.getSelectedType().getGroupingKey() : ArcaneVault.getSelectedType().getSubGroupingKey();
    List<String> types = (result) ? DataManager.getTypesGroupNames(TYPE, subgroup) : DataManager.getTypesSubGroupNames(TYPE, subgroup);
    List<String> retained = StringMaster.openContainer(new ListChooser(SELECTION_MODE.MULTIPLE, types, TYPE).choose());
    for (String t : types) {
        if (retained.contains(t)) {
            continue;
        }
        DataManager.removeType(t, TYPE.getName());
    }
    ArcaneVault.getMainBuilder().getTreeBuilder().reload();
    int n = ArcaneVault.getMainBuilder().getTree().getRowCount();
    ArcaneVault.getMainBuilder().getTree().setSelectionRow(Math.min(1, n));
    ArcaneVault.getMainBuilder().getTree().getListeners(TreeSelectionListener.class)[0].valueChanged(new TreeSelectionEvent(ArcaneVault.getMainBuilder().getTree(), null, null, null, null));
    ArcaneVault.getMainBuilder().getEditViewPanel().refresh();
// reset tree
}
Also used : ListChooser(main.swing.generic.components.editors.lists.ListChooser) TreeSelectionEvent(javax.swing.event.TreeSelectionEvent)

Aggregations

ListChooser (main.swing.generic.components.editors.lists.ListChooser)17 ObjType (main.entity.type.ObjType)6 ArrayList (java.util.ArrayList)5 EnumMaster (main.system.auxiliary.EnumMaster)3 LINK_VARIANT (eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT)2 File (java.io.File)2 DC_TYPE (main.content.DC_TYPE)2 PROPERTY (main.content.values.properties.PROPERTY)2 Ref (main.entity.Ref)2 ImageChooser (main.swing.generic.components.editors.ImageChooser)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)1 HC_Tab (eidolons.client.cc.gui.neo.tabs.HC_Tab)1 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)1 DC_Cell (eidolons.entity.obj.DC_Cell)1 Unit (eidolons.entity.obj.unit.Unit)1 ArenaBattleMaster (eidolons.game.battlecraft.logic.battle.arena.ArenaBattleMaster)1 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)1 Preset (eidolons.test.Preset)1