Changeset 29531 in osm for applications/editors/josm/plugins
- Timestamp:
- 2013-04-23T13:17:15+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java
r29457 r29531 238 238 g.setColor(lineColor); 239 239 Point lp=line.getLastPoint(); 240 Point mp= Main.map.mapView.getMousePosition();240 Point mp=mv.getMousePosition(); 241 241 if (lp!=null && mp!=null) g.drawLine(lp.x,lp.y,mp.x,mp.y); 242 242 } -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
r28954 r29531 162 162 163 163 // Position image at the right graphical place 164 EastNorth center = Main.map.mapView.getCenter();165 EastNorth leftop = Main.map.mapView.getEastNorth(0, 0);166 double pixel_per_east_unit = ( Main.map.mapView.getWidth() / 2.0)164 EastNorth center = mv.getCenter(); 165 EastNorth leftop = mv.getEastNorth(0, 0); 166 double pixel_per_east_unit = (mv.getWidth() / 2.0) 167 167 / (center.east() - leftop.east()); 168 double pixel_per_north_unit = ( Main.map.mapView.getHeight() / 2.0)168 double pixel_per_north_unit = (mv.getHeight() / 2.0) 169 169 / (leftop.north() - center.north()); 170 170 … … 182 182 183 183 // Determine scale to fit JOSM extents 184 ProjectionBounds projbounds = Main.map.mapView 185 .getProjectionBounds(); 184 ProjectionBounds projbounds = mv.getProjectionBounds(); 186 185 187 186 double width = projbounds.maxEast - projbounds.minEast; … … 193 192 / height; 194 193 195 double pixels4bbox_width = ratio_x * Main.map.mapView.getWidth();196 double pixels4bbox_height = ratio_y * Main.map.mapView.getHeight();194 double pixels4bbox_width = ratio_x * mv.getWidth(); 195 double pixels4bbox_height = ratio_y * mv.getHeight(); 197 196 198 197 // Scale image to JOSM extents -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java
r27977 r29531 109 109 for (EditGpxWayPoint wayPoint: segment.getWayPoints()) { 110 110 if (!wayPoint.isDeleted()) { 111 Point pnt = Main.map.mapView.getPoint(wayPoint.getCoor().getEastNorth());111 Point pnt = mv.getPoint(wayPoint.getCoor().getEastNorth()); 112 112 g.drawOval(pnt.x - 2, pnt.y - 2, 4, 4); 113 113 } -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java
r28898 r29531 76 76 Point l = null; 77 77 for(WayPoint p:points){ 78 Point pnt = Main.map.mapView.getPoint(p.getCoor());78 Point pnt = mv.getPoint(p.getCoor()); 79 79 if (l != null){ 80 80 g.drawLine(l.x, l.y, pnt.x, pnt.y); -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
r28559 r29531 232 232 233 233 // Position image at the right graphical place 234 EastNorth center = Main.map.mapView.getCenter();235 EastNorth leftop = Main.map.mapView.getEastNorth( 0, 0 );234 EastNorth center = mv.getCenter(); 235 EastNorth leftop = mv.getEastNorth( 0, 0 ); 236 236 // Number of pixels for one unit in east north space. 237 237 // This is the same in x- and y- direction. 238 double pixel_per_en = ( Main.map.mapView.getWidth() / 2.0 ) / ( center.east() - leftop.east() );238 double pixel_per_en = ( mv.getWidth() / 2.0 ) / ( center.east() - leftop.east() ); 239 239 240 240 // This is now the offset in screen pixels … … 258 258 259 259 // Draw additional rectangle for the active pic layer 260 if ( Main.map.mapView.getActiveLayer() == this ) {260 if ( mv.getActiveLayer() == this ) { 261 261 g.setColor( new Color( 0xFF0000 ) ); 262 262 g.drawRect( -
applications/editors/josm/plugins/reltoolbox/src/relcontext/ChosenRelation.java
r28814 r29531 114 114 } 115 115 116 OsmDataLayer dataLayer = Main.map.mapView.getEditLayer();116 OsmDataLayer dataLayer = mv.getEditLayer(); 117 117 float opacity = dataLayer == null ? 0.0f : !dataLayer.isVisible() ? 0.0f : (float)dataLayer.getOpacity(); 118 118 if( opacity < 0.01 ) -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPositionLayer.java
r28924 r29531 69 69 Collections.sort(ls); //sort basing upon time 70 70 return ls; 71 72 71 } 73 72 74 73 @Override 75 74 public void paint(Graphics2D g, MapView map, Bounds bound) { 76 paintGpsTrack(g );77 paintSyncedTrack(g );78 paintPositionIcon(g );75 paintGpsTrack(g, map); 76 paintSyncedTrack(g, map); 77 paintPositionIcon(g, map); 79 78 //paintInterpolatedSegment(g); //just a test for my own 80 79 } 81 80 82 private void paintGpsTrack(Graphics2D g ) {81 private void paintGpsTrack(Graphics2D g, MapView map) { 83 82 g.setColor(Color.YELLOW); 84 83 for(WayPoint n: gpsTrack) { 85 Point p = Main.map.mapView.getPoint(n.getEastNorth());84 Point p = map.getPoint(n.getEastNorth()); 86 85 g.drawOval(p.x - 2, p.y - 2, 4, 4); 87 86 } 88 87 } 89 88 90 private void paintSyncedTrack(Graphics2D g ) {89 private void paintSyncedTrack(Graphics2D g, MapView map) { 91 90 g.setColor(Color.GREEN); 92 91 for (WayPoint n : gpsTrack) { 93 92 if (n.attr.containsKey("synced")) 94 93 { 95 Point p = Main.map.mapView.getPoint(n.getEastNorth());94 Point p = map.getPoint(n.getEastNorth()); 96 95 g.drawOval(p.x - 2, p.y - 2, 4, 4); 97 96 } … … 100 99 } 101 100 102 private void paintPositionIcon(Graphics2D g ) {103 Point p= Main.map.mapView.getPoint(iconPosition.getEastNorth());101 private void paintPositionIcon(Graphics2D g, MapView map) { 102 Point p=map.getPoint(iconPosition.getEastNorth()); 104 103 layerIcon.paintIcon(null, g, p.x-layerIcon.getIconWidth()/2, p.y-layerIcon.getIconHeight()/2); 105 104 g.drawString(gpsTimeFormat.format(iconPosition.getTime()),p.x-15,p.y-15);
Note:
See TracChangeset
for help on using the changeset viewer.