public class EditTransaction extends Object
Also:
| Modifier and Type | Class and Description |
|---|---|
static interface |
EditTransaction.SelectionEditor |
static interface |
EditTransaction.SuccessAction |
| Modifier and Type | Field and Description |
|---|---|
static String |
ROLLING_BACK_INVALID_EDITS_KEY |
| Constructor and Description |
|---|
EditTransaction(Collection features,
String name,
Layer layer,
boolean rollingBackInvalidEdits,
boolean allowAddingAndRemovingFeatures,
LayerViewPanel layerViewPanel) |
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
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearEnvelopeCaches() |
boolean |
commit() |
static boolean |
commit(Collection editTransactions) |
static boolean |
commit(Collection editTransactions,
EditTransaction.SuccessAction successAction)
Commits several EditTransactions if their proposed geometries are all valid.
|
boolean |
commit(EditTransaction.SuccessAction successAction) |
void |
createFeature(Feature feature) |
static EditTransaction |
createTransactionOnSelection(EditTransaction.SelectionEditor editor,
SelectionManagerProxy selectionManagerProxy,
LayerViewPanelContext layerViewPanelContext,
String name,
Layer layer,
boolean rollingBackInvalidEdits,
boolean allowAddingAndRemovingFeatures) |
void |
deleteFeature(Feature feature) |
static int |
emptyGeometryCount(Collection transactions) |
static Map |
featureToNewGeometryMap(EditTransaction.SelectionEditor editor,
SelectionManagerProxy selectionManagerProxy,
Layer layer) |
Feature |
getFeature(int i) |
com.vividsolutions.jts.geom.Geometry |
getGeometry(Feature feature) |
com.vividsolutions.jts.geom.Geometry |
getGeometry(int i) |
Layer |
getLayer() |
boolean |
proposedGeometriesValid() |
void |
setGeometries(Map featureToGeometryMap) |
void |
setGeometry(Feature feature,
com.vividsolutions.jts.geom.Geometry geometry) |
void |
setGeometry(int i,
com.vividsolutions.jts.geom.Geometry geometry) |
int |
size() |
public static final String ROLLING_BACK_INVALID_EDITS_KEY
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)
name - Display name for undo. Use PlugIn#getName or CursorTool#getName.layer - the layer to which the features belongallowAddingAndRemovingFeatures - whether to treat empty
geometries as indications to add/remove features or as in fact empty geometriespublic static EditTransaction createTransactionOnSelection(EditTransaction.SelectionEditor editor, SelectionManagerProxy selectionManagerProxy, LayerViewPanelContext layerViewPanelContext, String name, Layer layer, boolean rollingBackInvalidEdits, boolean allowAddingAndRemovingFeatures)
public static Map featureToNewGeometryMap(EditTransaction.SelectionEditor editor, SelectionManagerProxy selectionManagerProxy, Layer layer)
public com.vividsolutions.jts.geom.Geometry getGeometry(int i)
public com.vividsolutions.jts.geom.Geometry getGeometry(Feature feature)
public void setGeometry(Feature feature, com.vividsolutions.jts.geom.Geometry geometry)
public void setGeometries(Map featureToGeometryMap)
public void setGeometry(int i,
com.vividsolutions.jts.geom.Geometry geometry)
public boolean commit()
public static boolean commit(Collection editTransactions)
public static boolean commit(Collection editTransactions, EditTransaction.SuccessAction successAction)
successAction - run after the first execution (i.e. not after redos) if all
proposed geometries are valid (or rollingBackInvalidEdits is false)public boolean commit(EditTransaction.SuccessAction successAction)
successAction - will be run if the geometries are valid (or
OptionsPlugIn#isRollingBackInvalidEdits returns false), before the layer-change
events are fired. Useful for animations and other visual indicators which would
be slowed down if the layer-change events were fired first.public void clearEnvelopeCaches()
public boolean proposedGeometriesValid()
public int size()
public Feature getFeature(int i)
public void createFeature(Feature feature)
public void deleteFeature(Feature feature)
feature - must not have been passed into the constructorpublic Layer getLayer()
public static int emptyGeometryCount(Collection transactions)
Copyright © 2015. All rights reserved.