Ignore:
Timestamp:
2011-08-07T09:08:29+02:00 (13 years ago)
Author:
jttt
Message:

Allow to specify custom pattern for marker text labels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r4230 r4282  
    3232import org.openstreetmap.josm.data.coor.LatLon;
    3333import org.openstreetmap.josm.data.gpx.GpxData;
    34 import org.openstreetmap.josm.data.gpx.GpxLink;
    3534import org.openstreetmap.josm.data.gpx.WayPoint;
    3635import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     
    7271        this.fromLayer = fromLayer;
    7372        double firstTime = -1.0;
    74         String lastLinkedFile = "";
    7573
    7674        for (WayPoint wpt : indata.waypoints) {
    77             /* calculate time differences in waypoints */
    7875            double time = wpt.time;
    79             boolean wpt_has_link = wpt.attr.containsKey(GpxData.META_LINKS);
    80             if (firstTime < 0 && wpt_has_link) {
     76            if (firstTime < 0) {
    8177                firstTime = time;
    82                 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get(GpxData.META_LINKS)) {
    83                     lastLinkedFile = oneLink.uri;
    84                     break;
    85                 }
    86             }
    87             if (wpt_has_link) {
    88                 for (GpxLink oneLink : (Collection<GpxLink>) wpt.attr.get(GpxData.META_LINKS)) {
    89                     if (!oneLink.uri.equals(lastLinkedFile)) {
    90                         firstTime = time;
    91                     }
    92                     lastLinkedFile = oneLink.uri;
    93                     break;
    94                 }
    9578            }
    9679            Marker m = Marker.createMarker(wpt, indata.storageFile, this, time, time - firstTime);
     
    274257                    tr("Error"),
    275258                    JOptionPane.ERROR_MESSAGE
    276             );
     259                    );
    277260            return null;
    278261        }
    279262
    280263        // make our new marker
    281         AudioMarker newAudioMarker = AudioMarker.create(coor,
    282                 AudioMarker.inventName(offset), AudioPlayer.url().toString(), this, time, offset);
     264        AudioMarker newAudioMarker = new AudioMarker(coor,
     265                null, AudioPlayer.url(), this, time, offset);
    283266
    284267        // insert it at the right place in a copy the collection
     
    425408                        tr("Warning"),
    426409                        JOptionPane.WARNING_MESSAGE
    427                 );
     410                        );
    428411                return;
    429412            }
     
    432415                JOptionPane.showMessageDialog(
    433416                        Main.parent,
    434                         tr("Audio synchronized at point {0}.", recent.text),
     417                        tr("Audio synchronized at point {0}.", recent.getText()),
    435418                        tr("Information"),
    436419                        JOptionPane.INFORMATION_MESSAGE
    437                 );
     420                        );
    438421            } else {
    439422                JOptionPane.showMessageDialog(
     
    442425                        tr("Error"),
    443426                        JOptionPane.ERROR_MESSAGE
    444                 );
     427                        );
    445428            }
    446429        }
     
    462445                        tr("Warning"),
    463446                        JOptionPane.WARNING_MESSAGE
    464                 );
     447                        );
    465448                return;
    466449            }
Note: See TracChangeset for help on using the changeset viewer.