Changeset 33815 in osm for applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap
- Timestamp:
- 2017-11-17T00:48:06+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/ElevationProfile
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ElevationProfile
- Property svn:ignore
-
old new 8 8 checkstyle-josm-ElevationProfile.xml 9 9 findbugs-josm-ElevationProfile.xml 10 spotbugs-josm-ElevationProfile.xml
-
- Property svn:ignore
-
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java
r33215 r33815 6 6 import java.awt.Color; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.gui.IconToggleButton; 9 import org.openstreetmap.josm.gui.MainApplication; 10 10 import org.openstreetmap.josm.gui.MainMenu; 11 11 import org.openstreetmap.josm.gui.MapFrame; … … 35 35 36 36 // TODO: Disable this view as long as it is not stable 37 MainMenu.add(Main .main.menu.imagerySubMenu, new AddElevationLayerAction(), false, 0);37 MainMenu.add(MainApplication.getMenu().imagerySubMenu, new AddElevationLayerAction(), false, 0); 38 38 } 39 39 … … 64 64 if (currentLayer == null) { 65 65 currentLayer = new ElevationProfileLayer(tr("Elevation Profile")); 66 Main .getLayerManager().addLayer(currentLayer);66 MainApplication.getLayerManager().addLayer(currentLayer); 67 67 } 68 68 return currentLayer; -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/actions/AddElevationLayerAction.java
r32443 r33815 6 6 import java.awt.event.ActionEvent; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.actions.JosmAction; 9 import org.openstreetmap.josm.gui.MainApplication; 10 10 import org.openstreetmap.josm.gui.layer.Layer; 11 11 import org.openstreetmap.josm.plugins.elevation.grid.ElevationGridLayer; … … 27 27 if (currentLayer == null) { 28 28 currentLayer = new ElevationGridLayer(tr("Elevation Grid")); // TODO: Better name 29 Main .getLayerManager().addLayer(currentLayer);29 MainApplication.getLayerManager().addLayer(currentLayer); 30 30 } 31 31 } -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/grid/ElevationGridLayer.java
r33551 r33815 18 18 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener; 19 19 import org.openstreetmap.gui.jmapviewer.interfaces.TileSource; 20 import org.openstreetmap.josm.Main;21 20 import org.openstreetmap.josm.data.Bounds; 22 21 import org.openstreetmap.josm.data.coor.LatLon; … … 27 26 import org.openstreetmap.josm.plugins.elevation.IVertexRenderer; 28 27 import org.openstreetmap.josm.tools.ImageProvider; 28 import org.openstreetmap.josm.tools.Logging; 29 29 30 30 /** … … 114 114 public void tileLoadingFinished(Tile tile, boolean success) { 115 115 try { 116 if (Main.map != null) { 117 Main.map.repaint(100); 118 } 116 invalidate(); 119 117 } catch (Exception ex) { 120 System.err.println(ex); 121 ex.printStackTrace(System.err); 118 Logging.error(ex); 122 119 } 123 120 } -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java
r32775 r33815 19 19 import java.util.List; 20 20 21 import org.openstreetmap.josm.Main; 21 22 import org.openstreetmap.josm.data.gpx.WayPoint; 22 23 import org.openstreetmap.josm.gui.MapView; … … 150 151 151 152 // transform to view 152 Point pnt1 = mv.getPoint(wpt1.getEastNorth( ));153 Point pnt2 = mv.getPoint(wpt2.getEastNorth( ));153 Point pnt1 = mv.getPoint(wpt1.getEastNorth(Main.getProjection())); 154 Point pnt2 = mv.getPoint(wpt2.getEastNorth(Main.getProjection())); 154 155 155 156 // use thick line, if possible … … 188 189 189 190 Color c = getColorForWaypoint(profile, wpt, kind); 190 Point pnt = mv.getPoint(wpt.getEastNorth( ));191 Point pnt = mv.getPoint(wpt.getEastNorth(Main.getProjection())); 191 192 192 193 /* Paint full hour label */ … … 235 236 Color c = getColorForWaypoint(profile, wpt, kind); 236 237 int eleH = (int) ElevationHelper.getElevation(wpt); 237 Point pnt = mv.getPoint(wpt.getEastNorth( ));238 Point pnt = mv.getPoint(wpt.getEastNorth(Main.getProjection())); 238 239 239 240 TriangleDir td = TriangleDir.Up; … … 359 360 360 361 Color c = getColorForWaypoint(profile, wpt, kind); 361 Point pnt = mv.getPoint(wpt.getEastNorth( ));362 Point pnt = mv.getPoint(wpt.getEastNorth(Main.getProjection())); 362 363 drawSphere(g, Color.WHITE, c, pnt.x, pnt.y, BIG_WPT_RADIUS); 363 364 } -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
r32775 r33815 25 25 import javax.swing.event.ListDataListener; 26 26 27 import org.openstreetmap.josm.Main;28 27 import org.openstreetmap.josm.data.SystemOfMeasurement; 29 28 import org.openstreetmap.josm.data.gpx.GpxData; 29 import org.openstreetmap.josm.gui.MainApplication; 30 30 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 31 31 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 162 162 zoomButton.addActionListener(new ActionListener() { 163 163 @Override 164 public void actionPerformed(ActionEvent arg0) {164 public void actionPerformed(ActionEvent e) { 165 165 if (model != null) { 166 166 IElevationProfile profile = model.getCurrentProfile(); 167 167 if (profile != null) { 168 Main .map.mapView.zoomTo(profile.getBounds());168 MainApplication.getMap().mapView.zoomTo(profile.getBounds()); 169 169 } 170 170 } … … 198 198 @Override 199 199 public void showNotify() { 200 Main .getLayerManager().addLayerChangeListener(this);201 Main .getLayerManager().addActiveLayerChangeListener(this);202 if (Main .isDisplayingMapView()) {203 Layer layer = Main .getLayerManager().getActiveLayer();200 MainApplication.getLayerManager().addLayerChangeListener(this); 201 MainApplication.getLayerManager().addActiveLayerChangeListener(this); 202 if (MainApplication.isDisplayingMapView()) { 203 Layer layer = MainApplication.getLayerManager().getActiveLayer(); 204 204 if (layer instanceof GpxLayer) { 205 205 setActiveLayer((GpxLayer) layer); … … 210 210 @Override 211 211 public void hideNotify() { 212 Main .getLayerManager().removeActiveLayerChangeListener(this);213 Main .getLayerManager().removeLayerChangeListener(this);212 MainApplication.getLayerManager().removeActiveLayerChangeListener(this); 213 MainApplication.getLayerManager().removeLayerChangeListener(this); 214 214 } 215 215 … … 353 353 @Override 354 354 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 355 Layer newLayer = Main .getLayerManager().getActiveLayer();355 Layer newLayer = MainApplication.getLayerManager().getActiveLayer(); 356 356 if (newLayer instanceof GpxLayer) { 357 357 setActiveLayer((GpxLayer) newLayer); -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java
r32775 r33815 10 10 import javax.swing.Icon; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.Bounds; 14 13 import org.openstreetmap.josm.data.gpx.WayPoint; … … 62 61 if (this.profile != profile) { 63 62 this.profile = profile; 64 Main.map.repaint();63 invalidate(); 65 64 } 66 65 } … … 208 207 if (selWayPoint != newWayPoint) { 209 208 selWayPoint = newWayPoint; 210 Main.map.repaint();209 invalidate(); 211 210 } 212 211 }
Note:
See TracChangeset
for help on using the changeset viewer.