Changeset 33558 in osm for applications/editors/josm
- Timestamp:
- 2017-08-27T19:12:12+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanVecTile.java
r33557 r33558 16 16 import java.util.zip.ZipFile; 17 17 18 import org.openstreetmap.josm.Main;19 18 import org.openstreetmap.josm.data.Bounds; 20 19 import org.openstreetmap.josm.data.coor.LatLon; 20 import org.openstreetmap.josm.data.osm.DataSet.UploadPolicy; 21 import org.openstreetmap.josm.gui.MainApplication; 21 22 import org.openstreetmap.josm.gui.MapView; 22 23 import org.openstreetmap.josm.gui.io.importexport.OsmImporter; … … 24 25 import org.openstreetmap.josm.io.CachedFile; 25 26 import org.openstreetmap.josm.io.IllegalDataException; 27 import org.openstreetmap.josm.tools.Logging; 26 28 27 29 class CanVecTile { … … 190 192 private ZipFile openZip() throws IOException { 191 193 File downloadPath = new File(layer.plugin.getPluginDir() + File.separator); 192 if (!downloadPath.mkdir() && Main.isDebugEnabled()) {193 Main.debug("Unable to create directory: "+downloadPath);194 if (!downloadPath.mkdir() && Logging.isDebugEnabled()) { 195 Logging.debug("Unable to create directory: "+downloadPath); 194 196 } 195 197 CachedFile tileZip = new CachedFile(getDownloadUrl()).setDestDir(downloadPath.toString()); … … 203 205 zipFile = openZip(); 204 206 } catch (IOException e) { 205 Main.error(e);207 Logging.error(e); 206 208 return; 207 209 } … … 230 232 OsmImporter importer = new OsmImporter(); 231 233 OsmImporterData temp = importer.loadLayer(rawtile, null, entry.getName(), null); 232 Main .worker.submit(temp.getPostLayerTask());233 Main .getLayerManager().addLayer(temp.getLayer());234 temp.getLayer().data.setUpload Discouraged(false);234 MainApplication.worker.submit(temp.getPostLayerTask()); 235 MainApplication.getLayerManager().addLayer(temp.getLayer()); 236 temp.getLayer().data.setUploadPolicy(UploadPolicy.NORMAL); 235 237 } 236 238 } 237 239 } catch (IOException | IllegalDataException e) { 238 Main.error(e);240 Logging.error(e); 239 241 return; 240 242 } -
applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanvecHelper.java
r32968 r33558 2 2 package org.openstreetmap.josm.plugins.canvec_helper; 3 3 4 import org.openstreetmap.josm. Main;4 import org.openstreetmap.josm.gui.MainApplication; 5 5 import org.openstreetmap.josm.plugins.Plugin; 6 6 import org.openstreetmap.josm.plugins.PluginInformation; … … 17 17 public CanvecHelper(PluginInformation info) { 18 18 super(info); 19 Main .main.menu.imagerySubMenu.add(new CanvecHelperAction(this));19 MainApplication.getMenu().imagerySubMenu.add(new CanvecHelperAction(this)); 20 20 } 21 21 } -
applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanvecHelperAction.java
r32968 r33558 2 2 package org.openstreetmap.josm.plugins.canvec_helper; 3 3 4 import org.openstreetmap.josm.Main;5 4 import org.openstreetmap.josm.actions.JosmAction; 5 import org.openstreetmap.josm.gui.MainApplication; 6 6 7 7 class CanvecHelperAction extends JosmAction { … … 14 14 @Override 15 15 public void actionPerformed(java.awt.event.ActionEvent action) { 16 Main .getLayerManager().addLayer(new CanvecLayer("canvec tile helper", parentTemp));16 MainApplication.getLayerManager().addLayer(new CanvecLayer("canvec tile helper", parentTemp)); 17 17 } 18 18 } -
applications/editors/josm/plugins/canvec_helper/src/org/openstreetmap/josm/plugins/canvec_helper/CanvecLayer.java
r32969 r33558 26 26 import javax.swing.JMenuItem; 27 27 28 import org.openstreetmap.josm.Main;29 28 import org.openstreetmap.josm.data.Bounds; 30 29 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; … … 34 33 import org.openstreetmap.josm.gui.layer.Layer; 35 34 import org.openstreetmap.josm.io.CachedFile; 35 import org.openstreetmap.josm.tools.Logging; 36 36 37 37 // most of the layout was copied from the openstreetbugs plugin to get things started … … 72 72 lastCell = cell; 73 73 } else if (!line.contains("Metadata.txt")) { 74 Main.warn("bad line '" + line + "'\n");74 Logging.warn("bad line '" + line + "'\n"); 75 75 } 76 76 } … … 78 78 if (tile.isValid()) tiles.add(tile); 79 79 80 if ( Main.isDebugEnabled()) {80 if (Logging.isDebugEnabled()) { 81 81 long end = System.currentTimeMillis(); 82 Main.debug((end-start)+"ms spent");82 Logging.debug((end-start)+"ms spent"); 83 83 } 84 84 } catch (IOException e) { 85 Main.error("exception getting index");86 Main.error(e);85 Logging.error("exception getting index"); 86 Logging.error(e); 87 87 } 88 88 }
Note:
See TracChangeset
for help on using the changeset viewer.