use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.
the class TestDungeonInitializer method chooseDungeonLevel.
public String chooseDungeonLevel() {
String path = PathFinder.getDungeonLevelFolder();
String subFolder = ListChooser.chooseEnum(DUNGEON_SUBFOLDER.class, SELECTION_MODE.SINGLE);
// DialogMaster.inputText("generic folder (empty for root", "");
if (!StringMaster.isEmpty(subFolder)) {
path += subFolder.replace(";", "") + "\\";
}
File folder = FileManager.getFile(path);
List<String> files = FileManager.getFileNames(FileManager.findFiles(folder, ".xml", false, false));
ListChooser listChooser = new ListChooser(SELECTION_MODE.SINGLE, files, false);
listChooser.setMaxColumnNumber(4);
listChooser.setMaxRowCount(40);
String level = listChooser.choose();
if (level == null) {
return null;
}
if (subFolder == null) {
return level;
}
return subFolder.replace(";", "") + "\\" + level;
}
use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.
the class HT_View method selectAltLink.
private String selectAltLink(String name, String prevData) {
LINK_VARIANT variant;
variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
if (variant == null) {
if (prevData != null) {
} else {
return null;
}
}
String offsetX = "" + DialogMaster.inputInt("offset x", 0);
String offsetY = "" + DialogMaster.inputInt("offset y", 0);
String offsets = offsetX + "," + offsetY;
String suffix = (variant + "");
suffix += "=" + offsets;
String value = name + StringMaster.wrapInParenthesis(suffix);
return value;
}
use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.
the class HT_View method selectAltBase.
private String selectAltBase(ObjType type) {
List<ObjType> types = new ArrayList<>(tree.getTypes());
for (ObjType t : tree.getTypes()) {
if (t.getIntParam(PARAMS.CIRCLE) >= type.getIntParam(PARAMS.CIRCLE)) {
types.remove(t);
}
}
types.remove(type);
String name = new ListChooser(SELECTION_MODE.SINGLE, DataManager.toStringList(types), isSkill() ? DC_TYPE.SKILLS : DC_TYPE.CLASSES).choose();
return name;
}
use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.
the class TreeControlPanel method handleControl.
public void handleControl(TREE_CONTROLS c, boolean alt) {
ObjType selectedType = view.getTree().getSelectedType();
switch(c) {
case TEST:
AutoTestMaster.testType(selectedType);
break;
case WS_CYCLE:
workspaceCycle(alt);
break;
case WS_TOGGLE:
if (alt) {
if (view instanceof SkillTreeView) {
SkillTreeView skillTreeView = (SkillTreeView) view;
String enums = new ListChooser(SELECTION_MODE.MULTIPLE, MASTERY.class).choose();
if (StringMaster.isEmpty(enums)) {
return;
}
List<MASTERY> list = new EnumMaster<MASTERY>().getEnumList(MASTERY.class, enums);
skillTreeView.setWorkspace(list.toArray(new MASTERY[list.size()]));
view.setWorkspaceMode(true);
view.refresh();
return;
}
}
view.setWorkspaceMode(!view.isWorkspaceMode());
view.refresh();
break;
case LINK:
view.adjustLink(null, HC_Master.getSelectedTreeNode());
break;
// break;
case OFFSET_X:
view.adjustOffset(alt, true, HC_Master.getSelectedTreeNode());
break;
case OFFSET_Y:
view.adjustOffset(alt, false, HC_Master.getSelectedTreeNode());
break;
case REBUILD:
view.rebuildAndSetTree();
break;
case ALT_BASE:
if (alt) {
view.editAltBaseLink(selectedType);
break;
}
view.addAltBase(selectedType);
break;
case SET:
setProp(alt, selectedType);
view.rebuildAndSetTree();
break;
default:
break;
}
}
use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.
the class TreeControlPanel method setProperty.
// private static void setProp(boolean alt, ObjType selectedType) {
//
// }
private static boolean setProperty(boolean alt, ObjType selectedType) {
String name;
String containerString = "Lore;Description;Flavor;Image;Actives;Passives;Attribute Bonuses;Parameter Bonuses;";
// TODO v-flow buttons one-click!
List<String> listData = StringMaster.openContainer(containerString);
name = new ListChooser(SELECTION_MODE.SINGLE, listData, true).choose();
if (name == null) {
return false;
}
// name = new ButtonChoicePanel(SELECTION_MODE.SINGLE,
// listData).choose();
PROPERTY prop = ContentManager.getPROP(name);
String value = null;
if (alt) {
value = new TextEditor().launch(selectedType.getProperty(prop));
} else if (DC_ContentManager.getEditorMap() != null) {
if (DC_ContentManager.getEditorMap().get(name) != null) {
value = DC_ContentManager.getEditorMap().get(name).launch(value, name);
}
} else if (prop == G_PROPS.IMAGE) {
value = new ImageChooser().launch(selectedType.getImagePath(), "");
// tableMouse.getEditor(prop)
} else {
value = new TextEditor().launch(selectedType.getProperty(prop));
}
if (value != null) {
selectedType.setProperty(prop, value);
}
return true;
// TableMouseListener
// if ()
}
Aggregations