Changeset 18597 in osm for applications
- Timestamp:
- 2009-11-14T20:01:49+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/livegps
- Property svn:ignore
-
old new 3 3 build.err 4 4 josm-site.xml 5 6 bin
-
- Property svn:ignore
-
applications/editors/josm/plugins/livegps/.classpath
r14057 r18597 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.15"/>4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 5 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 6 <classpathentry kind="output" path="bin"/> -
applications/editors/josm/plugins/livegps/build.xml
r18404 r18597 26 26 <attribute name="Plugin-Description" value="Support live GPS input (moving dot) through a connection to gpsd server."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/LiveGPS"/> 28 <attribute name="Plugin-Mainversion" value="2 323"/>28 <attribute name="Plugin-Mainversion" value="2450"/> 29 29 <attribute name="Plugin-Stage" value="50"/> 30 30 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> -
applications/editors/josm/plugins/livegps/src/livegps/LiveGpsLayer.java
r16945 r18597 4 4 5 5 import java.awt.Color; 6 import java.awt.Graphics ;6 import java.awt.Graphics2D; 7 7 import java.awt.Point; 8 8 import java.beans.PropertyChangeEvent; … … 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.data.Bounds; 16 17 import org.openstreetmap.josm.data.coor.LatLon; 17 18 import org.openstreetmap.josm.data.gpx.GpxData; … … 20 21 import org.openstreetmap.josm.gui.MapView; 21 22 import org.openstreetmap.josm.gui.layer.GpxLayer; 22 import org.openstreetmap.josm.tools.ColorHelper;23 23 24 24 public class LiveGpsLayer extends GpxLayer implements PropertyChangeListener { … … 101 101 } 102 102 103 @Override public void paint(Graphics g, MapView mv)103 @Override public void paint(Graphics2D g, MapView mv, Bounds bounds) 104 104 { 105 105 //System.out.println("in paint"); 106 106 synchronized (LiveGpsLock.class) { 107 107 //System.out.println("in synced paint"); 108 super.paint(g, mv );108 super.paint(g, mv, bounds); 109 109 // int statusHeight = 50; 110 110 // Rectangle mvs = mv.getBounds(); -
applications/editors/josm/plugins/openlayers/build.xml
r16803 r18597 37 37 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 38 38 <attribute name="Plugin-Description" value="Displays an OpenLayers background image" /> 39 <attribute name="Plugin-Mainversion" value=" 1893"/>39 <attribute name="Plugin-Mainversion" value="2450"/> 40 40 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 41 41 </manifest> -
applications/editors/josm/plugins/openlayers/src/org/openstreetmap/josm/plugins/openLayers/OpenLayersLayer.java
r16803 r18597 1 1 package org.openstreetmap.josm.plugins.openLayers; 2 2 3 import java.awt.*; 3 import java.awt.Component; 4 import java.awt.Dimension; 5 import java.awt.Graphics2D; 4 6 import java.beans.PropertyChangeEvent; 5 7 import java.beans.PropertyChangeListener; 6 8 7 import javax.swing.*; 9 import javax.swing.Icon; 10 import javax.swing.JMenuItem; 11 import javax.swing.JSeparator; 8 12 9 13 import org.mozilla.javascript.NativeArray; 10 14 import org.openstreetmap.josm.Main; 11 15 import org.openstreetmap.josm.actions.RenameLayerAction; 16 import org.openstreetmap.josm.data.Bounds; 12 17 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 13 18 import org.openstreetmap.josm.data.coor.LatLon; … … 51 56 */ 52 57 @Override 53 public void paint(Graphics g, MapView mv) {58 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 54 59 setSize(Main.map.mapView.getSize()); 55 60 browser.paint(g); -
applications/editors/josm/plugins/piclayer/build.xml
r18505 r18597 81 81 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 82 82 <attribute name="Plugin-Description" value="This plugin allows to display any picture as a background in the editor and align it with the map."/> 83 <attribute name="Plugin-Mainversion" value="2 393"/>83 <attribute name="Plugin-Mainversion" value="2450"/> 84 84 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 85 85 </manifest> -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
r17327 r18597 37 37 import javax.swing.JSeparator; 38 38 39 import org.openstreetmap.josm.Main; 40 import org.openstreetmap.josm.data.Bounds; 39 41 import org.openstreetmap.josm.data.coor.EastNorth; 40 42 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 41 import org.openstreetmap.josm.Main;42 43 import org.openstreetmap.josm.gui.MapView; 43 44 import org.openstreetmap.josm.gui.layer.Layer; … … 70 71 // Layer icon 71 72 private Icon m_layericon = null; 72 73 73 74 // Keys for saving in Properties 74 75 private final String INITIAL_POS_X = "INITIAL_POS_X"; … … 186 187 187 188 @Override 188 public void paint(Graphics arg0, MapView arg1) {189 190 if ( m_image != null && arg0instanceof Graphics2D) {189 public void paint(Graphics2D g2, MapView mv, Bounds bounds) { 190 191 if ( m_image != null && g2 instanceof Graphics2D) { 191 192 192 193 // Position image at the right graphical place … … 200 201 201 202 // Let's use Graphics 2D 202 Graphics2D g = (Graphics2D) arg0.create();203 Graphics2D g = (Graphics2D)g2.create(); 203 204 // Move 204 205 g.translate( pic_offset_x, pic_offset_y ); … … 294 295 props.put(ANGLE, "" + m_angle); 295 296 } 296 297 297 298 /** 298 299 * Loads calibration data from properties structure -
applications/editors/josm/plugins/routes/build.xml
r18427 r18597 35 35 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 36 36 <attribute name="Plugin-Description" value="Renders routes (bus, hiking trails, bicycle routes, ..). Route types must be defined in routes.xml file in plugin directory"/> 37 <attribute name="Plugin-Mainversion" value="2 388"/>37 <attribute name="Plugin-Mainversion" value="2450"/> 38 38 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 39 39 </manifest> -
applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java
r18427 r18597 3 3 import java.awt.Color; 4 4 import java.awt.Component; 5 import java.awt.Graphics;6 5 import java.awt.Graphics2D; 7 6 import java.awt.Stroke; … … 12 11 13 12 import org.openstreetmap.josm.Main; 13 import org.openstreetmap.josm.data.Bounds; 14 14 import org.openstreetmap.josm.data.osm.DataSet; 15 15 import org.openstreetmap.josm.data.osm.Relation; … … 95 95 96 96 @Override 97 public void paint(Graphics g, MapView mv) {97 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 98 98 99 99 DataSet dataset = Main.main.getCurrentDataSet(); … … 121 121 } 122 122 123 Stroke stroke = ((Graphics2D)g).getStroke();123 Stroke stroke = g.getStroke(); 124 124 Color color = g.getColor(); 125 125 for (ConvertedWay way:pathBuilder.getConvertedWays()) { 126 pathPainter.drawWay(way, mv, (Graphics2D)g);126 pathPainter.drawWay(way, mv, g); 127 127 } 128 ((Graphics2D)g).setStroke(stroke);128 g.setStroke(stroke); 129 129 g.setColor(color); 130 130 } -
applications/editors/josm/plugins/routing/build.xml
r18415 r18597 44 44 <attribute name="Plugin-Description" value="Provides routing capabilities."/> 45 45 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/> 46 <attribute name="Plugin-Mainversion" value="2 381"/>46 <attribute name="Plugin-Mainversion" value="2450"/> 47 47 <attribute name="Plugin-Stage" value="50"/> 48 48 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java
r18415 r18597 46 46 import org.openstreetmap.josm.Main; 47 47 import org.openstreetmap.josm.actions.RenameLayerAction; 48 import org.openstreetmap.josm.data.Bounds; 48 49 import org.openstreetmap.josm.data.osm.Node; 49 50 import org.openstreetmap.josm.data.osm.Way; … … 227 228 */ 228 229 @Override 229 public void paint(Graphics g, MapView mv) {230 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 230 231 boolean isActiveLayer = (mv.getActiveLayer().equals(this)); 231 232 // Get routing nodes (start, middle, end) -
applications/editors/josm/plugins/walkingpapers/.project
r16522 r18597 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <projectDescription> 3 <name> slippymap</name>3 <name>JOSM-walkingpapers</name> 4 4 <comment></comment> 5 5 <projects> -
applications/editors/josm/plugins/walkingpapers/build.xml
r18404 r18597 26 26 <attribute name="Plugin-Description" value="Supports downloading tiled, scanned maps from walking-papers.org. This plugin is still under early development and may be buggy."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/WalkingPapers"/> 28 <attribute name="Plugin-Mainversion" value="2 323"/>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/walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java
r18484 r18597 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.Image; 9 9 import java.awt.Point; … … 30 30 /** 31 31 * Class that displays a slippy map layer. Adapted from SlippyMap plugin for Walking Papers use. 32 * 32 * 33 33 * @author Frederik Ramm <frederik@remote.org> 34 34 * @author LuVar <lubomir.varga@freemap.sk> 35 35 * @author Dave Hansen <dave@sr71.net> 36 * 36 * 37 37 */ 38 38 public class WalkingPapersLayer extends Layer implements ImageObserver { … … 55 55 private String tileUrlTemplate; 56 56 private String walkingPapersId; 57 57 58 58 @SuppressWarnings("serial") 59 59 public WalkingPapersLayer(String id, String tile, Bounds b, int minz, int maxz) { … … 66 66 this.minzoom = minz; this.maxzoom = maxz; 67 67 currentZoomLevel = minz; 68 68 69 69 clearTileStorage(); 70 70 71 71 Layer.listeners.add(new LayerChangeListener() { 72 72 public void activeLayerChange(Layer oldLayer, Layer newLayer) { … … 182 182 */ 183 183 @Override 184 public void paint(Graphics g, MapView mv) {184 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 185 185 LatLon topLeft = mv.getLatLon(0, 0); 186 186 LatLon botRight = mv.getLatLon(mv.getWidth(), mv.getHeight()); 187 Graphics oldg = g;187 Graphics2D oldg = g; 188 188 189 189 if (botRight.lon() == 0.0 || botRight.lat() == 0) { … … 200 200 return; 201 201 } 202 202 203 203 needRedraw = false; 204 204 lastTopLeft = topLeft; 205 205 lastBotRight = botRight; 206 206 bufferImage = mv.createImage(mv.getWidth(), mv.getHeight()); 207 g = bufferImage.getGraphics();207 g = (Graphics2D) bufferImage.getGraphics(); 208 208 209 209 if (!LatLon.isValidLat(topLeft.lat()) || … … 228 228 viewportMaxY = tmp; 229 229 } 230 230 231 231 if (viewportMaxX-viewportMinX > 18) return; 232 232 if (viewportMaxY-viewportMinY > 18) return; … … 255 255 if (tile == null) { 256 256 // check if tile is in range 257 Bounds tileBounds = new Bounds(new LatLon(tileYToLat(y+1), tileXToLon(x)), 257 Bounds tileBounds = new Bounds(new LatLon(tileYToLat(y+1), tileXToLon(x)), 258 258 new LatLon(tileYToLat(y), tileXToLon(x+1))); 259 259 if (!tileBounds.asRect().intersects(printBounds.asRect())) continue; … … 275 275 } 276 276 } 277 277 278 278 if (count == 0) 279 279 { … … 283 283 284 284 oldg.drawImage(bufferImage, 0, 0, null); 285 285 286 286 if (imageScale != null) { 287 287 // If each source image pixel is being stretched into > 3 … … 289 289 if (imageScale > 3) { 290 290 increaseZoomLevel(); 291 this.paint(oldg, mv );291 this.paint(oldg, mv, bounds); 292 292 } 293 293 … … 296 296 else if (imageScale < 0.32) { 297 297 decreaseZoomLevel(); 298 this.paint(oldg, mv );299 } 300 } 298 this.paint(oldg, mv, bounds); 299 } 300 } 301 301 }// end of paint metod 302 302 … … 310 310 } 311 311 } 312 312 313 313 if (tilex == -1) return null; 314 314 315 315 for (int y = viewportMinY; y <= viewportMaxY; y++) { 316 316 if (pixelpos[0][y - viewportMinY + 1].y > py) { … … 319 319 } 320 320 } 321 321 322 322 if (tiley == -1) return null; 323 323 … … 411 411 Main.pref.listener.remove(WalkingPapersLayer.this); 412 412 } 413 413 414 414 public String getWalkingPapersId() { 415 415 return walkingPapersId; 416 416 } 417 417 418 418 public URL formatImageUrl(int x, int y, int z) { 419 419 String urlstr = tileUrlTemplate. … … 427 427 } 428 428 } 429 429 430 430 } -
applications/editors/josm/plugins/wmsplugin/.classpath
r5787 r18597 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="lib" path="C:/prj.ht/josm-snapshot-467.jar"/>5 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 6 <classpathentry kind="output" path="build"/> 7 7 </classpath> -
applications/editors/josm/plugins/wmsplugin/build.xml
r18404 r18597 32 32 <property name="ant.build.javac.target" value="1.5"/> 33 33 <property name="commit.message" value="fixing JOSM issue #3186" /> 34 <property name="josm.reference.release" value="2 323" />34 <property name="josm.reference.release" value="2450" /> 35 35 36 36 <target name="init"> -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
r17817 r18597 5 5 import java.awt.Component; 6 6 import java.awt.Graphics; 7 import java.awt.Graphics2D; 7 8 import java.awt.Toolkit; 8 9 import java.awt.event.ActionEvent; … … 27 28 import org.openstreetmap.josm.actions.DiskAccessAction; 28 29 import org.openstreetmap.josm.actions.SaveActionBase; 30 import org.openstreetmap.josm.data.Bounds; 29 31 import org.openstreetmap.josm.data.ProjectionBounds; 30 32 import org.openstreetmap.josm.data.coor.EastNorth; … … 69 71 /** set to true if the user confirmed to use an potentially invalid WMS base url */ 70 72 private boolean isInvalidUrlConfirmed = false; 71 73 72 74 public WMSLayer() { 73 75 this(tr("Blank Layer"), null, null); … … 79 81 super(name); 80 82 alphaChannel.setSelected(Main.pref.getBoolean("wmsplugin.alpha_channel")); 81 setBackgroundLayer(true); /* set global background variable */ 83 setBackgroundLayer(true); /* set global background variable */ 82 84 initializeImages(); 83 85 this.baseURL = baseURL; … … 112 114 113 115 @Override 114 public void destroy() { 116 public void destroy() { 115 117 try { 116 118 executor.shutdownNow(); … … 163 165 } 164 166 165 @Override public void paint(Graphics g, final MapView mv) {167 @Override public void paint(Graphics2D g, final MapView mv, Bounds bounds) { 166 168 if(baseURL == null) return; 167 169 if (usesInvalidUrl && !isInvalidUrlConfirmed) return; … … 191 193 + "This is likely to lead to invalid WMS request. You should check your<br>" 192 194 + "preference settings.<br>" 193 + "Do you want to fetch WMS tiles anyway?", 195 + "Do you want to fetch WMS tiles anyway?", 194 196 url); 195 197 String [] options = new String[] { … … 198 200 }; 199 201 int ret = JOptionPane.showOptionDialog( 200 Main.parent, 202 Main.parent, 201 203 msg, 202 204 tr("Invalid URL?"), 203 JOptionPane.YES_NO_OPTION, 204 JOptionPane.WARNING_MESSAGE, 205 null, 205 JOptionPane.YES_NO_OPTION, 206 JOptionPane.WARNING_MESSAGE, 207 null, 206 208 options, options[1] 207 209 ); … … 228 230 ); 229 231 return; 230 } 231 232 } 233 232 234 for(int x = bminx; x<bmaxx; ++x) { 233 235 for(int y = bminy; y<bmaxy; ++y){ … … 352 354 } 353 355 } 354 356 355 357 public class SaveWmsAction extends AbstractAction { 356 358 public SaveWmsAction() {
Note:
See TracChangeset
for help on using the changeset viewer.