com.esri.adf.web.ags.data.edit.action
Class SplitPolygonFeature

java.lang.Object
  extended by com.esri.adf.web.ags.data.edit.EditAction
      extended by com.esri.adf.web.ags.data.edit.action.SplitPolygonFeature
All Implemented Interfaces:
Serializable

public class SplitPolygonFeature
extends EditAction

Splits a selected polygon feature to new features.

 SelectByExtent select = new SelectByExtent(EditUtil.toEnvelope(-2309712.539, -887434.291, -1023725.086, 411499.344, map
     .getSpatialReference(), ctx));
 select.setMaxCount(1);
 
 workspace.perform(context, select);
 
 IFeatureCursor cur = EditUtil.getSelection(context.getLayer(), context.getLayerDescription(), ctx);
 
 IFeature feature = cur.nextFeature();
 IGeometry geom = feature.getShape();
 
 IPointCollection pointColl = new IPointCollectionProxy(geom);
 IPoint p1 = pointColl.getPoint(0);
 IPoint p3 = pointColl.getPoint(3);
 
 WebPolyline wp = new WebPolyline();
 WebPath path = new WebPath();
 wp.addPath(path);
 path.addPoint(new WebPoint(p1.getX(), p1.getY()));
 path.addPoint(new WebPoint(p3.getX(), p3.getY()));
 
 IGeometry line = EditWebUtil.toIGeometry(wp, ctx);
 line.setSpatialReferenceByRef(p1.getSpatialReference());
 
 SplitPolygonFeature splitPolygon = new SplitPolygonFeature((IPolyline) line);
 
 workspace.perform(context, splitPolygon);
 
The feature may fire the following events:
  • FeatureRemovedEvent
  • FeatureCreatedEvent
  • FeatureUnselectedEvent
  • See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class com.esri.adf.web.ags.data.edit.EditAction
    eventListeners
     
    Constructor Summary
    SplitPolygonFeature(com.esri.arcgis.geometry.IPolyline line)
              Instantiates an object of SplitPolygonFeature.
     
    Method Summary
     void action(ActionContext context)
              Performs the action.
     com.esri.arcgis.geometry.IPolyline getPolyline()
              Gets the split line.
     void setPolyline(com.esri.arcgis.geometry.IPolyline line)
              Sets the split line.
     
    Methods inherited from class com.esri.adf.web.ags.data.edit.EditAction
    addEventListener, fireEvent, isEnabled, isSessionAware, removeEventListener, setEnabled, setSessionAware
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    SplitPolygonFeature

    public SplitPolygonFeature(com.esri.arcgis.geometry.IPolyline line)
    Instantiates an object of SplitPolygonFeature.

    Parameters:
    line - split the polygon with the line.
    Method Detail

    getPolyline

    public com.esri.arcgis.geometry.IPolyline getPolyline()
    Gets the split line.

    Returns:
    Returns the line.

    setPolyline

    public void setPolyline(com.esri.arcgis.geometry.IPolyline line)
    Sets the split line.

    Parameters:
    line - The line to set.

    action

    public void action(ActionContext context)
                throws Exception
    Description copied from class: EditAction
    Performs the action.

    Specified by:
    action in class EditAction
    Parameters:
    context - the action context.
    Throws:
    Exception