Changeset 16382 in osm for applications/editors/josm
- Timestamp:
- 2009-07-08T16:30:54+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 1 deleted
- 5 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/build.xml
r16177 r16382 33 33 <ant antfile="build.xml" target="dist" dir="tagging-preset-tester"/> 34 34 <ant antfile="build.xml" target="dist" dir="tageditor"/> 35 <ant antfile="build.xml" target="dist" dir="tcxplugin"/>36 35 <ant antfile="build.xml" target="dist" dir="terracer"/> 37 36 <ant antfile="build.xml" target="dist" dir="usertools"/> … … 74 73 <ant antfile="build.xml" target="clean" dir="tagging-preset-tester"/> 75 74 <ant antfile="build.xml" target="clean" dir="tageditor"/> 76 <ant antfile="build.xml" target="clean" dir="tcxplugin"/>77 75 <ant antfile="build.xml" target="clean" dir="terracer"/> 78 76 <ant antfile="build.xml" target="clean" dir="usertools"/> -
applications/editors/josm/plugins/dataimport/.classpath
r16176 r16382 3 3 <classpathentry kind="src" path="src"/> 4 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 <classpathentry exported="true" kind="lib" path="lib/jsr173-1.0_api.jar"/> 6 <classpathentry exported="true" kind="lib" path="lib/jaxb-impl.jar"/> 7 <classpathentry exported="true" kind="lib" path="lib/jaxb-api.jar"/> 8 <classpathentry exported="true" kind="lib" path="lib/activation.jar"/> 5 9 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 6 10 <classpathentry kind="output" path="bin"/> -
applications/editors/josm/plugins/dataimport/README
r16176 r16382 1 README 1 README 2 2 ====== 3 3 4 4 This plugin adds additional file formats into file open dialog. 5 5 6 Following file formats aresupport:6 Following file formats get support: 7 7 8 8 - TangoGPS 9 - Garmin Trainings Center TCX -
applications/editors/josm/plugins/dataimport/build.xml
r16176 r16382 51 51 <target name="compile" depends="init"> 52 52 <echo message="compiling sources for ${plugin.jar} ... "/> 53 <javac srcdir="src" classpath="${josm}"debug="true" destdir="${plugin.build.dir}">53 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}"> 54 54 <compilerarg value="-Xlint:deprecation"/> 55 55 <compilerarg value="-Xlint:unchecked"/> 56 <classpath> 57 <pathelement location="${josm}"/> 58 <fileset dir="lib"> 59 <include name="**/*.jar"/> 60 </fileset> 61 </classpath> 56 62 </javac> 57 63 </target> … … 79 85 ************************************************ 80 86 --> 81 <manifest> 87 <zipfileset src="lib/jsr173-1.0_api.jar" includes="**/*.class"/> 88 <zipfileset src="lib/jaxb-api.jar" includes="**/*.class"/> 89 <zipfileset src="lib/jaxb-api.jar" includes="**/*.properties"/> 90 91 <zipfileset src="lib/jaxb-impl.jar" includes="**/*.class"/> 92 93 <manifest> 82 94 <attribute name="Author" value="Dieter Muecke"/> 83 95 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.DataImport"/> -
applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/io/Tcx.java
r16362 r16382 2 2 package org.openstreetmap.josm.io; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.io.File; 7 import java.io.IOException; 5 8 import java.util.ArrayList; 6 9 import java.util.Collection; … … 12 15 import javax.xml.datatype.XMLGregorianCalendar; 13 16 17 import org.openstreetmap.josm.Main; 18 import org.openstreetmap.josm.actions.ExtensionFileFilter; 14 19 import org.openstreetmap.josm.data.coor.LatLon; 15 20 import org.openstreetmap.josm.data.gpx.GpxData; 16 21 import org.openstreetmap.josm.data.gpx.GpxTrack; 17 22 import org.openstreetmap.josm.data.gpx.WayPoint; 23 import org.openstreetmap.josm.gui.layer.GpxLayer; 24 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 18 25 import org.openstreetmap.josm.io.tcx.ActivityLapT; 19 26 import org.openstreetmap.josm.io.tcx.ActivityT; … … 23 30 import org.openstreetmap.josm.io.tcx.TrackpointT; 24 31 import org.openstreetmap.josm.io.tcx.TrainingCenterDatabaseT; 32 25 33 26 34 /** … … 43 51 * to the endorsed directory (create it if necessary) of your JRE. Usually it is something like this: 44 52 * \<program files>\Java\jre<java version>\lib\endorsed 45 * 53 * 46 54 * @author adrian <as@nitegate.de> 47 * 55 * 48 56 */ 49 public class Tcx Reader {50 51 private File tcxFile; 57 public class Tcx extends FileImporter { 58 59 //private File tcxFile; 52 60 53 61 private GpxData gpxData; 54 62 63 64 public Tcx() { 65 super(new ExtensionFileFilter("tcx", "tcx",tr("TCX Files (*.tcx)"))); 66 } 67 55 68 /** 56 69 * @param tcxFile 57 70 */ 58 public TcxReader(File tcxFile) { 59 super(); 60 this.tcxFile = tcxFile; 61 parseFile(); 62 } 63 64 /** 65 * 66 */ 67 @SuppressWarnings("unchecked") private void parseFile() { 71 @Override 72 public void importData(File tcxFile) throws IOException { 73 //this.tcxFile = tcxFile; 74 parseFile(tcxFile); 75 76 GpxData gpxData = getGpxData(); 77 gpxData.storageFile = tcxFile; 78 GpxLayer gpxLayer = new GpxLayer(gpxData, tcxFile.getName()); 79 Main.main.addLayer(gpxLayer); 80 if (Main.pref.getBoolean("marker.makeautomarkers", true)) 81 { 82 MarkerLayer ml = new MarkerLayer(gpxData, tr("Markers from {0}", tcxFile.getName()), tcxFile, gpxLayer); 83 if (ml.data.size() > 0) 84 { 85 Main.main.addLayer(ml); 86 } 87 } 88 89 } 90 91 /** 92 * 93 */ 94 @SuppressWarnings("unchecked") private void parseFile(File tcxFile) { 68 95 try { 69 96 JAXBContext jc = JAXBContext … … 96 123 PositionT p = tp.getPosition(); 97 124 98 if (p == null) {125 if (p == null) 99 126 // If the TrackPointT lacks a position, return null. 100 127 return null; 101 }102 128 103 129 WayPoint waypt = new WayPoint(new LatLon(p.getLatitudeDegrees(), … … 189 215 } 190 216 191 p ublicGpxData getGpxData() {217 private GpxData getGpxData() { 192 218 return gpxData; 193 219 } -
applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/DataImport.java
r16176 r16382 4 4 package org.openstreetmap.josm.plugins; 5 5 6 import java.io.IOException; 7 6 8 import org.openstreetmap.josm.actions.ExtensionFileFilter; 7 9 import org.openstreetmap.josm.io.TangoGPS; 10 import org.openstreetmap.josm.io.Tcx; 8 11 9 12 public class DataImport extends Plugin { 10 13 11 /** 12 * Add new File import filter into open dialog 13 */ 14 public DataImport() { 15 super(); 16 ExtensionFileFilter.importers.add(new TangoGPS()); 17 } 14 /** 15 * Add new File import filter into open dialog 16 */ 17 public DataImport() throws IOException{ 18 super(); 19 20 ExtensionFileFilter.importers.add(new TangoGPS()); 21 ExtensionFileFilter.importers.add(new Tcx()); 22 } 23 18 24 19 25 }
Note:
See TracChangeset
for help on using the changeset viewer.