private RemoteYoGraphic getRemoteGraphic(DynamicGraphicMessage msg) { RemoteGraphicType type = RemoteGraphicType.values()[msg.getType()]; String name = msg.getName(); YoVariable<?>[] vars = new YoVariable[msg.getYoIndexCount()]; for (int v = 0; v < vars.length; v++) vars[v] = variables.get(msg.getYoIndex(v)); Double[] consts = msg.getConstantList().toArray(new Double[msg.getConstantCount()]); AppearanceDefinition appearance = new YoAppearanceRGBColor(Color.red, 0.0); if (msg.hasAppearance()) { appearance = new YoAppearanceRGBColor(new Color3f((float) msg.getAppearance().getX(), (float) msg.getAppearance().getY(), (float) msg.getAppearance() .getZ()), msg.getAppearance().getTransparency()); } return YoGraphicFactory.yoGraphicFromMessage(type, name, vars, consts, appearance); }