Select to view content in your preferred language

Identify on Graphicslayer returns NULLPointException

4015
11
01-11-2013 02:35 AM
MartinRick
Deactivated User
Hi,

currently I try to implement an identify for the chemical lights layer from the vehicle commander template from esri. The chem lights get stored in a Graphicslayer, which has a method called getGraphicIDs(float x, float y, int tolerance).
Unfortunately I always get a NULL Pointer and I cannot find out the cause for this. Does anyone else have such experiences with the method?

Regards and thanks for response

Martin

Exception:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.esri.map.GraphicsLayer.getGraphicIDs(Unknown Source)
at com.esri.map.GraphicsLayer.getGraphicIDs(Unknown Source)
at com.esri.vehiclecommander.ChemLightsOverlay.checkSelection(ChemLightsOverlay.java:85)
at com.esri.vehiclecommander.ChemLightsOverlay.<init>(ChemLightsOverlay.java:52)
at com.esri.vehiclecommander.IdentifyResultsJPanel.setIdentifyPoint(IdentifyResultsJPanel.java:371)
at com.esri.vehiclecommander.VehicleCommanderJFrame.identifyComplete(VehicleCommanderJFrame.java:951)
at com.esri.vehiclecommander.MapController$4$1.removeListenerAndCheckResult(MapController.java:400)
at com.esri.vehiclecommander.MapController$4$1.onCallback(MapController.java:388)
at com.esri.vehiclecommander.MapController$4$1.onCallback(MapController.java:1)
at com.esri.core.tasks.TaskCallbackListener$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
0 Kudos
11 Replies
MartinRick
Deactivated User
I was able to isolate the problem a bit. Now I just get the error, when the Graphicslayer to identify is member of a group or Messagegrouplayer.

Seems to be a bug in the API.

@esri: Will this issue be addressed in the ArcGIS Runtime for Java Version 1.1?

Regards

Martin
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
There is a post that states it will be so.

See Message Processing 2525C component: symbol highlighting and selection
0 Kudos
MarkBaird
Esri Regular Contributor
Yes I agree this looks like a bug in the API.

I've seen a very similar issue in another area of the API (Message Processor releated) which I believe was fixed in time for the next release.  I'll confirm this and let you know what I find.
0 Kudos
MartinRick
Deactivated User
Hi,

thank you for the quick answer. I would highly appreciate if esri could fix this problem for the next release since it is an important functionality when working with objects in a graphicslayer.

Regards

Martin
0 Kudos
MarkBaird
Esri Regular Contributor
I've tested this against our internal release candidate for the next release and I can confirm:

- Hit tests work (getGraphicIDs supplying x and y screen location) against graphics layers in a message group layer.  The bug reported in release 1.0 throws a Null Pointer Exception.  It now returns graphics ids.

- The highlight now also works for these symbols.  There is a special message type for highlighting or you can set a graphic to highlighted.

The next release is going to be numbered 10.1.1 (aligning with other products) and is going to be available quite shortly.  We are currently going through a QA process, so please watch this space.
0 Kudos
MartinRick
Deactivated User
Hi,

thank you for the feedback. Yesterday I got some response from our local esri support. The case is now accepted as a bug and got a nimbus number.

#NIM088103  If GraphicsLayer is in a GroupLayer, the GraphicsLayer::getGraphicIDs(float x, float y, int tolerance)  method throws NULLPointerException.

Hopefully it will be resolved in the version 10.1.1

Martin
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
I've tested this against our internal release candidate for the next release and I can confirm:

- Hit tests work (getGraphicIDs supplying x and y screen location) against graphics layers in a message group layer.  The bug reported in release 1.0 throws a Null Pointer Exception.  It now returns graphics ids.

- The highlight now also works for these symbols.  There is a special message type for highlighting or you can set a graphic to highlighted.

The next release is going to be numbered 10.1.1 (aligning with other products) and is going to be available quite shortly.  We are currently going through a QA process, so please watch this space.


Hi Mark,

I received and installed the latest 10.1.1 for Java and noticed that there were no sample code that illustrates how to do what you describe above. Is it possible to post some code snippet here on how to add a GraphicsLayer to a HitTestOverlay object, since GraphicsLayer objects are dynamically generated by the MessageGroupLayer, in order to obtain the associated Graphic(s), or Message(s), selected off the MessageGroupLayer's MessageProcessor, then highlight the selected Graphic(s) using the special Message object?

I'd really appreciate your help on this. I've waited for this functionality for some time now.

Regards,

Carlos
0 Kudos
MartinRick
Deactivated User
Hi,

today I got the ArcGIS Runtime 10.1.1 and tried the getGraphicID method again with a graphicslayer in a ordinary grouplayer (the same sample I sent previously to the support) and now it works fine.

Regards

Martin
0 Kudos
MartinRick
Deactivated User
I attached the code which bases on the Select Graphics from the Runtime version 1.0
0 Kudos