| java.lang.Object com.vividsolutions.jump.workbench.ui.EditTransaction
EditTransaction | public class EditTransaction (Code) | | Takes care of "rollback" (if any geometries are invalid) and undo,
for PlugIns and CursorTools that modify geometries.
Also:
- warns the user if invalid geometries are found
- invalidates the layer envelope cache
- invalidates the geometry envelope caches
- (undoably) removes features from the layer when their geometries are made empty
- (undoably) adds features to the layer when they start with empty geometries
|
Inner Class :public static interface SelectionEditor | |
Inner Class :public static interface SuccessAction | |
Constructor Summary | |
public | EditTransaction(Collection features, String name, Layer layer, boolean rollingBackInvalidEdits, boolean allowAddingAndRemovingFeatures, LayerViewPanel layerViewPanel) | public | EditTransaction(Collection features, String name, Layer layer, boolean rollingBackInvalidEdits, boolean allowAddingAndRemovingFeatures, LayerViewPanelContext layerViewPanelContext) If you want to delete a feature, you can either (1) include the feature in
the features parameter, set allowAddingAndRemovingFeatures to true,
then call #setGeometry(feature, empty geometry); or (2) not include the feature in
the features parameter, instead using #deleteFeature
Parameters: name - Display name for undo. |
Method Summary | |
public void | clearEnvelopeCaches() | public boolean | commit() | public static boolean | commit(Collection editTransactions) | public static boolean | commit(Collection editTransactions, SuccessAction successAction) Commits several EditTransactions if their proposed geometries are all valid.
Useful for committing changes to several layers because an EditTransaction
handles one layer only. | public boolean | commit(SuccessAction successAction) Parameters: successAction - will be run if the geometries are valid (orOptionsPlugIn#isRollingBackInvalidEdits returns false), before the layer-changeevents are fired. | protected UndoableCommand | createCommand() | public void | createFeature(Feature feature) | public static EditTransaction | createTransactionOnSelection(SelectionEditor editor, SelectionManagerProxy selectionManagerProxy, LayerViewPanelContext layerViewPanelContext, String name, Layer layer, boolean rollingBackInvalidEdits, boolean allowAddingAndRemovingFeatures) | public void | deleteFeature(Feature feature) | public static int | emptyGeometryCount(Collection transactions) | public static Map | featureToNewGeometryMap(SelectionEditor editor, SelectionManagerProxy selectionManagerProxy, Layer layer) | public Feature | getFeature(int i) | public Geometry | getGeometry(int i) | public Geometry | getGeometry(Feature feature) | public Layer | getLayer() | public boolean | proposedGeometriesValid() | public void | setGeometries(Map featureToGeometryMap) | public void | setGeometry(Feature feature, Geometry geometry) | public void | setGeometry(int i, Geometry geometry) | public int | size() |
ROLLING_BACK_INVALID_EDITS_KEY | final public static String ROLLING_BACK_INVALID_EDITS_KEY(Code) | | |
EditTransaction | public EditTransaction(Collection features, String name, Layer layer, boolean rollingBackInvalidEdits, boolean allowAddingAndRemovingFeatures, LayerViewPanelContext layerViewPanelContext)(Code) | | If you want to delete a feature, you can either (1) include the feature in
the features parameter, set allowAddingAndRemovingFeatures to true,
then call #setGeometry(feature, empty geometry); or (2) not include the feature in
the features parameter, instead using #deleteFeature
Parameters: name - Display name for undo. Use PlugIn#getName or CursorTool#getName. Parameters: layer - the layer to which the features belong Parameters: allowAddingAndRemovingFeatures - whether to treat emptygeometries as indications to add/remove features or as in fact empty geometries |
clearEnvelopeCaches | public void clearEnvelopeCaches()(Code) | | |
commit | public boolean commit()(Code) | | |
commit | public static boolean commit(Collection editTransactions, SuccessAction successAction)(Code) | | Commits several EditTransactions if their proposed geometries are all valid.
Useful for committing changes to several layers because an EditTransaction
handles one layer only. Gets the undo name and the UndoManager
from the first EditTransaction.
Parameters: successAction - run after the first execution (i.e. not after redos) if allproposed geometries are valid (or rollingBackInvalidEdits is false) |
commit | public boolean commit(SuccessAction successAction)(Code) | | Parameters: successAction - will be run if the geometries are valid (orOptionsPlugIn#isRollingBackInvalidEdits returns false), before the layer-changeevents are fired. Useful for animations and other visual indicators which wouldbe slowed down if the layer-change events were fired first. true if all the proposed geometries are valid |
deleteFeature | public void deleteFeature(Feature feature)(Code) | | Parameters: feature - must not have been passed into the constructor |
emptyGeometryCount | public static int emptyGeometryCount(Collection transactions)(Code) | | |
getGeometry | public Geometry getGeometry(int i)(Code) | | |
proposedGeometriesValid | public boolean proposedGeometriesValid()(Code) | | |
setGeometries | public void setGeometries(Map featureToGeometryMap)(Code) | | |
setGeometry | public void setGeometry(Feature feature, Geometry geometry)(Code) | | |
setGeometry | public void setGeometry(int i, Geometry geometry)(Code) | | |
|
|