com.esri.arcgis.carto
Interface IFeatureSelection

All Superinterfaces:
Serializable
All Known Implementing Classes:
CadAnnotationLayer, CadastralFabricSubLayer, CadFeatureLayer, CoverageAnnotationLayer, DimensionLayer, FDOGraphicsLayer, FeatureLayer, GdbRasterCatalogLayer, IFeatureSelectionProxy, ImageServerLayer, IMSSubFeatureLayer, TemporalFeatureLayer

public interface IFeatureSelection
extends Serializable

Provides access to members that control feature selection.

Remarks

IFeatureSelection is a very useful interface to manage or perform selection on a layer or to modify the way the selection is displayed.

The following methods and properties are useful to manage the selection:

The CombinationMethod property is not used.
SelectionSet returns a SelectionSet corresponding to the current selection on the layer.
Clear will clear an existing selection.
Add adds one single feature to the selection.
SelectFeatures will perform a selection based on a query filter. If nothing is used as a query filter all the features will be selected. You can also specify a combination method. The justOne parameter tells the search to stop once it has found one feature.
Call SelectionChanged after modifying SelectionSet to fire update events on the layer.

The following methods and properties are useful to modify the way the selection is displayed:

SelectionSymbol will return or set the symbol used to display selected features on the layer.
SetSelectionSymbol is a boolean used to indicate if the SelectionSymbol is used or not to draw the selection. For feature layers, this is similar to using the "Show selected features...with this symbol" option in the layer properties.
SelectionColor is equivalent to using the "Show selected features...with this color" option in the layer properties.
If BufferDistance is set to a value greater than 0, a buffer will be drawn around the selected features. This is similar to using the Buffer Selection tool that can be added to the map with the Customize command found in the Tools menu.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void add(IFeature feature)
          Adds a feature to the selection set.
 void clear()
          Clears the selection.
 double getBufferDistance()
          Buffer distance used for the selection.
 int getCombinationMethod()
          Combination method for the selection.
 IColor getSelectionColor()
          Selection color.
 ISelectionSet getSelectionSet()
          The selected set of features.
 ISymbol getSelectionSymbol()
          Selection symbol.
 boolean isSetSelectionSymbol()
          Indicates if the selected set of features is drawn using the SelectionSymbol.
 void selectFeatures(IQueryFilter filter, int method, boolean justOne)
          Selects features based upon the specifed criteria and combination method.
 void selectionChanged()
          Fires the features layer update event.
 void setBufferDistance(double distance)
          Buffer distance used for the selection.
 void setCombinationMethod(int method)
          Combination method for the selection.
 void setSelectionColorByRef(IColor color)
          Selection color.
 void setSelectionSetByRef(ISelectionSet selectionSet)
          The selected set of features.
 void setSelectionSymbolByRef(ISymbol symbol)
          Selection symbol.
 void setSetSelectionSymbol(boolean setSymbol)
          Indicates if the selected set of features is drawn using the SelectionSymbol.
 

Method Detail

getSelectionSet

ISelectionSet getSelectionSet()
                              throws IOException,
                                     AutomationException
The selected set of features.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.ISelectionSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSelectionSetByRef

void setSelectionSetByRef(ISelectionSet selectionSet)
                          throws IOException,
                                 AutomationException
The selected set of features.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
selectionSet - A reference to a com.esri.arcgis.geodatabase.ISelectionSet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCombinationMethod

int getCombinationMethod()
                         throws IOException,
                                AutomationException
Combination method for the selection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.carto.esriSelectionResultEnum constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCombinationMethod

void setCombinationMethod(int method)
                          throws IOException,
                                 AutomationException
Combination method for the selection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
method - A com.esri.arcgis.carto.esriSelectionResultEnum constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBufferDistance

double getBufferDistance()
                         throws IOException,
                                AutomationException
Buffer distance used for the selection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The distance
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBufferDistance

void setBufferDistance(double distance)
                       throws IOException,
                              AutomationException
Buffer distance used for the selection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
distance - The distance (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isSetSelectionSymbol

boolean isSetSelectionSymbol()
                             throws IOException,
                                    AutomationException
Indicates if the selected set of features is drawn using the SelectionSymbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The setSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSetSelectionSymbol

void setSetSelectionSymbol(boolean setSymbol)
                           throws IOException,
                                  AutomationException
Indicates if the selected set of features is drawn using the SelectionSymbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
setSymbol - The setSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSelectionColor

IColor getSelectionColor()
                         throws IOException,
                                AutomationException
Selection color. (used when SetSelectionSymbol = FALSE).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.display.IColor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSelectionColorByRef

void setSelectionColorByRef(IColor color)
                            throws IOException,
                                   AutomationException
Selection color. (used when SetSelectionSymbol = FALSE).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
color - A reference to a com.esri.arcgis.display.IColor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSelectionSymbol

ISymbol getSelectionSymbol()
                           throws IOException,
                                  AutomationException
Selection symbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.display.ISymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSelectionSymbolByRef

void setSelectionSymbolByRef(ISymbol symbol)
                             throws IOException,
                                    AutomationException
Selection symbol.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
symbol - A reference to a com.esri.arcgis.display.ISymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

add

void add(IFeature feature)
         throws IOException,
                AutomationException
Adds a feature to the selection set.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
feature - A reference to a com.esri.arcgis.geodatabase.IFeature (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

selectFeatures

void selectFeatures(IQueryFilter filter,
                    int method,
                    boolean justOne)
                    throws IOException,
                           AutomationException
Selects features based upon the specifed criteria and combination method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
method - A com.esri.arcgis.carto.esriSelectionResultEnum constant (in)
justOne - The justOne (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clear

void clear()
           throws IOException,
                  AutomationException
Clears the selection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

selectionChanged

void selectionChanged()
                      throws IOException,
                             AutomationException
Fires the features layer update event. Required when SelectionSet changes.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.