Changeset 18595 in osm
- Timestamp:
- 2009-11-14T19:38:46+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/build.xml
r18413 r18595 26 26 <attribute name="Plugin-Description" value="A special handler for the French land registry WMS server."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/> 28 <attribute name="Plugin-Mainversion" value="2 381"/>28 <attribute name="Plugin-Mainversion" value="2450"/> 29 29 <attribute name="Plugin-Stage" value="60"/> 30 30 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r18544 r18595 26 26 27 27 import org.openstreetmap.josm.Main; 28 import org.openstreetmap.josm.data.Bounds; 29 import org.openstreetmap.josm.data.coor.EastNorth; 28 30 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 29 31 import org.openstreetmap.josm.data.projection.LambertCC9Zones; 30 import org.openstreetmap.josm.data.Bounds;31 32 import org.openstreetmap.josm.gui.MapView; 32 33 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; … … 34 35 import org.openstreetmap.josm.gui.layer.Layer; 35 36 import org.openstreetmap.josm.io.OsmTransferException; 36 import org.openstreetmap.josm.data.coor.EastNorth;37 37 38 38 /** … … 65 65 66 66 private boolean isRaster = false; 67 67 68 68 private boolean isAlreadyGeoreferenced = false; 69 69 70 70 public double X0, Y0, angle, fX, fY; 71 71 … … 73 73 private EastNorth rasterMax; 74 74 private double rasterRatio; 75 75 76 76 private JMenuItem saveAsPng; 77 77 … … 103 103 if (isRaster) { 104 104 b = new Bounds(Main.proj.eastNorth2latlon(rasterMin), Main.proj.eastNorth2latlon(rasterMax)); 105 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.rasterDivider", 105 divideBbox(b, Integer.parseInt(Main.pref.get("cadastrewms.rasterDivider", 106 106 CadastrePreferenceSetting.DEFAULT_RASTER_DIVIDER))); 107 107 } else … … 203 203 204 204 @Override 205 public void paint(Graphics g, final MapView mv) { 205 public void paint(Graphics2D g, final MapView mv, Bounds bounds) { 206 206 synchronized(this){ 207 207 for (GeorefImage img : images) 208 img.paint( (Graphics2D)g, mv, CadastrePlugin.backgroundTransparent,208 img.paint(g, mv, CadastrePlugin.backgroundTransparent, 209 209 CadastrePlugin.transparency, CadastrePlugin.drawBoundaries); 210 210 } … … 236 236 saveAsPng, 237 237 new JMenuItem(new LayerListPopup.InfoAction(this)), 238 238 239 239 }; 240 240 return component; … … 336 336 337 337 /** 338 * Set raster positions used for grabbing and georeferencing. 338 * Set raster positions used for grabbing and georeferencing. 339 339 * rasterMin is the Eaast North of bottom left corner raster image on the screen when image is grabbed. 340 340 * The bounds width and height are the raster width and height. The image width matches the current view 341 341 * and the image height is adapted. 342 * Required: the communeBBox must be set (normally it is catched by CadastreInterface and saved by DownloadWMSPlanImage) 342 * Required: the communeBBox must be set (normally it is catched by CadastreInterface and saved by DownloadWMSPlanImage) 343 343 * @param bounds the current main map view boundaries 344 344 */ … … 347 347 EastNorth eaMin = Main.proj.latlon2eastNorth(bounds.getMin()); 348 348 EastNorth eaMax = Main.proj.latlon2eastNorth(bounds.getMax()); 349 double rasterSizeX = communeBBox.max.getX() - communeBBox.min.getX(); 349 double rasterSizeX = communeBBox.max.getX() - communeBBox.min.getX(); 350 350 double rasterSizeY = communeBBox.max.getY() - communeBBox.min.getY(); 351 351 double ratio = rasterSizeY/rasterSizeX; … … 443 443 return true; 444 444 } 445 445 446 446 /** 447 447 * Join the grabbed images into one single. … … 454 454 EastNorth max = images.get(images.size()-1).max; 455 455 int oldImgWidth = images.get(0).image.getWidth(); 456 int oldImgHeight = images.get(0).image.getHeight(); 456 int oldImgHeight = images.get(0).image.getHeight(); 457 457 int newWidth = oldImgWidth*(int)Math.sqrt(images.size()); 458 458 int newHeight = oldImgHeight*(int)Math.sqrt(images.size()); … … 475 475 } 476 476 } 477 477 478 478 /** 479 479 * Image cropping based on two EN coordinates pointing to two corners in diagonal 480 480 * Because it's coming from user mouse clics, we have to sort de positions first. 481 481 * Works only for raster image layer (only one image in collection). 482 * Updates layer georeferences. 482 * Updates layer georeferences. 483 483 * @param en1 484 484 * @param en2 485 485 */ 486 486 public void cropImage(EastNorth en1, EastNorth en2){ 487 // adj1 is corner bottom, left 487 // adj1 is corner bottom, left 488 488 EastNorth adj1 = new EastNorth(en1.east() <= en2.east() ? en1.east() : en2.east(), 489 489 en1.north() <= en2.north() ? en1.north() : en2.north()); … … 501 501 Graphics g = new_img.getGraphics(); 502 502 g.drawImage(images.get(0).image, 0, 0, newWidth-1, newHeight-1, 503 (int)sx1, (int)sy1, (int)sx2, (int)sy2,503 sx1, sy1, sx2, sy2, 504 504 this); 505 505 images.set(0, new GeorefImage(new_img, adj1, adj2)); … … 522 522 523 523 /** 524 * Method required by ImageObserver when drawing an image 524 * Method required by ImageObserver when drawing an image 525 525 */ 526 526 public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) { … … 540 540 if (Main.map.mapView.getAllLayers().size() == 1) { 541 541 /* Enable this code below when JOSM will have a proper support of dynamic projection change 542 * 542 * 543 543 System.out.println("close all layers and change current Lambert zone from "+LambertCC9Zones.layoutZone+" to "+lambertZone); 544 544 Bounds b = null; … … 562 562 (images.get(0).max.north()+images.get(0).min.north())/2); 563 563 } 564 564 565 565 public void displace(double dx, double dy) { 566 566 this.rasterMin = new EastNorth(rasterMin.east() + dx, rasterMin.north() + dy); … … 582 582 if (!crosspieces.equals("0")) { 583 583 int modulo = 50; 584 if (crosspieces.equals("2")) modulo = 100; 584 if (crosspieces.equals("2")) modulo = 100; 585 585 EastNorthBound currentView = new EastNorthBound(mv.getEastNorth(0, mv.getHeight()), 586 586 mv.getEastNorth(mv.getWidth(), 0)); … … 603 603 } 604 604 } 605 605 606 606 } -
applications/editors/josm/plugins/editgpx/build.xml
r18426 r18595 26 26 <attribute name="Plugin-Description" value="Allows the user to anonymize timestamps and delete parts of huge GPX tracks very fast." /> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/EditGpx" /> 28 <attribute name="Plugin-Mainversion" value="2 388" />28 <attribute name="Plugin-Mainversion" value="2450" /> 29 29 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 30 30 </manifest> -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java
r18426 r18595 8 8 import java.awt.Color; 9 9 import java.awt.Component; 10 import java.awt.Graphics; 10 import java.awt.Graphics2D; 11 11 import java.awt.Point; 12 12 import java.awt.Toolkit; … … 23 23 24 24 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.data.Bounds; 25 26 import org.openstreetmap.josm.data.gpx.GpxData; 26 27 import org.openstreetmap.josm.data.gpx.GpxTrack; … … 106 107 107 108 @Override 108 public void paint(Graphics g, MapView mv) { 109 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 109 110 g.setColor(Color.yellow); 110 111 -
applications/editors/josm/plugins/imagewaypoint/build.xml
r17373 r18595 26 26 <attribute name="Plugin-Description" value="Another plugin to match images to the waypoints in a GPX file. A match is made when the 'name', 'cmt' or 'desc' attribute of a waypoint tag matches the filename of an image."/> 27 27 <attribute name="Plugin-Early" value="false"/> 28 <attribute name="Plugin-Mainversion" value="2 012"/>28 <attribute name="Plugin-Mainversion" value="2450"/> 29 29 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 30 30 </manifest> -
applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointLayer.java
r17373 r18595 4 4 5 5 import java.awt.Component; 6 import java.awt.Graphics; 6 import java.awt.Graphics2D; 7 7 import java.awt.Rectangle; 8 8 import java.awt.event.MouseAdapter; … … 13 13 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.data.Bounds; 15 16 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 16 17 import org.openstreetmap.josm.gui.MapView; … … 116 117 117 118 @Override 118 public final void paint(final Graphics graphics, final MapView mapView) { 119 public final void paint(final Graphics2D graphics, final MapView mapView, Bounds box) { 119 120 final ImageEntry[] images = ImageEntries.getInstance().getImages(); 120 121 -
applications/editors/josm/plugins/measurement/.classpath
r15953 r18595 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/ sun-jdk-1.5.0"/>4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK 5"/> 5 5 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 6 <classpathentry kind="output" path="build"/> -
applications/editors/josm/plugins/measurement/build.xml
r17377 r18595 25 25 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 26 26 <attribute name="Plugin-Description" value="Provide a measurement dialog and a layer to measure length and angle of segments, area surrounded by a (simple) closed way and create measurement paths (which also can be imported from a gps layer)."/> 27 <attribute name="Plugin-Mainversion" value="2 012"/>27 <attribute name="Plugin-Mainversion" value="2450"/> 28 28 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 29 29 </manifest> -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java
r16801 r18595 5 5 import java.awt.Color; 6 6 import java.awt.Component; 7 import java.awt.Graphics; 7 import java.awt.Graphics2D; 8 8 import java.awt.Point; 9 9 import java.awt.Toolkit; … … 29 29 30 30 import org.openstreetmap.josm.Main; 31 import org.openstreetmap.josm.data.Bounds; 31 32 import org.openstreetmap.josm.data.coor.LatLon; 32 33 import org.openstreetmap.josm.data.gpx.GpxTrack; … … 71 72 } 72 73 73 @Override public void paint(Graphics g, final MapView mv) { 74 @Override public void paint(Graphics2D g, final MapView mv, Bounds bounds) { 74 75 g.setColor(Color.green); 75 76 Point l = null; -
applications/editors/josm/plugins/openstreetbugs/build.xml
r18503 r18595 26 26 <attribute name="Plugin-Description" value="Imports issues from OpenStreetBugs"/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/OpenStreetBugs"/> 28 <attribute name="Plugin-Mainversion" value="24 01"/>28 <attribute name="Plugin-Mainversion" value="2450"/> 29 29 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 30 30 </manifest> -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java
r18482 r18595 32 32 import java.awt.Component; 33 33 import java.awt.Dimension; 34 import java.awt.Graphics; 34 import java.awt.Graphics2D; 35 35 import java.awt.Image; 36 36 import java.awt.Point; … … 48 48 import org.openstreetmap.josm.Main; 49 49 import org.openstreetmap.josm.actions.RenameLayerAction; 50 import org.openstreetmap.josm.data.Bounds; 50 51 import org.openstreetmap.josm.data.SelectionChangedListener; 51 52 import org.openstreetmap.josm.data.osm.DataSet; … … 118 119 119 120 @Override 120 public void paint(Graphics g, MapView mv) { 121 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 121 122 Object[] nodes = data.getNodes().toArray(); 122 123 // This loop renders all the bug icons … … 178 179 179 180 int tx = p.x + (width / 2) + 5; 180 int ty = ( int)(p.y - height / 2) -1;181 int ty = (p.y - height / 2) -1; 181 182 g.translate(tx, ty); 182 183 … … 189 190 for(int x = 0; x < 2; x++) { 190 191 Dimension d = tooltip.getUI().getPreferredSize(tooltip); 191 d.width = Math.min(d.width, ( int)(mv.getWidth()*2/3));192 d.width = Math.min(d.width, (mv.getWidth()*2/3)); 192 193 tooltip.setSize(d); 193 194 tooltip.paint(g); … … 231 232 if(e.getButton() == MouseEvent.BUTTON1) { 232 233 if(Main.map.mapView.getActiveLayer() == this) { 233 Node n = (Node)getNearestNode(e.getPoint());234 Node n = getNearestNode(e.getPoint()); 234 235 if(data.getNodes().contains(n)) { 235 236 data.setSelected(n); … … 250 251 if(e.isPopupTrigger()) { 251 252 if(Main.map.mapView.getActiveLayer() == this) { 252 Node n = (Node)getNearestNode(e.getPoint());253 Node n = getNearestNode(e.getPoint()); 253 254 OsbAction.setSelectedNode(n); 254 255 if(data.getNodes().contains(n)) {
Note:
See TracChangeset
for help on using the changeset viewer.