use of com.revolsys.swing.undo.SetObjectProperty in project com.revolsys.open by revolsys.
the class AbstractOverlay method newPropertyUndo.
protected void newPropertyUndo(final Object object, final String propertyName, final Object oldValue, final Object newValue) {
final SetObjectProperty edit = new SetObjectProperty(object, propertyName, oldValue, newValue);
addUndo(edit);
}
use of com.revolsys.swing.undo.SetObjectProperty in project com.revolsys.open by revolsys.
the class EditGeoreferencedImageOverlay method moveCornerFinish.
private boolean moveCornerFinish(final MouseEvent event) {
if (event.getButton() == MouseEvent.BUTTON1) {
if (clearOverlayAction(ACTION_MOVE_IMAGE_CORNER)) {
try {
if (this.moveImageBoundingBox != null) {
final SetObjectProperty setBBox = new SetObjectProperty(this, "imageBoundingBox", getImageBoundingBox(), this.moveImageBoundingBox);
addUndo(setBBox);
event.consume();
}
} finally {
moveCornerClear();
}
repaint();
return true;
}
}
return false;
}
use of com.revolsys.swing.undo.SetObjectProperty in project com.revolsys.open by revolsys.
the class EditGeoreferencedImageOverlay method moveTiePointFinish.
private boolean moveTiePointFinish(final MouseEvent event) {
if (this.moveTiePointStarted) {
final MappedLocation tiePoint = getMoveTiePoint();
if (tiePoint != null) {
Point point = getPoint(event);
String action;
if (this.moveTiePointSource) {
action = ACTION_TIE_POINT_MOVE_SOURCE;
} else {
action = ACTION_TIE_POINT_MOVE_TARGET;
}
if (clearOverlayAction(action)) {
if (this.moveTiePointSource) {
final Point sourcePixel = this.layer.targetPointToSourcePixel(point);
final SetObjectProperty setSourcePixel = new SetObjectProperty(tiePoint, "sourcePixel", tiePoint.getSourcePixel(), sourcePixel);
addUndo(setSourcePixel);
} else {
final Point snapPoint = getSnapPoint();
if (snapPoint != null) {
point = snapPoint;
}
final GeometryFactory imageGeometryFactory = getImageGeometryFactory();
point = point.newGeometry(imageGeometryFactory);
tiePoint.setTargetPoint(point);
final SetObjectProperty setTargetPoint = new SetObjectProperty(tiePoint, "targetPoint", tiePoint.getTargetPoint(), point);
addUndo(setTargetPoint);
}
this.closeSourcePixelIndexes.clear();
this.closeTargetPointIndexes.clear();
moveTiePointClear();
clearCachedImage();
clearMapCursor();
clearSnapLocations();
if (event != null) {
event.consume();
}
repaint();
return true;
}
}
}
return false;
}
use of com.revolsys.swing.undo.SetObjectProperty in project com.revolsys.open by revolsys.
the class EditGeoreferencedImageOverlay method moveImageFinish.
private boolean moveImageFinish(final MouseEvent event) {
if (event.getButton() == MouseEvent.BUTTON1) {
if (clearOverlayAction(ACTION_MOVE_IMAGE)) {
final BoundingBox boundingBox = getMoveBoundingBox(event);
final SetObjectProperty setBBox = new SetObjectProperty(this, "imageBoundingBox", getImageBoundingBox(), boundingBox);
addUndo(setBBox);
moveImageClear();
event.consume();
repaint();
return true;
}
}
return false;
}
Aggregations