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();
}
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);
}
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;
}
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);
}
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
}
Aggregations