Java Visual Class facilitates a programmer specially while working with Jpanel and Java beans. Now the visualization of the map is more customized to me. I can add or delete toolbars or maps anytime.
Java visual editor has a special library 'ArcGIS Component'. 'MapBean', 'TOCBean', 'Toolbarbean' are some of these components. Now I can drag and drop these beans to the visual editor. Also can change some of their properties.
But in the case of adding event handler I found that ArcObjects are unable to deal directly with Java trivial libraries. They can access only the methods from Esri ArcGIS Engine library. Thats why I cannot use java event handlers (addActionListeners or addActionPerformed) with ArcObjects.
Fortunately ArcGIS Engine library has a some event handler named as IMapControlEvents. Now I am using this event handler for mouse click and arrowkeys. My MapControl returns (mapX, mapY) and (screenX, ScreenY) of the point mouse clicked. It also can be zoom out or zoom in with mouse scroll and Keyboard up/down arrowkeys.
Another possibility --- not the best, but possibly good enough --- would be polling the API for current coordinates. Is there a way to just ask what the current coordinates are? If so, we could possibly have a timing loop that keeps asking where the mouse is, say five times a second or so (more or less often depending both on what the system can respond to, and on what is sufficient for good feedback to the user).
ReplyDelete