Changeset 33545 in osm
- Timestamp:
- 2017-08-26T20:45:43+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/geochat
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/geochat/build.xml
r32680 r33545 5 5 <property name="commit.message" value="[josm_geochat] copypaste from keyboard, font size advanced parameters"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 0580"/>7 <property name="plugin.main.version" value="12643"/> 8 8 9 9 <property name="plugin.author" value="Ilya Zverev"/> -
applications/editors/josm/plugins/geochat/src/geochat/ChatMessage.java
r32544 r33545 84 84 } 85 85 final ChatMessage other = (ChatMessage) obj; 86 if (this.id != other.id) { 87 return false; 88 } 89 return true; 86 return this.id == other.id; 90 87 } 91 88 -
applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java
r32544 r33545 25 25 import org.openstreetmap.josm.Main; 26 26 import org.openstreetmap.josm.gui.util.GuiHelper; 27 import org.openstreetmap.josm.tools.Logging; 27 28 28 29 /** … … 116 117 doc.insertString(doc.getLength(), nline, attrs); 117 118 } catch (BadLocationException ex) { 118 Main.warn(ex);119 Logging.warn(ex); 119 120 } 120 121 thepane.setCaretPosition(doc.getLength()); -
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 } -
applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java
r32544 r33545 37 37 import org.openstreetmap.josm.data.Bounds; 38 38 import org.openstreetmap.josm.data.coor.LatLon; 39 import org.openstreetmap.josm.gui.JosmUserIdentityManager; 40 import org.openstreetmap.josm.gui.MapView; 41 import org.openstreetmap.josm.gui.Notification; 39 import org.openstreetmap.josm.gui.*; 42 40 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 43 41 import org.openstreetmap.josm.gui.layer.MapViewPaintable; 44 42 import org.openstreetmap.josm.gui.util.GuiHelper; 45 43 import org.openstreetmap.josm.tools.GBC; 44 import org.openstreetmap.josm.tools.Logging; 46 45 47 46 /** … … 156 155 } 157 156 } catch (IOException e) { 158 Main.warn("Failed to logout from geochat server: " + e.getMessage());157 Logging.warn("Failed to logout from geochat server: " + e.getMessage()); 159 158 } 160 159 super.destroy(); … … 317 316 this.users = newUsers; 318 317 updateTitleAlarm(); 319 if (userLayerActive && Main .map.mapView != null)320 Main .map.mapView.repaint();318 if (userLayerActive && MainApplication.isDisplayingMapView()) 319 MainApplication.getMap().mapView.repaint(); 321 320 } 322 321 -
applications/editors/josm/plugins/geochat/src/geochat/GeoChatPopupAdapter.java
r32544 r33545 13 13 import javax.swing.JPopupMenu; 14 14 15 import org.openstreetmap.josm. Main;15 import org.openstreetmap.josm.gui.MainApplication; 16 16 17 17 /** … … 114 114 ToggleUserLayerAction() { 115 115 super(tr("Show users on map")); 116 putValue(SELECTED_KEY, Boolean.valueOf(panel.userLayerActive));116 putValue(SELECTED_KEY, panel.userLayerActive); 117 117 } 118 118 119 119 @Override 120 120 public void actionPerformed(ActionEvent e) { 121 if ( Main.map == null || Main.map.mapView == null)121 if (!MainApplication.isDisplayingMapView()) 122 122 return; 123 boolean wasAdded = Main .map.mapView.addTemporaryLayer(panel);123 boolean wasAdded = MainApplication.getMap().mapView.addTemporaryLayer(panel); 124 124 if (!wasAdded) 125 Main .map.mapView.removeTemporaryLayer(panel);125 MainApplication.getMap().mapView.removeTemporaryLayer(panel); 126 126 panel.userLayerActive = wasAdded; 127 putValue(SELECTED_KEY, Boolean.valueOf(panel.userLayerActive));128 Main .map.mapView.repaint();127 putValue(SELECTED_KEY, panel.userLayerActive); 128 MainApplication.getMap().mapView.repaint(); 129 129 } 130 130 } -
applications/editors/josm/plugins/geochat/src/geochat/JPanelTextField.java
r32544 r33545 16 16 import javax.swing.text.DefaultEditorKit; 17 17 18 import org.openstreetmap.josm. Main;18 import org.openstreetmap.josm.gui.MainApplication; 19 19 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 20 20 … … 87 87 } 88 88 } else if (code == KeyEvent.VK_ESCAPE) { 89 if (Main .map != null && Main.map.mapView != null)90 Main .map.mapView.requestFocus();89 if (MainApplication.isDisplayingMapView()) 90 MainApplication.getMap().mapView.requestFocus(); 91 91 } 92 92 -
applications/editors/josm/plugins/geochat/src/geochat/JsonQueryUtil.java
r32544 r33545 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.gui.MainApplication; 17 import org.openstreetmap.josm.tools.Logging; 16 18 17 19 /** … … 70 72 */ 71 73 public static void queryAsync(String query, JsonQueryCallback callback) { 72 Main .worker.submit(new JsonQueryUtil(query, callback));74 MainApplication.worker.submit(new JsonQueryUtil(query, callback)); 73 75 } 74 76 … … 78 80 obj = query(query); 79 81 } catch (IOException e) { 80 Main.warn(e.getClass().getName() + " while connecting to a chat server: " + e.getMessage());82 Logging.warn(e.getClass().getName() + " while connecting to a chat server: " + e.getMessage()); 81 83 obj = null; 82 84 }
Note:
See TracChangeset
for help on using the changeset viewer.