Hello,I used the sample code for selected graph
ArrayList idList = new ArrayList();
public void featureHit(com.esri.toolkit.overlays.HitTestEvent event) {
// get hit graphics
List<Feature> hitGraphics = event.getOverlay().getHitFeatures();
myGraphicsLayer = (GraphicsLayer) event.getOverlay().getLayer();
for (Feature graphic : hitGraphics) {
id = (int) graphic.getId();
if (myGraphicsLayer.isGraphicSelected(id)) {
// if graphic is selected in the layer, unselect it
myGraphicsLayer.unselect(id);
} else {
// otherwise select graphic in the layer
myGraphicsLayer.select(id);
idList.add(id);
}
}
}
So, I'm recording all the ID's for the graph in arraylist and I've action button connected Action Listener which perform this code
for(int i=0;i<=idList.size();i++)
{
if (myGraphicsLayer.isGraphicSelected(id))
{
System.out.print(id);
myGraphicsLayer.unselect(id);
}
}
The problem is, it's only unselected the last ID graph, the others unaffected. So what do you suggest? I'm using 10.2.3