org.rabbitcontrol.rcp.model.parameter.Vector3Float32Parameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rcp Show documentation
Show all versions of rcp Show documentation
RabbitControl is a binary data-format definition to describe data values and ui-elements.
The newest version!
package org.rabbitcontrol.rcp.model.parameter;
import org.rabbitcontrol.rcp.model.RcpTypes.Datatype;
import org.rabbitcontrol.rcp.model.types.Vector3;
public class Vector3Float32Parameter extends NumberParameter>{
public Vector3Float32Parameter(final short _id) {
super(_id, Datatype.VECTOR3F32);
}
@Override
public void setStringValue(final String _value) {
final String[] values = _value.split(",");
if (values.length < 3) {
return;
}
try {
final Float x = Float.parseFloat(values[0]);
final Float y = Float.parseFloat(values[1]);
final Float z = Float.parseFloat(values[2]);
setValue(new Vector3(x, y, z));
}
catch (final NumberFormatException _e) {
System.err.println("could not parse string to vector");
}
}
}