Changeset 18593 in osm for applications/editors
- Timestamp:
- 2009-11-14T19:27:50+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/agpifoj/.classpath
r16603 r18593 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER "/>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 <classpathentry kind="lib" path="/JOSM/lib/metadata-extractor-2.3.1-nosun.jar"/> 6 7 <classpathentry kind="output" path="bin"/> 7 8 </classpath> -
applications/editors/josm/plugins/agpifoj/build.xml
r18287 r18593 34 34 <attribute name="Plugin-Early" value="false"/> 35 35 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/AgPifoJ"/> 36 <attribute name="Plugin-Mainversion" value="2 322"/>36 <attribute name="Plugin-Mainversion" value="2450"/> 37 37 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 38 38 </manifest> -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java
r18287 r18593 9 9 10 10 import java.awt.Component; 11 import java.awt.Graphics ;11 import java.awt.Graphics2D; 12 12 import java.awt.Point; 13 13 import java.awt.Rectangle; … … 31 31 import org.openstreetmap.josm.Main; 32 32 import org.openstreetmap.josm.actions.RenameLayerAction; 33 import org.openstreetmap.josm.data.Bounds; 33 34 import org.openstreetmap.josm.data.coor.CachedLatLon; 34 35 import org.openstreetmap.josm.data.coor.LatLon; … … 109 110 this.errorMessages.add(message); 110 111 } 111 112 112 113 public Loader(File[] selection) { 113 114 super(tr("Extracting GPS locations from EXIF")); 114 115 this.selection = selection; 115 errorMessages = new LinkedHashSet<String>(); 116 errorMessages = new LinkedHashSet<String>(); 116 117 } 117 118 … … 122 123 try { 123 124 addRecursiveFiles(files, selection); 124 } catch(NullPointerException npe) { 125 } catch(NullPointerException npe) { 125 126 rememberError(tr("One of the selected files was null")); 126 127 } … … 128 129 if (cancelled) { 129 130 return; 130 } 131 } 131 132 progressMonitor.subTask(tr("Read photos...")); 132 133 progressMonitor.setTicksCount(files.size()); … … 200 201 } catch(NullPointerException npe) { 201 202 npe.printStackTrace(); 202 203 203 204 rememberError(tr("Found null file in directory {0}\n", f.getPath())); 204 205 } … … 232 233 return sb.toString(); 233 234 } 234 235 235 236 @Override protected void finish() { 236 237 if (!errorMessages.isEmpty()) { … … 361 362 362 363 @Override 363 public void paint(Graphics g, MapView mv) {364 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 364 365 365 366 int iconWidth = icon.getIconWidth() / 2; -
applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
r17526 r18593 96 96 } 97 97 98 public String toString() { 98 @Override 99 public String toString() { 99 100 return name; 100 101 } … … 172 173 x.printStackTrace(); 173 174 JOptionPane.showMessageDialog( 174 Main.parent, 175 Main.parent, 175 176 tr("Error while parsing {0}",sel.getName())+": "+x.getMessage(), 176 177 tr("Error"), … … 181 182 x.printStackTrace(); 182 183 JOptionPane.showMessageDialog( 183 Main.parent, 184 Main.parent, 184 185 tr("Could not read \"{0}\"",sel.getName())+"\n"+x.getMessage(), 185 186 tr("Error"), … … 386 387 while (! isOk) { 387 388 int answer = JOptionPane.showConfirmDialog( 388 Main.parent, panel, 389 tr("Synchronize time from a photo of the GPS receiver"), 389 Main.parent, panel, 390 tr("Synchronize time from a photo of the GPS receiver"), 390 391 JOptionPane.OK_CANCEL_OPTION, 391 392 JOptionPane.QUESTION_MESSAGE … … 637 638 // Search whether an other layer has yet defined some bounding box. 638 639 // If none, we'll zoom to the bounding box of the layer with the photos. 639 Collection<Layer> layerCol = Main.map.mapView.getAllLayers();640 Iterator<Layer> layerIter = layerCol.iterator();641 640 boolean boundingBoxedLayerFound = false; 642 while (layerIter.hasNext()) { 643 Layer l = layerIter.next(); 641 for (Layer l: Main.map.mapView.getAllLayers()) { 644 642 if (l != yLayer) { 645 643 BoundingXYVisitor bbox = new BoundingXYVisitor(); … … 657 655 } 658 656 659 Main.ma in.map.repaint();657 Main.map.repaint(); 660 658 661 659 JOptionPane.showMessageDialog(Main.parent, tr("Found {0} matches of {1} in GPX track {2}", matched, dateImgLst.size(), selectedGpx.name), … … 886 884 ExtendedDialog d = new ExtendedDialog(Main.parent, 887 885 tr("Adjust timezone and offset"), 888 new String[] { tr("Close"), tr("Default Values") } 886 new String[] { tr("Close"), tr("Default Values") } 889 887 ); 890 888 -
applications/editors/josm/plugins/graphview/build.xml
r18415 r18593 57 57 <attribute name="Plugin-Description" value="Visualizes routing information as a routing graph."/> 58 58 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Graphview"/> 59 <attribute name="Plugin-Mainversion" value="2 381"/>59 <attribute name="Plugin-Mainversion" value="2450"/> 60 60 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 61 61 </manifest> -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java
r18130 r18593 19 19 import org.openstreetmap.josm.Main; 20 20 import org.openstreetmap.josm.actions.RenameLayerAction; 21 import org.openstreetmap.josm.data.Bounds; 21 22 import org.openstreetmap.josm.data.coor.EastNorth; 22 23 import org.openstreetmap.josm.data.coor.LatLon; … … 148 149 149 150 List<Segment> edgeSegments = e.getPropertyValue(GraphEdgeSegments.PROPERTY); 150 151 151 152 if (edgeSegments.size() > 0) { 152 153 … … 283 284 284 285 @Override 285 public void paint(final Graphics g, final MapView mv) { 286 287 assert g instanceof Graphics2D; 288 Graphics2D g2D = ((Graphics2D)g); 289 286 public void paint(final Graphics2D g, final MapView mv, Bounds bounds) { 290 287 if (wayGraph != null) { 291 288 … … 295 292 296 293 for (GraphEdge e : wayGraph.getEdges()) { 297 paintGraphEdge(e, g 2D, mv);294 paintGraphEdge(e, g, mv); 298 295 } 299 296 -
applications/editors/josm/plugins/slippymap/.classpath
r5674 r18593 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER "/>5 <classpathentry combineaccessrules="false" kind="src" path="/ josm"/>4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK 5"/> 5 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 6 <classpathentry kind="output" path="build"/> 7 7 </classpath> -
applications/editors/josm/plugins/slippymap/build.xml
r18485 r18593 26 26 <attribute name="Plugin-Description" value="Displays a slippy map grid in JOSM. Can load tiles from slippy map as background and request updates."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/SlippyMap"/> 28 <attribute name="Plugin-Mainversion" value="2 351"/>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/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java
r18590 r18593 5 5 import java.awt.Color; 6 6 import java.awt.Component; 7 import java.awt.Dimension;8 7 import java.awt.Graphics; 8 import java.awt.Graphics2D; 9 9 import java.awt.Image; 10 10 import java.awt.Point; … … 16 16 import java.awt.image.ImageObserver; 17 17 import java.util.ArrayList; 18 import java.util.Comparator; 19 import java.util.Enumeration; 20 import java.util.Hashtable; 18 import java.util.HashSet; 19 import java.util.LinkedList; 21 20 import java.util.List; 22 import java.util.LinkedList;23 import java.util.HashSet;24 21 25 22 import javax.swing.AbstractAction; 26 23 import javax.swing.Icon; 24 import javax.swing.JCheckBoxMenuItem; 27 25 import javax.swing.JMenuItem; 28 import javax.swing.JCheckBoxMenuItem;29 26 import javax.swing.JPopupMenu; 30 27 import javax.swing.JSeparator; 31 28 import javax.swing.SwingUtilities; 32 29 30 import org.openstreetmap.gui.jmapviewer.JobDispatcher; 31 import org.openstreetmap.gui.jmapviewer.MemoryTileCache; 32 import org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader; 33 import org.openstreetmap.gui.jmapviewer.Tile; 34 import org.openstreetmap.gui.jmapviewer.interfaces.TileCache; 35 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader; 36 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener; 37 import org.openstreetmap.gui.jmapviewer.interfaces.TileSource; 33 38 import org.openstreetmap.josm.Main; 34 39 import org.openstreetmap.josm.actions.RenameLayerAction; 40 import org.openstreetmap.josm.data.Bounds; 35 41 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 36 42 import org.openstreetmap.josm.data.coor.LatLon; … … 41 47 import org.openstreetmap.josm.gui.layer.Layer; 42 48 import org.openstreetmap.josm.tools.ImageProvider; 43 44 import org.openstreetmap.gui.jmapviewer.*;45 import org.openstreetmap.gui.jmapviewer.interfaces.*;46 import org.openstreetmap.gui.jmapviewer.Tile;47 49 48 50 /** … … 501 503 //int otherZooms[] = {-5, -4, -3, 2, -2, 1, -1}; 502 504 int otherZooms[] = { -1, 1, -2, 2, -3, -4, -5}; 503 int painted = 0; ;505 int painted = 0; 504 506 debug = true; 505 507 for (int zoomOff : otherZooms) { … … 604 606 // The "border" tile tells us the boundaries of where we may 605 607 // draw. It will not be from the zoom level that is being 606 // drawn currently. If drawing the currentZoomLevel, 608 // drawn currently. If drawing the currentZoomLevel, 607 609 // border is null and we draw the entire tile set. 608 610 List<Tile> paintTileImages(Graphics g, TileSet ts, int zoom, Tile border) { … … 616 618 if (img == null) { 617 619 if (debug) 618 out("missed tile: " + tile); 620 out("missed tile: " + tile); 619 621 missedTiles.add(tile); 620 622 continue; … … 808 810 */ 809 811 @Override 810 public void paint(Graphics g, MapView mv) {811 long start = System.currentTimeMillis();812 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 813 //long start = System.currentTimeMillis(); 812 814 LatLon topLeft = mv.getLatLon(0, 0); 813 815 LatLon botRight = mv.getLatLon(mv.getWidth(), mv.getHeight()); 814 Graphics oldg = g;816 Graphics2D oldg = g; 815 817 816 818 if (botRight.lon() == 0.0 || botRight.lat() == 0) { … … 834 836 lastBotRight = botRight; 835 837 bufferImage = mv.createImage(mv.getWidth(), mv.getHeight()); 836 g = bufferImage.getGraphics();838 g = (Graphics2D) bufferImage.getGraphics(); 837 839 838 840 int zoom = currentZoomLevel; … … 844 846 out("too many tiles, decreasing zoom from " + currentZoomLevel); 845 847 if (decreaseZoomLevel()) 846 this.paint(oldg, mv );848 this.paint(oldg, mv, bounds); 847 849 return; 848 850 } … … 852 854 + "), increasing zoom from " + currentZoomLevel); 853 855 if (increaseZoomLevel()) 854 this.paint(oldg, mv );856 this.paint(oldg, mv, bounds); 855 857 return; 856 858 } … … 899 901 this.paintTileText(ts, t, g, mv, currentZoomLevel, t); 900 902 } 901 float fadeBackground = SlippyMapPreferences.getFadeBackground();902 903 oldg.drawImage(bufferImage, 0, 0, null); 903 904 … … 909 910 out("autozoom increase: scale: " + lastImageScale); 910 911 increaseZoomLevel(); 911 this.paint(oldg, mv );912 this.paint(oldg, mv, bounds); 912 913 // If each source image pixel is being squished into > 0.32 913 914 // of a drawn pixels, zoom out. … … 916 917 out("autozoom decrease: scale: " + lastImageScale); 917 918 decreaseZoomLevel(); 918 this.paint(oldg, mv );919 this.paint(oldg, mv, bounds); 919 920 } 920 921 } -
applications/editors/josm/plugins/validator/build.xml
r18524 r18593 27 27 --> 28 28 <property name="commit.message" value="Updated build.xml" /> 29 <property name="plugin.main.version" value="24 14" />29 <property name="plugin.main.version" value="2450" /> 30 30 31 31 -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java
r17175 r18593 4 4 5 5 import java.awt.Component; 6 import java.awt.Graphics ;6 import java.awt.Graphics2D; 7 7 import java.util.Enumeration; 8 8 import java.util.List; … … 15 15 import org.openstreetmap.josm.Main; 16 16 import org.openstreetmap.josm.actions.RenameLayerAction; 17 import org.openstreetmap.josm.data.Bounds; 17 18 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 18 19 import org.openstreetmap.josm.gui.MapView; … … 27 28 /** 28 29 * A layer showing error messages. 29 * 30 * 30 31 * @author frsantos 31 32 */ … … 54 55 @SuppressWarnings("unchecked") 55 56 @Override 56 public void paint(final Graphics g, final MapView mv) {57 public void paint(final Graphics2D g, final MapView mv, Bounds bounds) { 57 58 DefaultMutableTreeNode root = plugin.validationDialog.tree.getRoot(); 58 59 if (root == null || root.getChildCount() == 0) … … 114 115 public Component[] getMenuEntries() { 115 116 return new Component[] { new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)), 116 new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)), 117 new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)), 117 118 new JSeparator(), 118 119 new JMenuItem(new RenameLayerAction(null, this)), new JSeparator(), -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/GridLayer.java
r17351 r18593 4 4 import java.awt.Component; 5 5 import java.awt.Graphics; 6 import java.awt.Graphics2D; 6 7 import java.awt.Point; 7 8 import java.awt.geom.Point2D; … … 13 14 import org.openstreetmap.josm.Main; 14 15 import org.openstreetmap.josm.actions.RenameLayerAction; 16 import org.openstreetmap.josm.data.Bounds; 15 17 import org.openstreetmap.josm.data.coor.EastNorth; 16 18 import org.openstreetmap.josm.data.osm.Node; … … 54 56 */ 55 57 @Override 56 public void paint(final Graphics g, final MapView mv)58 public void paint(final Graphics2D g, final MapView mv, Bounds bounds) 57 59 { 58 60 if( !Main.pref.hasKey(PreferenceEditor.PREF_DEBUG + ".grid") ) -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java
r18514 r18593 1 1 package org.openstreetmap.josm.plugins.validator; 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 2 4 3 5 import java.util.ArrayList; … … 8 10 import javax.swing.JPanel; 9 11 10 import org.openstreetmap.josm.Main;11 12 import org.openstreetmap.josm.command.Command; 12 13 import org.openstreetmap.josm.data.osm.BackreferencedDataSet; … … 19 20 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 20 21 import org.openstreetmap.josm.tools.GBC; 21 import static org.openstreetmap.josm.tools.I18n.tr;22 22 23 23 /** … … 95 95 96 96 /** 97 * Start the test using a given progress monitor 98 * 99 * @param progressMonitor the progress monitor 97 * Start the test using a given progress monitor 98 * 99 * @param progressMonitor the progress monitor 100 100 */ 101 101 public void startTest(ProgressMonitor progressMonitor) { -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateNode.java
r18514 r18593 5 5 import java.awt.geom.Area; 6 6 import java.util.Collection; 7 import java.util.LinkedHashSet; 7 8 import java.util.LinkedList; 8 import java.util.LinkedHashSet;9 9 import java.util.List; 10 10 import java.util.Map; -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java
r18425 r18593 19 19 import org.openstreetmap.josm.data.coor.EastNorth; 20 20 import org.openstreetmap.josm.data.coor.LatLon; 21 import org.openstreetmap.josm.data.osm.BBox; 21 22 import org.openstreetmap.josm.data.osm.DataSet; 22 23 import org.openstreetmap.josm.data.osm.Node; … … 24 25 import org.openstreetmap.josm.data.osm.QuadBuckets; 25 26 import org.openstreetmap.josm.data.osm.Way; 26 import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;27 27 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 28 28 import org.openstreetmap.josm.plugins.validator.PreferenceEditor; … … 75 75 this.ds = Main.main.getCurrentDataSet(); 76 76 this.ds_area = ds.getDataSourceArea(); 77 this.ds.reindexAll(); 78 } 77 } 79 78 80 79 @Override … … 196 195 private class MyWaySegment 197 196 { 198 private Line2D line;199 public Way w;200 public boolean isAbandoned = false;201 public boolean isBoundary = false;202 public boolean highway;203 private double len;197 private final Line2D line; 198 public final Way w; 199 public final boolean isAbandoned; 200 public final boolean isBoundary; 201 public final boolean highway; 202 private final double len; 204 203 private Set<Node> nearbyNodeCache; 205 204 double nearbyNodeCacheDist = -1.0; 206 Node n1;207 Node n2;205 final Node n1; 206 final Node n2; 208 207 209 208 public MyWaySegment(Way w, Node n1, Node n2) … … 368 367 private void addNode(Node n, Set<Node> s) 369 368 { 370 Boolean m = middlenodes.contains(n);371 Boolean e = endnodes.contains(n);372 Boolean eh = endnodes_highway.contains(n);373 Boolean o = othernodes.contains(n);369 boolean m = middlenodes.contains(n); 370 boolean e = endnodes.contains(n); 371 boolean eh = endnodes_highway.contains(n); 372 boolean o = othernodes.contains(n); 374 373 if(!m && !e && !o && !eh) 375 374 s.add(n);
Note:
See TracChangeset
for help on using the changeset viewer.