use of com.revolsys.swing.undo.UndoManager in project com.revolsys.open by revolsys.
the class FieldSupport method setValue.
public boolean setValue(final Object value) {
final Object oldValue = this.value;
if (DataType.equal(oldValue, value)) {
return false;
} else {
this.value = value;
this.field.firePropertyChange(this.name, oldValue, value);
final UndoManager parent = this.undoManager.getParent();
SetFieldValueUndoableEdit.newUndoableEdit(parent, this.field, oldValue, value);
return true;
}
}
use of com.revolsys.swing.undo.UndoManager in project com.revolsys.open by revolsys.
the class GeometryCoordinatesTableModel method setGeometry.
public void setGeometry(final Geometry geometry) {
final LayerRecordForm form = this.geometryCoordinatesPanel.getForm();
final LayerRecord record = form.getRecord();
final Geometry oldGeometry = record.getGeometry();
if (oldGeometry != geometry) {
final AbstractRecordLayer layer = record.getLayer();
final String geometryFieldName = record.getGeometryFieldName();
final UndoableEdit setGeometryUndo = layer.newSetFieldUndo(record, geometryFieldName, oldGeometry, geometry);
final UndoManager undoManager = form.getUndoManager();
undoManager.addEdit(setGeometryUndo);
}
if (this.geometry != geometry) {
this.geometry = geometry;
if (geometry == null) {
this.geometryFactory = GeometryFactory.DEFAULT_3D;
this.vertexIndexMap = Collections.emptyMap();
this.vertexIndices = Collections.emptyList();
} else {
this.geometryFactory = geometry.getGeometryFactory();
this.vertexIndexMap = getIndexOfVertices(geometry);
this.vertexIndices = new ArrayList<>(this.vertexIndexMap.keySet());
}
this.axisCount = this.geometryFactory.getAxisCount();
this.axisNames = new ArrayList<>();
if (geometry.isGeometryCollection()) {
this.axisNames.add("P");
}
if (geometry instanceof Polygonal) {
this.axisNames.add("R");
}
this.vertexIndexColumn = this.axisNames.size();
this.axisNames.add("#");
this.segmentIndexColumn = this.axisNames.size();
this.axisNames.add("S #");
this.numIndexItems = this.axisNames.size();
this.axisNames.add("X");
this.axisNames.add("Y");
if (this.axisCount > 2) {
this.axisNames.add("Z");
}
if (this.axisCount > 3) {
this.axisNames.add("M");
}
this.columnCount = this.axisNames.size();
fireTableStructureChanged();
}
}
use of com.revolsys.swing.undo.UndoManager in project com.revolsys.open by revolsys.
the class MergeRecordsDialog method showDialog.
public static void showDialog(final AbstractRecordLayer layer) {
final UndoManager undoManager = layer.getMapPanel().getUndoManager();
final MergeRecordsDialog dialog = new MergeRecordsDialog(undoManager, layer);
dialog.showDialog();
}
Aggregations