Changeset 33432 in osm for applications/editors/josm/plugins/pt_assistant
- Timestamp:
- 2017-07-07T23:47:58+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java
r33429 r33432 21 21 import org.openstreetmap.josm.plugins.pt_assistant.actions.EditHighlightedRelationsAction; 22 22 import org.openstreetmap.josm.plugins.pt_assistant.actions.RepeatLastFixAction; 23 import org.openstreetmap.josm.plugins.pt_assistant.actions.SortPTStopsAction; 23 24 import org.openstreetmap.josm.plugins.pt_assistant.actions.SplitRoundaboutAction; 24 25 import org.openstreetmap.josm.plugins.pt_assistant.data.PTRouteSegment; … … 66 67 editHighlightedRelationsMenu = MainMenu.add(Main.main.menu.toolsMenu, editHighlightedRelationsAction); 67 68 MainMenu.add(Main.main.menu.toolsMenu, new SplitRoundaboutAction()); 69 MainMenu.add(Main.main.menu.toolsMenu, new SortPTStopsAction()); 68 70 } 69 71 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java
r33055 r33432 27 27 private OsmPrimitive platform = null; 28 28 29 private RelationMember stopPositionRM = null; 30 31 private RelationMember platformRM = null; 32 29 33 /* the name of this stop */ 30 34 private String name = ""; … … 50 54 this.stopPosition = other.getNode(); 51 55 this.name = stopPosition.get("name"); 52 56 setStopPositionRM(other); 53 57 // } else if (other.getRole().equals("platform") || 54 58 // other.getRole().equals("platform_entry_only") … … 60 64 this.platform = other.getMember(); 61 65 this.name = platform.get("name"); 66 setPlatformRM(other); 62 67 63 68 } else { … … 78 83 * already has an attribute with that role. 79 84 */ 80 p rotectedboolean addStopElement(RelationMember member) {85 public boolean addStopElement(RelationMember member) { 81 86 82 87 // each element is only allowed once per stop … … 88 93 if (member.getType().equals(OsmPrimitiveType.NODE) && stopPosition == null) { 89 94 this.stopPosition = member.getNode(); 95 stopPositionRM = member; 90 96 return true; 91 97 } … … 102 108 if (platform == null) { 103 109 platform = member.getMember(); 110 platformRM = member; 104 111 return true; 105 112 } … … 211 218 } 212 219 220 public RelationMember getPlatformRM() { 221 return platformRM; 222 } 223 224 public void setPlatformRM(RelationMember platformRM) { 225 this.platformRM = platformRM; 226 } 227 228 public RelationMember getStopPositionRM() { 229 return stopPositionRM; 230 } 231 232 public void setStopPositionRM(RelationMember stopPositionRM) { 233 this.stopPositionRM = stopPositionRM; 234 } 235 213 236 } -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/RouteUtils.java
r33429 r33432 19 19 public final class RouteUtils { 20 20 21 private static final String ptVersionTag= "public_transport:version";21 private static final String PT_VERSION_TAG = "public_transport:version"; 22 22 private RouteUtils() { 23 23 // private constructor for util classes … … 39 39 } 40 40 41 if (!r.hasTag( ptVersionTag, "2")) {41 if (!r.hasTag(PT_VERSION_TAG, "2")) { 42 42 return false; 43 43 } … … 52 52 } 53 53 54 if (r.get( ptVersionTag) == null) {54 if (r.get(PT_VERSION_TAG) == null) { 55 55 return true; 56 56 } 57 57 58 return r.hasTag( ptVersionTag, "1");58 return r.hasTag(PT_VERSION_TAG, "1"); 59 59 } 60 60 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/utils/StopToWayAssigner.java
r33055 r33432 7 7 import java.util.HashSet; 8 8 import java.util.List; 9 import java.util.Map; 9 10 import java.util.Set; 10 11 … … 32 33 33 34 /* contains assigned stops */ 34 public static HashMap<PTStop, List<Way>> stopToWay = new HashMap<>();35 public static Map<PTStop, List<Way>> stopToWay = new HashMap<>(); 35 36 36 37 /* … … 39 40 */ 40 41 private HashSet<Way> ways; 41 42 /* route relation for which this StopToWayAssigner was created */43 42 44 43 public StopToWayAssigner(List<PTWay> ptways) { … … 47 46 ways.addAll(ptway.getWays()); 48 47 } 48 } 49 50 public StopToWayAssigner(Collection<Way> ways) { 51 this.ways = new HashSet<>(); 52 this.ways.addAll(ways); 49 53 } 50 54 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/validation/RouteChecker.java
r33429 r33432 82 82 } 83 83 } 84 } 85 86 public boolean hasGaps(List<RelationMember> waysToCheck) { 87 return countGaps(waysToCheck) > 0; 84 88 } 85 89
Note:
See TracChangeset
for help on using the changeset viewer.