public void setPropertyValue( Object id, Object value ) {
try {
if (id instanceof Integer) {
int i = ((Integer) id).intValue();
Object attr = feature.getAttribute(i);
EditCommand command = (EditCommand) EditCommandFactory.getInstance().createSetAttributeCommand(
attrs.get(i).getName().getLocalPart(), value);
map.sendCommandASync(command);
if (attr instanceof String) {
feature.setAttribute(i, value);
} else if (attr instanceof Integer) {
feature.setAttribute(i, Integer.valueOf((String) value));
} else if (attr instanceof Double) {
feature.setAttribute(i, Double.valueOf((String) value));
} else if (attr instanceof Float) {
feature.setAttribute(i, Float.valueOf((String) value));
} else if (attr instanceof Boolean) {
feature.setAttribute(i, Boolean.valueOf(((Integer) value).intValue() == 0
? true
: false));
}
}
if (value instanceof Geometry) {
if (id.equals(DEFAULT_GEOM)){
feature.setDefaultGeometry((Geometry) value);
EditCommand command = (EditCommand) EditCommandFactory.getInstance().createSetGeometryCommand((Geometry) value);
map.sendCommandASync(command);
}
}
} catch (Exception e) {
e.printStackTrace();