private void setPixelPosAttribute(PixelPos pixelPos, boolean updateGeoPos, boolean updateDefaultGeometry) {
final Coordinate newCoordinate = toCoordinate(pixelPos);
final Coordinate oldCoordinate = getPixelPosAttribute();
if (!ObjectUtils.equalObjects(oldCoordinate, newCoordinate)) {
if (oldCoordinate == null) {
final GeometryFactory geometryFactory = new GeometryFactory();
setAttributeValue(PROPERTY_NAME_PIXELPOS, geometryFactory.createPoint(newCoordinate));
} else {
final Point point = (Point) getAttributeValue(PROPERTY_NAME_PIXELPOS);
point.getCoordinate().setCoordinate(newCoordinate);
point.geometryChanged();
}
if (updateDefaultGeometry) {
updateDefaultGeometryAttribute(pixelPos);
}
if (updateGeoPos && getProduct() != null) {
final GeoPos geoPos = getGeoPos();
descriptor.updateGeoPos(getProduct().getGeoCoding(), pixelPos, geoPos);
setGeoPosAttribute(geoPos, false);
}
fireProductNodeChanged(PROPERTY_NAME_PIXELPOS);
}
}