Changeset 15496 in josm for trunk/src/org/openstreetmap/josm/data/gpx/Line.java
- Timestamp:
- 2019-11-02T15:11:34+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/Line.java
r14451 r15496 2 2 package org.openstreetmap.josm.data.gpx; 3 3 4 import java.awt.Color; 4 5 import java.util.Collection; 5 6 import java.util.Iterator; … … 14 15 private final Collection<WayPoint> waypoints; 15 16 private final boolean unordered; 17 private final Color color; 16 18 17 19 /** … … 19 21 * @param waypoints collection of waypoints 20 22 * @param attributes track/route attributes 23 * @param color color of the track 24 * @since 15496 21 25 */ 22 public Line(Collection<WayPoint> waypoints, Map<String, Object> attributes) { 26 public Line(Collection<WayPoint> waypoints, Map<String, Object> attributes, Color color) { 27 this.color = color; 23 28 this.waypoints = Objects.requireNonNull(waypoints); 24 29 unordered = attributes.isEmpty() && waypoints.stream().allMatch(x -> x.get(GpxConstants.PT_TIME) == null); … … 29 34 * @param trackSegment track segment 30 35 * @param trackAttributes track attributes 36 * @param color color of the track 37 * @since 15496 31 38 */ 32 public Line(GpxTrackSegment trackSegment, Map<String, Object> trackAttributes) { 33 this(trackSegment.getWayPoints(), trackAttributes); 39 public Line(IGpxTrackSegment trackSegment, Map<String, Object> trackAttributes, Color color) { 40 this(trackSegment.getWayPoints(), trackAttributes, color); 34 41 } 35 42 … … 39 46 */ 40 47 public Line(GpxRoute route) { 41 this(route.routePoints, route.attr); 48 this(route.routePoints, route.attr, null); 42 49 } 43 50 … … 48 55 public boolean isUnordered() { 49 56 return unordered; 57 } 58 59 /** 60 * Returns the track/route color 61 * @return the color 62 * @since 15496 63 */ 64 public Color getColor() { 65 return color; 50 66 } 51 67
Note:
See TracChangeset
for help on using the changeset viewer.
