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

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

public class SplitLineFeature
extends EditAction

Splits a selected line feature to two 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 p2 = pointColl.getPoint(1);
 
 SplitLineFeature splitLine = new SplitLineFeature(p2);
 
 workspace.perform(context, splitLine);
 
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
    SplitLineFeature(com.esri.arcgis.geometry.IPoint point)
              Instantiates an object of SplitLineFeature.
     
    Method Summary
     void action(ActionContext context)
              Performs the action.
     com.esri.arcgis.geometry.IPoint getPoint()
              Gets the point to split at.
     int getSearchTolerance()
              Gets the search tolerance in pixels.
     void setPoint(com.esri.arcgis.geometry.IPoint point)
              Sets the point to split at.
     void setSearchTolerance(int searchTolerance)
              Sets the search tolerance in pixels.
     
    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

    SplitLineFeature

    public SplitLineFeature(com.esri.arcgis.geometry.IPoint point)
    Instantiates an object of SplitLineFeature.

    Parameters:
    point - the split point.
    Method Detail

    getPoint

    public com.esri.arcgis.geometry.IPoint getPoint()
    Gets the point to split at.

    Returns:
    Returns the point.

    setPoint

    public void setPoint(com.esri.arcgis.geometry.IPoint point)
    Sets the point to split at.

    Parameters:
    point - The point to set.

    getSearchTolerance

    public int getSearchTolerance()
    Gets the search tolerance in pixels.

    Returns:
    Returns the search tolerance.

    setSearchTolerance

    public void setSearchTolerance(int searchTolerance)
    Sets the search tolerance in pixels.

    Parameters:
    searchTolerance - The search tolerance 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