Changeset 31746 in osm for applications/editors/josm/plugins
- Timestamp:
- 2015-11-15T15:20:17+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/ImportImagePlugin
- Files:
-
- 50 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ImportImagePlugin/.classpath
r30416 r31746 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="src" path="test/unit"/> 4 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> 5 6 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> … … 7 8 <classpathentry combineaccessrules="false" kind="src" path="/JOSM-jts"/> 8 9 <classpathentry combineaccessrules="false" kind="src" path="/JOSM-log4j"/> 10 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> 9 11 <classpathentry kind="output" path="bin"/> 10 12 </classpath> -
applications/editors/josm/plugins/ImportImagePlugin/build.xml
r31114 r31746 17 17 <import file="../build-common.xml"/> 18 18 19 <!-- 20 ********************************************************** 21 ** compile - complies the source tree 22 ********************************************************** 23 --> 24 <target name="compile" depends="init"> 25 <echo message="compiling sources for ${plugin.jar} ... "/> 26 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}" includeantruntime="false"> 27 <classpath> 28 <pathelement location="${josm}"/> 29 <fileset dir="../log4j/lib"> 30 <include name="**/*.jar"/> 31 </fileset> 32 <fileset dir="../jts/lib"> 33 <include name="**/*.jar"/> 34 </fileset> 35 <fileset dir="../geotools/lib"> 36 <include name="**/*.jar"/> 37 </fileset> 38 </classpath> 39 <compilerarg value="-Xlint:deprecation"/> 40 <compilerarg value="-Xlint:unchecked"/> 41 </javac> 42 </target> 43 19 <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}"> 20 <include name="log4j.jar"/> 21 <include name="jts.jar"/> 22 <include name="geotools.jar"/> 23 </fileset> 24 44 25 </project> -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
r31114 r31746 111 111 if (val == 3) { 112 112 logger.debug("No projection and user declined un-projected use"); 113 throw new LayerCreationCanc ledException();113 throw new LayerCreationCanceledException(); 114 114 } 115 115 CoordinateReferenceSystem src = null; … … 327 327 layerProps.setVisible(true); 328 328 } 329 330 } 331 332 /** 333 * Exception which represents that the layer creation has been cancled by the 334 * user. 335 * 336 */ 337 class LayerCreationCancledException extends IOException{ 329 } 330 331 /** 332 * Exception which represents that the layer creation has been canceled by the user. 333 */ 334 class LayerCreationCanceledException extends IOException{ 338 335 } 339 336 -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImageFileImporter.java
r31114 r31746 14 14 import org.openstreetmap.josm.io.IllegalDataException; 15 15 import org.openstreetmap.josm.io.FileImporter; 16 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanc ledException;16 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException; 17 17 18 18 /** … … 47 47 try { 48 48 layer = new ImageLayer(file); 49 } catch (LayerCreationCanc ledException e) {49 } catch (LayerCreationCanceledException e) { 50 50 // if user decides that layer should not be created just return. 51 51 continue; -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImportImagePlugin.java
r30738 r31746 91 91 loadFileAction = new LoadImageAction(); 92 92 loadFileAction.setEnabled(true); 93 MainMenu.add(Main.main.menu.imagerySubMenu, loadFileAction); 94 95 // add menu entries 96 //Main.main.menu.fileMenu.insert(loadFileAction, 8); 97 98 //Main.main.menu.fileMenu.insertSeparator(9); 93 if (Main.main != null) { 94 MainMenu.add(Main.main.menu.imagerySubMenu, loadFileAction); 95 96 // add menu entries 97 //Main.main.menu.fileMenu.insert(loadFileAction, 8); 98 //Main.main.menu.fileMenu.insertSeparator(9); 99 } 99 100 100 101 ExtensionFileFilter.importers.add(new ImportImageFileImporter()); -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java
r31114 r31746 12 12 import org.openstreetmap.josm.actions.JosmAction; 13 13 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 14 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanc ledException;14 import org.openstreetmap.josm.plugins.ImportImagePlugin.ImageLayer.LayerCreationCanceledException; 15 15 16 16 … … 46 46 try { 47 47 layer = new ImageLayer(fc.getSelectedFile()); 48 } catch (LayerCreationCanc ledException e) {48 } catch (LayerCreationCanceledException e) { 49 49 // if user decides that layer should not be created just return. 50 50 return; -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java
r30738 r31746 154 154 155 155 BufferedImage img = ImageIO.read(file); 156 if (img == null) { 157 throw new IOException("Cannot read image file " + file.getAbsolutePath()); 158 } 156 159 157 160 // create Envelope … … 336 339 { 337 340 GridCoverage2D coverage = null; 338 Hints hints = new Hints( );341 Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, true); 339 342 if(refSys != null) 340 343 { 341 344 hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, refSys); 342 343 } 344 // dont't use the EPSG-Factory because of wrong behaviour 345 hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true)); 345 } 346 // don't use the EPSG-Factory because of wrong behaviour 347 //hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true)); 346 348 347 349 GeoTiffReader reader = new GeoTiffReader(file, hints); … … 352 354 } 353 355 354 355 /** 356 * Loads CRS data from an EPSG database and creates descrptions for each one. 356 /** 357 * Loads CRS data from an EPSG database and creates descriptions for each one. 357 358 * 358 359 * @param pluginProps
Note:
See TracChangeset
for help on using the changeset viewer.