Changeset 33545 in osm for applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java
- Timestamp:
- 2017-08-26T20:45:43+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java
r32544 r33545 23 23 import org.openstreetmap.josm.data.coor.LatLon; 24 24 import org.openstreetmap.josm.data.projection.Projection; 25 import org.openstreetmap.josm.gui.MainApplication; 25 26 import org.openstreetmap.josm.gui.MapView; 27 import org.openstreetmap.josm.tools.Logging; 26 28 27 29 /** … … 122 124 } 123 125 } catch (InterruptedException e) { 124 Main.warn(e);126 Logging.warn(e); 125 127 } 126 128 autoLogin(userName); … … 164 166 }); 165 167 } catch (UnsupportedEncodingException e) { 166 Main.error(e);168 Logging.error(e); 167 169 } 168 170 } … … 266 268 }); 267 269 } catch (UnsupportedEncodingException e) { 268 Main.error(e);270 Logging.error(e); 269 271 } 270 272 } … … 274 276 */ 275 277 private static LatLon getPosition() { 276 if ( Main.map == null || Main.map.mapView == null)278 if (!MainApplication.isDisplayingMapView()) 277 279 return null; 278 280 if (getCurrentZoom() < 10) 279 281 return null; 280 282 Projection proj = Main.getProjection(); 281 return proj.eastNorth2latlon(Main .map.mapView.getCenter());283 return proj.eastNorth2latlon(MainApplication.getMap().mapView.getCenter()); 282 284 } 283 285 … … 294 296 295 297 public static int getCurrentZoom() { 296 if ( Main.map == null || Main.map.mapView == null) {298 if (!MainApplication.isDisplayingMapView()) { 297 299 return 1; 298 300 } 299 MapView mv = Main .map.mapView;301 MapView mv = MainApplication.getMap().mapView; 300 302 LatLon topLeft = mv.getLatLon(0, 0); 301 303 LatLon botRight = mv.getLatLon(mv.getWidth(), mv.getHeight()); … … 434 436 result.add(cm); 435 437 } catch (JsonException e) { 436 Main.trace(e);438 Logging.trace(e); 437 439 } 438 440 } … … 450 452 result.put(name, new LatLon(lat, lon)); 451 453 } catch (JsonException e) { 452 Main.trace(e);454 Logging.trace(e); 453 455 } 454 456 }
Note:
See TracChangeset
for help on using the changeset viewer.