viewportPane.removeMouseListener(currentMapMouseListener);
}
}
private void addMapMouseListener() {
final IMap activeMap = ApplicationGIS.getActiveMap();
if (activeMap == null) {
return;
}
final IRenderManager renderManager = activeMap.getRenderManager();
if (renderManager == null) {
return;
}
final ViewportPane viewportPane = (ViewportPane) renderManager.getMapDisplay();
if (viewportPane == null) {
return;
}
currentMapMouseListener = new MapMouseListener(){
public void mouseReleased( MapMouseEvent event ) {
Point point = event.getPoint();
Coordinate worldClick = activeMap.getViewportModel().pixelToWorld(point.x, point.y);
if (isEastingNorthing) {
text.setText(String.valueOf(worldClick.x) + "," + String.valueOf(worldClick.y));
}
if (isNorthing) {
text.setText(String.valueOf(worldClick.y));