private static Element createValueElement(Document document, String name,
			ConfigurableEmitter.Value value) {
		Element element = document.createElement(name);

		// void: now writes the value type
		if (value instanceof SimpleValue) {
			element.setAttribute("type", "simple");
			element.setAttribute("value", "" + value.getValue(0));
		} else if (value instanceof RandomValue) {
			element.setAttribute("type", "random");
			element
					.setAttribute("value", ""
							+ ((RandomValue) value).getValue());
		} else if (value instanceof LinearInterpolator) {
			element.setAttribute("type", "linear");
			element.setAttribute("min", ""
					+ ((LinearInterpolator) value).getMin());
			element.setAttribute("max", ""
					+ ((LinearInterpolator) value).getMax());
			element.setAttribute("active", ""
					+ ((LinearInterpolator) value).isActive());

			ArrayList curve = ((LinearInterpolator) value).getCurve();
			for (int i = 0; i < curve.size(); i++) {
				Vector2f point = (Vector2f) curve.get(i);

				Element pointElement = document.createElement("point");
				pointElement.setAttribute("x", "" + point.x);
				pointElement.setAttribute("y", "" + point.y);

				element.appendChild(pointElement);
			}
		} else {
			Log.warn("unkown value type ignored: " + value.getClass());
		}

		return element;
	}
private static Element createValueElement ( Document document , String name , ConfigurableEmitter . Value value ) { Element element = document . createElement ( name ) ; if ( value instanceof SimpleValue ) { element . setAttribute ( "type" , "simple" ) ; element . setAttribute ( "value" , "" + value . getValue ( 0 ) ) ; } else if ( value instanceof RandomValue ) { element . setAttribute ( "type" , "random" ) ; element . setAttribute ( "value" , "" + ( ( RandomValue ) value ) . getValue ( ) ) ; } else if ( value instanceof LinearInterpolator ) { element . setAttribute ( "type" , "linear" ) ; element . setAttribute ( "min" , "" + ( ( LinearInterpolator ) value ) . getMin ( ) ) ; element . setAttribute ( "max" , "" + ( ( LinearInterpolator ) value ) . getMax ( ) ) ; element . setAttribute ( "active" , "" + ( ( LinearInterpolator ) value ) . isActive ( ) ) ; ArrayList curve = ( ( LinearInterpolator ) value ) . getCurve ( ) ; for ( int i = 0 ; i < curve . size ( ) ; i ++ ) { Vector2f point = ( Vector2f ) curve . get ( i ) ; Element pointElement = document . createElement ( "point" ) ; pointElement . setAttribute ( "x" , "" + point . x ) ; pointElement . setAttribute ( "y" , "" + point . y ) ; element . appendChild ( pointElement ) ; } } else { Log . warn ( "unkown value type ignored: " + value . getClass ( ) ) ; } return element ; }
Create an XML element based on a configured value

@param document
The document the element will be part of
@param name
The name to give the new element
@param value
The configured value
@return A configure XML element based on the value