Search in sources :

Example 6 with ImageChooser

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();
    }
}
Also used : ImageChooser(main.swing.generic.components.editors.ImageChooser)

Example 7 with ImageChooser

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 ()
}
Also used : TextEditor(main.swing.generic.components.editors.TextEditor) ImageChooser(main.swing.generic.components.editors.ImageChooser) PROPERTY(main.content.values.properties.PROPERTY) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 8 with ImageChooser

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);
}
Also used : ImageChooser(main.swing.generic.components.editors.ImageChooser) FileChooser(main.swing.generic.components.editors.FileChooser)

Aggregations

ImageChooser (main.swing.generic.components.editors.ImageChooser)8 ListChooser (main.swing.generic.components.editors.lists.ListChooser)2 C_OBJ_TYPE (main.content.C_OBJ_TYPE)1 OBJ_TYPE (main.content.OBJ_TYPE)1 PROPERTY (main.content.values.properties.PROPERTY)1 ObjType (main.entity.type.ObjType)1 FileChooser (main.swing.generic.components.editors.FileChooser)1 TextEditor (main.swing.generic.components.editors.TextEditor)1