11-19-2015 04:15 AM
Hi Team,
I am able to get GPrimitive for single selected item most of the time but yes some it is also null. When i pass list of selected item like "AA,GN,BI,YR" i get GPrimitive very rare.
I am passing selectedElement ="AA,BI,YR,GN"
Code snippet:
public Object setFilter(String sourceFeature, String featureToFilter, String selectedElement)
{
return swingInvoke(() -> {
Feature toActivate = ApplicationContext.getProject().getFeatureByTitleOrID(sourceFeature);
if(toActivate == null)
Deferred.reject("feature not found");
toActivate.setActive(true);
ApplicationContext.getBrowser().getMapSelectionCurator().clearSelection();
ApplicationContext.getBrowser().getMapSelectionCurator().select(new Object[]{selectedElement});
String[] selectedIds = selectedElement.split(",");
GPrimitive[] selectedItems = new GPrimitive[selectedIds.length];
int count =0;
for(int i=0;i<selectedIds.length;i++)
{
GPrimitive item =ApplicationContext.getBrowser().getElement(selectedIds[i]);
if(item != null)
{
selectedItems[i] = item;
count++;
}
}.....
.....}
I am also not able to locate java API link in http://community.hexagongeospatial which was on "http://smartclient.intergraph.at/".
Thanks,
Jai Ram Gaur
Solved! Go to Solution.
11-19-2015 09:45 PM
Hi Team,
Found solution for the issue. Filtered feature need to be clear before getting GPrimitive from "ApplicationContext.getBrowser().getElement(selectedIds[i])".
Thanks,
Jai Ram Gaur