Java Code Examples for com.jme3.export.InputCapsule#readStringArray()

The following examples show how to use com.jme3.export.InputCapsule#readStringArray() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DacConfiguration.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * De-serialize this control, for example when loading from a J3O file.
 *
 * @param im importer (not null)
 * @throws IOException from importer
 */
@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);

    damping = ic.readFloat("damping", 0.6f);
    eventDispatchImpulseThreshold
            = ic.readFloat("eventDispatchImpulseThreshold", 0f);

    jointMap.clear();
    blConfigMap.clear();
    String[] linkedBoneNames = ic.readStringArray("linkedBoneNames", null);
    Savable[] linkedBoneJoints
            = ic.readSavableArray("linkedBoneJoints", null);
    float[] blConfigs = ic.readFloatArray("blConfigs", null);
    for (int i = 0; i < linkedBoneNames.length; ++i) {
        String boneName = linkedBoneNames[i];
        RangeOfMotion rom = (RangeOfMotion) linkedBoneJoints[i];
        jointMap.put(boneName, rom);
        blConfigMap.put(boneName, blConfigs[i]);
    }

    torsoMass = ic.readFloat("torsoMass", 1f);
    gravityVector = (Vector3f) ic.readSavable("gravity", null);
}
 
Example 2
Source File: ShaderNodeDefinition.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * jme serialization (not used)
 *
 * @param im the importer
 * @throws IOException
 */
@Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);
    name = ic.readString("name", "");

    String[] str = ic.readStringArray("shadersLanguage", null);
    if (str != null) {
        shadersLanguage = Arrays.asList(str);
    } else {
        shadersLanguage = new ArrayList<String>();
    }

    str = ic.readStringArray("shadersPath", null);
    if (str != null) {
        shadersPath = Arrays.asList(str);
    } else {
        shadersPath = new ArrayList<String>();
    }

    type = ic.readEnum("type", Shader.ShaderType.class, null);
    inputs = ic.readSavableArrayList("inputs", new ArrayList<>());
    outputs = ic.readSavableArrayList("outputs", new ArrayList<>());
}
 
Example 3
Source File: DefineList.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void read(JmeImporter im) throws IOException{
    InputCapsule ic = im.getCapsule(this);

    String[] keys = ic.readStringArray("keys", null);
    String[] vals = ic.readStringArray("vals", null);
    for (int i = 0; i < keys.length; i++){
        defines.put(keys[i], vals[i]);
    }

    compiled = ic.readString("compiled", null);
}