Changeset 19681 in osm for applications/editors/josm


Ignore:
Timestamp:
2010-01-30T20:10:15+01:00 (15 years ago)
Author:
jttt
Message:

Adapted for JOSM r2907

Location:
applications/editors/josm/plugins
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/dataimport/build.xml

    r19503 r19681  
    3232        <property name="commit.message" value="Changed constructor signature, updated build.xml" />
    3333        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    34         <property name="plugin.main.version" value="2851" />
     34        <property name="plugin.main.version" value="2907" />
    3535
    3636        <!--
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/TangoGPS.java

    r19503 r19681  
    1313import java.io.InputStreamReader;
    1414import java.util.ArrayList;
     15import java.util.Collections;
     16import java.util.List;
    1517
    1618import javax.swing.JOptionPane;
     
    2022import org.openstreetmap.josm.data.coor.LatLon;
    2123import org.openstreetmap.josm.data.gpx.GpxData;
    22 import org.openstreetmap.josm.data.gpx.GpxTrack;
     24import org.openstreetmap.josm.data.gpx.ImmutableGpxTrackSegment;
     25import org.openstreetmap.josm.data.gpx.SingleSegmentGpxTrack;
    2326import org.openstreetmap.josm.data.gpx.WayPoint;
    2427import org.openstreetmap.josm.gui.layer.GpxLayer;
     
    4649        public void importData(File file, ProgressMonitor progressMonitor) throws IOException {
    4750                // create the data tree
    48                 GpxData data = new GpxData();
    49                 GpxTrack currentTrack = new GpxTrack();
    50                 data.tracks.add(currentTrack);
    51                 ArrayList<WayPoint> currentTrackSeg = new ArrayList<WayPoint>();
     51                List<WayPoint> currentTrackSeg = new ArrayList<WayPoint>();
    5252
    5353                int imported = 0;
     
    7979                        failure = failure - imported;
    8080                        if(imported > 0) {
    81                                 currentTrack.trackSegs.add(currentTrackSeg);
     81                                GpxData data = new GpxData();
     82                                data.tracks.add(new SingleSegmentGpxTrack(new ImmutableGpxTrackSegment(currentTrackSeg), Collections.<String, Object>emptyMap()));
    8283                                data.recalculateBounds();
    8384                                data.storageFile = file;
  • applications/editors/josm/plugins/dataimport/src/org/openstreetmap/josm/plugins/dataimport/io/Tcx.java

    r19503 r19681  
    88import java.util.ArrayList;
    99import java.util.Collection;
     10import java.util.Collections;
    1011
    1112import javax.xml.bind.JAXBContext;
     
    1920import org.openstreetmap.josm.data.coor.LatLon;
    2021import org.openstreetmap.josm.data.gpx.GpxData;
    21 import org.openstreetmap.josm.data.gpx.GpxTrack;
     22import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
    2223import org.openstreetmap.josm.data.gpx.WayPoint;
    2324import org.openstreetmap.josm.gui.layer.GpxLayer;
     
    159160                            XMLGregorianCalendar startTime = activityLap
    160161                                    .getStartTime();
    161                             GpxTrack currentTrack = new GpxTrack();
    162                             gpxData.tracks.add(currentTrack);
     162                            Collection<Collection<WayPoint>> currentTrack = new ArrayList<Collection<WayPoint>>();
    163163                            for (TrackT track : activityLap.getTrack()) {
    164164                                if (track.getTrackpoint() != null) {
    165165                                    Collection<WayPoint> currentTrackSeg = new ArrayList<WayPoint>();
    166                                     currentTrack.trackSegs.add(currentTrackSeg);
     166                                    currentTrack.add(currentTrackSeg);
    167167                                    for (TrackpointT tp :
    168168                                           track.getTrackpoint()) {
     
    182182                                }
    183183                            }
     184                            gpxData.tracks.add(new ImmutableGpxTrack(currentTrack, Collections.<String, Object>emptyMap()));
    184185                        }
    185186                    }
     
    197198            for (CourseT course : tcd.getCourses().getCourse()) {
    198199                if (course.getTrack() != null) {
    199                     GpxTrack currentTrack = new GpxTrack();
    200                     gpxData.tracks.add(currentTrack);
     200                    Collection<Collection<WayPoint>> currentTrack = new ArrayList<Collection<WayPoint>>();
    201201                    for (TrackT track : course.getTrack()) {
    202202                        if (track.getTrackpoint() != null) {
    203203                            Collection<WayPoint> currentTrackSeg = new ArrayList<WayPoint>();
    204                             currentTrack.trackSegs.add(currentTrackSeg);
     204                            currentTrack.add(currentTrackSeg);
    205205                            for (TrackpointT tp : track.getTrackpoint()) {
    206206                                WayPoint waypt = convertPoint(tp);
     
    212212                        }
    213213                    }
     214                    gpxData.tracks.add(new ImmutableGpxTrack(currentTrack, Collections.<String, Object>emptyMap()));
    214215                }
    215216            }
  • applications/editors/josm/plugins/globalsat/build.xml

    r19436 r19681  
    3333        <property name="commit.message" value="Changed constructor signature of plugin main class" />
    3434        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    35         <property name="plugin.main.version" value="2830" />
     35        <property name="plugin.main.version" value="2907" />
    3636
    3737        <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
  • applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java

    r16585 r19681  
    1717import java.util.ArrayList;
    1818import java.util.Collection;
     19import java.util.Collections;
    1920import java.util.List;
    2021
     
    2627import org.openstreetmap.josm.data.coor.LatLon;
    2728import org.openstreetmap.josm.data.gpx.GpxData;
    28 import org.openstreetmap.josm.data.gpx.GpxTrack;
     29import org.openstreetmap.josm.data.gpx.ImmutableGpxTrackSegment;
     30import org.openstreetmap.josm.data.gpx.SingleSegmentGpxTrack;
    2931import org.openstreetmap.josm.data.gpx.WayPoint;
    3032import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    148150                if(gpsRecList.size() > 0){
    149151                        GpsRec last = null;
    150                         GpxTrack trk = new GpxTrack();
     152                        result = new GpxData();
    151153                        Collection<WayPoint> seg = new ArrayList<WayPoint>(100);
    152                         result = new GpxData();
    153                         result.tracks.add(trk);
    154                         trk.trackSegs.add(seg);
    155154                        for(GpsRec r:gpsRecList){
    156155                                if(cancelled){
     
    166165                                progressMonitor.worked(1);
    167166                        }
     167                        result.tracks.add(new SingleSegmentGpxTrack(new ImmutableGpxTrackSegment(seg), Collections.<String, Object>emptyMap()));
    168168                }
    169169                return result;
  • applications/editors/josm/plugins/measurement/build.xml

    r19450 r19681  
    2828
    2929        <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
    30         <property name="plugin.main.version" value="2830" />
     30        <property name="plugin.main.version" value="2907" />
    3131
    3232
  • applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java

    r18595 r19681  
    3232import org.openstreetmap.josm.data.coor.LatLon;
    3333import org.openstreetmap.josm.data.gpx.GpxTrack;
     34import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
    3435import org.openstreetmap.josm.data.gpx.WayPoint;
    3536import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     
    316317
    317318                for (GpxTrack trk : gpx.data.tracks) {
    318                     for (Collection<WayPoint> trkseg : trk.trackSegs) {
    319                         for(WayPoint p: trkseg){
     319                    for (GpxTrackSegment trkseg : trk.getSegments()) {
     320                        for(WayPoint p: trkseg.getWayPoints()){
    320321                            points.add(p);
    321322                        }
  • applications/editors/josm/plugins/surveyor/build.xml

    r19479 r19681  
    3333        <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
    3434        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    35         <property name="plugin.main.version" value="2830" />
     35        <property name="plugin.main.version" value="2907" />
    3636
    3737
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveEditLayerTimerTask.java

    r18490 r19681  
    1414
    1515import javax.swing.JOptionPane;
    16 
    17 import livegps.LiveGpsLock;
    1816
    1917import org.openstreetmap.josm.Main;
     
    5351            File tmpFile = new File(file.getAbsoluteFile()+".tmp");
    5452            System.out.println("AutoSaving osm data to file " + file.getAbsolutePath());
    55             synchronized(LiveGpsLock.class) {
     53            synchronized(SurveyorLock.class) {
    5654                OsmWriter w = new OsmWriter(new PrintWriter(new FileOutputStream(tmpFile)), false, dataset.getVersion());
    5755                w.header();
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveGpsLayerTimerTask.java

    r13497 r19681  
    1515
    1616import javax.swing.JOptionPane;
    17 
    18 import livegps.LiveGpsLock;
    1917
    2018import org.openstreetmap.josm.Main;
     
    7674            PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(tmpFile)));
    7775            GpxWriter gpxWriter = new GpxWriter(out);
    78             synchronized(LiveGpsLock.class) {
    79                 gpxWriter.write(gpsLayer.data);
    80             }
     76            gpxWriter.write(gpsLayer.data);
    8177            tmpFile.renameTo(file);
    8278        } catch (IOException ioExc) {
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetNodeAction.java

    r19211 r19681  
    1010import java.util.Map.Entry;
    1111
    12 import livegps.LiveGpsLock;
    13 
    1412import org.dinopolis.util.collection.Tuple;
    1513import org.openstreetmap.josm.Main;
     
    2018import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
    2119import at.dallermassl.josm.plugin.surveyor.SurveyorAction;
     20import at.dallermassl.josm.plugin.surveyor.SurveyorLock;
    2221
    2322/**
     
    6968            node.put(entry.getKey(), entry.getValue());
    7069        }
    71         synchronized(LiveGpsLock.class) {
     70        synchronized(SurveyorLock.class) {
    7271            DataSet ds = Main.main.getCurrentDataSet();
    7372            if(ds != null)
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java

    r19211 r19681  
    1212
    1313import livegps.LiveGpsLayer;
    14 import livegps.LiveGpsLock;
    1514
    1615import org.openstreetmap.josm.Main;
     
    2423
    2524import at.dallermassl.josm.plugin.surveyor.GpsActionEvent;
     25import at.dallermassl.josm.plugin.surveyor.SurveyorLock;
    2626import at.dallermassl.josm.plugin.surveyor.SurveyorPlugin;
    2727import at.dallermassl.josm.plugin.surveyor.action.gui.WaypointDialog;
     
    8686        if(iconName != null)
    8787            waypoint.attr.put("sym", iconName);
    88         synchronized(LiveGpsLock.class) {
     88        synchronized(SurveyorLock.class) {
    8989            //layer.data.add(new Marker(event.getCoordinates(), markerText, iconName));
    9090            layer.data.add(new Marker(event.getCoordinates(), markerText, iconName, null, -1.0, 0.0));
Note: See TracChangeset for help on using the changeset viewer.