Ignore:
Timestamp:
2011-08-07T09:08:29+02:00 (8 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/data/gpx/WayPoint.java

    r4129 r4282  
    55
    66import java.awt.Color;
     7import java.util.ArrayList;
    78import java.util.Date;
     9import java.util.List;
    810
    911import org.openstreetmap.josm.Main;
     12import org.openstreetmap.josm.actions.search.SearchCompiler.Match;
    1013import org.openstreetmap.josm.data.coor.EastNorth;
    1114import org.openstreetmap.josm.data.coor.LatLon;
    1215import org.openstreetmap.josm.data.projection.Projections;
    1316import org.openstreetmap.josm.tools.PrimaryDateParser;
     17import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider;
    1418
    15 public class WayPoint extends WithAttributes implements Comparable<WayPoint> {
     19public class WayPoint extends WithAttributes implements Comparable<WayPoint>, TemplateEngineDataProvider {
    1620
    1721    private static ThreadLocal<PrimaryDateParser> dateParser = new ThreadLocal<PrimaryDateParser>() {
     
    117121        return new Date((long) (time * 1000));
    118122    }
     123
     124    @Override
     125    public Object getTemplateValue(String name) {
     126        return attr.get(name);
     127    }
     128
     129    @Override
     130    public boolean evaluateCondition(Match condition) {
     131        throw new UnsupportedOperationException();
     132    }
     133
     134    @Override
     135    public List<String> getTemplateKeys() {
     136        return new ArrayList<String>(attr.keySet());
     137    }
    119138}
Note: See TracChangeset for help on using the changeset viewer.