use of main.swing.generic.components.editors.ImageChooser in project Eidolons by IDemiurge.
the class HT_View method editImage.
private void editImage(ObjType type) {
String value = new ImageChooser().launch(type.getImagePath(), "");
if (value != null) {
type.setProperty(G_PROPS.IMAGE, value);
rebuildAndSetTree();
}
}
use of main.swing.generic.components.editors.ImageChooser 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 ()
}
use of main.swing.generic.components.editors.ImageChooser in project Eidolons by IDemiurge.
the class EmitterController method create.
public void create() {
String presetPath = new FileChooser(PathFinder.getSfxPath()).launch("", "");
if (presetPath == null) {
return;
}
ImageChooser ic = new ImageChooser();
ic.setDefaultFileLocation(PathFinder.getSfxPath() + "images//");
String imagePath = ic.launch("", "");
add(presetPath, imagePath);
}
Aggregations