Changeset 30365 in osm for applications/editors/josm/plugins/turnrestrictions/src/org
- Timestamp:
- 2014-03-24T22:35:16+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java
r25845 r30365 24 24 */ 25 25 public class TurnRestrictionBuilder { 26 27 28 29 30 31 32 33 34 35 36 26 27 /** 28 * Replies the angle phi in the polar coordinates (r,phi) representing the first 29 * segment of the way {@code w}, where w is moved such that the start node of {@code w} is 30 * in the origin (0,0). 31 * 32 * @param w the way. Must not be null. At least two nodes required. 33 * @return phi in the polar coordinates 34 * @throws IllegalArgumentException thrown if w is null 35 * @throws IllegalArgumentException thrown if w is too short (at least two nodes required) 36 */ 37 37 static public double phi(Way w) throws IllegalArgumentException{ 38 38 return phi(w, false /* not inverse */); 39 39 } 40 40 41 41 /** 42 42 * <p>Replies the angle phi in the polar coordinates (r,phi) representing the first 43 44 45 46 47 48 49 50 51 52 43 * segment of the way {@code w}, where w is moved such that the start node of {@code w} is 44 * in the origin (0,0).</p> 45 * 46 * <p>If {@code doInvert} is true, computes phi for the way in reversed direction.</p> 47 * 48 * @param w the way. Must not be null. At least two nodes required. 49 * @param doInvert if true, computes phi for the reversed way 50 * @return phi in the polar coordinates 51 * @throws IllegalArgumentException thrown if w is null 52 * @throws IllegalArgumentException thrown if w is too short (at least two nodes required) 53 53 */ 54 54 static public double phi(Way w, boolean doInvert) throws IllegalArgumentException { 55 56 57 58 59 60 61 62 63 64 65 66 return Math.atan2(y, x);55 CheckParameterUtil.ensureParameterNotNull(w, "w"); 56 if (w.getNodesCount() < 2) { 57 throw new IllegalArgumentException("can't compute phi for way with less than 2 nodes"); 58 } 59 List<Node> nodes = w.getNodes(); 60 if (doInvert) Collections.reverse(nodes); 61 Node n0 = nodes.get(0); 62 Node n1 = nodes.get(1); 63 64 double x = n1.getCoor().getX() - n0.getCoor().getX(); 65 double y = n1.getCoor().getY() - n0.getCoor().getY(); 66 return Math.atan2(y, x); 67 67 } 68 68 … … 77 77 */ 78 78 static public Node getUniqueCommonNode(Way w1, Way w2) throws IllegalArgumentException{ 79 80 81 82 79 Set<Node> w1Nodes = new HashSet<Node>(w1.getNodes()); 80 w1Nodes.retainAll(w2.getNodes()); 81 if (w1Nodes.size() != 1) return null; 82 return w1Nodes.iterator().next(); 83 83 } 84 84 … … 91 91 */ 92 92 static public boolean isStartNode(Way w, Node n) { 93 94 93 if (w.getNodesCount() == 0) return false; 94 return w.getNode(0).equals(n); 95 95 } 96 96 … … 103 103 */ 104 104 static public boolean isEndNode(Way w, Node n){ 105 106 105 if (w.getNodesCount() == 0) return false; 106 return w.getNode(w.getNodesCount()-1).equals(n); 107 107 } 108 108 … … 116 116 */ 117 117 static public boolean isInnerNode(Way w, Node n){ 118 119 120 121 return true;118 if (!w.getNodes().contains(n)) return false; 119 if (isStartNode(w, n)) return false; 120 if (isEndNode(w, n)) return false; 121 return true; 122 122 } 123 123 … … 140 140 */ 141 141 static public double intersectionAngle(Way from, Way to) throws IllegalArgumentException { 142 143 if (via == null) 144 145 if (!isStartNode(from, via) && ! isEndNode(from, via)) 146 147 if (!isStartNode(to, via) && ! isEndNode(to, via)) 148 149 150 double phi2 = phi(to, isEndNode(to, via)); 151 142 Node via = getUniqueCommonNode(from, to); 143 if (via == null) 144 throw new IllegalArgumentException("the two ways must share exactly one common node"); // no I18n required 145 if (!isStartNode(from, via) && ! isEndNode(from, via)) 146 throw new IllegalArgumentException("via node must be start or end node of from-way"); // no I18n required 147 if (!isStartNode(to, via) && ! isEndNode(to, via)) 148 throw new IllegalArgumentException("via node must be start or end node of to-way"); // no I18n required 149 double phi1 = phi(from, isStartNode(from, via)); 150 double phi2 = phi(to, isEndNode(to, via)); 151 return phi1 - phi2; 152 152 } 153 153 154 154 static public enum RelativeWayJoinOrientation { 155 156 155 LEFT, 156 RIGHT 157 157 } 158 158 /** … … 188 188 */ 189 189 public static RelativeWayJoinOrientation determineWayJoinOrientation(Way from, Way to){ 190 191 192 193 194 195 196 197 198 double phi = intersectionAngle(from, to);199 200 201 202 203 190 Node via = getUniqueCommonNode(from, to); 191 if (via == null) return null; 192 if (!isConnectingNode(from, to, via)) return null; 193 // if either w1 or w2 are closed at the via node, we can't determine automatically 194 // whether the connection at "via" is a "left turn" or a "right turn" 195 if (isClosedAt(from, via)) return null; 196 if (isClosedAt(to, via)) return null; 197 198 double phi = intersectionAngle(from, to); 199 if (phi >=0 && phi <= Math.PI) { 200 return RelativeWayJoinOrientation.RIGHT; 201 } else { 202 return RelativeWayJoinOrientation.LEFT; 203 } 204 204 } 205 205 … … 241 241 */ 242 242 static public Way selectToWayAfterSplit(Way from, Way to1, Way to2, TurnRestrictionType restrictionType){ 243 244 245 246 247 248 if (cn1 != cn2) return null;249 250 251 252 253 * can't adjust the split decisions.254 255 256 257 258 259 260 243 if (restrictionType == null) return null; 244 Node cn1 = TurnRestrictionBuilder.getUniqueCommonNode(from, to1); 245 if (cn1 == null) return null; 246 Node cn2 = TurnRestrictionBuilder.getUniqueCommonNode(from, to2); 247 if (cn2 == null) return null; 248 if (cn1 != cn2) return null; 249 250 if (! isStartNode(from, cn1) && ! isEndNode(from, cn1)) { 251 /* 252 * the now split to-way still *intersects* the from-way. We 253 * can't adjust the split decisions. 254 */ 255 return null; 256 } 257 258 RelativeWayJoinOrientation o1 = determineWayJoinOrientation(from, to1); 259 RelativeWayJoinOrientation o2 = determineWayJoinOrientation(from, to2); 260 261 261 switch(restrictionType){ 262 262 case NO_LEFT_TURN: 263 263 case ONLY_LEFT_TURN: 264 265 266 267 264 if (RelativeWayJoinOrientation.LEFT.equals(o1)) return to1; 265 else if (RelativeWayJoinOrientation.LEFT.equals(o2)) return to2; 266 else return null; 267 268 268 case NO_RIGHT_TURN: 269 269 case ONLY_RIGHT_TURN: 270 271 272 273 270 if (RelativeWayJoinOrientation.RIGHT.equals(o1)) return to1; 271 else if (RelativeWayJoinOrientation.RIGHT.equals(o2)) return to2; 272 else return null; 273 274 274 default: 275 276 277 278 279 275 /* 276 * For restriction types like NO_U_TURN, NO_STRAIGHT_ON, etc. we 277 * can select a "left" or "right" way after splitting. 278 */ 279 return null; 280 280 } 281 281 } … … 308 308 */ 309 309 protected Relation initNoUTurnRestriction(List<OsmPrimitive> primitives) { 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 return tr;310 if (primitives.size() != 2) return null; 311 312 // we need exactly one node and one way in the selection ... 313 List<Node> nodes = OsmPrimitive.getFilteredList(primitives, Node.class); 314 List<Way> ways = OsmPrimitive.getFilteredList(primitives, Way.class); 315 if (nodes.size() != 1 || ways.size() != 1) return null; 316 317 // .. and the node has to be the start or the node of the way 318 Way way = ways.get(0); 319 Node node = nodes.get(0); 320 List<Node> wayNodes = way.getNodes(); 321 if (wayNodes.size() < 2) return null; // shouldn't happen - just in case 322 if (! (wayNodes.get(0).equals(node) ||wayNodes.get(wayNodes.size()-1).equals(node))) return null; 323 324 Relation tr = new Relation(); 325 tr.put("type", "restriction"); 326 tr.addMember(new RelationMember("from", way)); 327 tr.addMember(new RelationMember("to", way)); 328 tr.addMember(new RelationMember("via", node)); 329 tr.put("restriction", TurnRestrictionType.NO_U_TURN.getTagValue()); 330 return tr; 331 331 } 332 332 … … 344 344 */ 345 345 public static boolean isConnectingNode(Way w1, Way w2, Node n){ 346 347 348 349 350 351 346 if (isStartNode(w1, n)) { 347 return isStartNode(w2, n) | isEndNode(w2, n); 348 } else if (isEndNode(w1, n)){ 349 return isStartNode(w2, n) | isEndNode(w2, n); 350 } 351 return false; 352 352 } 353 353 … … 360 360 */ 361 361 public static boolean isClosedAt(Way w, Node n){ 362 363 364 362 List<Node> nodes = w.getNodes(); 363 nodes.retainAll(Collections.singletonList(n)); 364 return nodes.size() >= 2; 365 365 } 366 366 367 367 protected Relation initTurnRestrictionFromTwoWays(List<OsmPrimitive> primitives) { 368 369 370 371 372 373 374 375 376 377 378 379 via = getUniqueCommonNode(w1, w2);380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 break;421 422 423 424 368 Way w1 = null; 369 Way w2 = null; 370 Node via = null; 371 if (primitives.size() == 2) { 372 // if we have exactly two selected primitives, we expect two ways. 373 // See initNoUTurnRestriction() for the case where we have a selected way 374 // and a selected node 375 List<Way> selWays = OsmPrimitive.getFilteredList(primitives, Way.class); 376 if (selWays.size() != 2) return null; 377 w1 = selWays.get(0); 378 w2 = selWays.get(1); 379 via = getUniqueCommonNode(w1, w2); 380 } else if (primitives.size() == 3){ 381 // if we have exactly three selected primitives, we need two ways and a 382 // node, which should be an acceptable via node 383 List<Way> selWays = OsmPrimitive.getFilteredList(primitives, Way.class); 384 List<Node> selNodes = OsmPrimitive.getFilteredList(primitives, Node.class); 385 if (selWays.size() != 2) return null; 386 if (selNodes.size() != 1) return null; 387 w1 = selWays.get(0); 388 w2 = selWays.get(1); 389 via = selNodes.get(0); 390 if (! w1.getNodes().contains(via) || ! w2.getNodes().contains(via)){ 391 // the selected node is not an acceptable via node 392 via = null; 393 } 394 } else { 395 // the selection doesn't consists of primitives for which we can build 396 // a turn restriction 397 return null; 398 } 399 400 // if we get here, we know the two "legs" of the turn restriction. We may 401 // or may not know a via node, though 402 assert w1 != null; 403 assert w2 != null; 404 405 Relation tr = new Relation(); 406 tr.put("type", "restriction"); 407 tr.addMember(new RelationMember("from", w1)); 408 tr.addMember(new RelationMember("to", w2)); 409 410 if (via != null){ 411 tr.addMember(new RelationMember("via", via)); 412 RelativeWayJoinOrientation orientation = determineWayJoinOrientation(w1, w2); 413 if (orientation != null){ 414 switch(orientation){ 415 case LEFT: 416 tr.put("restriction", TurnRestrictionType.NO_LEFT_TURN.getTagValue()); 417 break; 418 case RIGHT: 419 tr.put("restriction", TurnRestrictionType.NO_RIGHT_TURN.getTagValue()); 420 break; 421 } 422 } 423 } 424 return tr; 425 425 } 426 426 427 427 protected Relation initEmptyTurnRestriction() { 428 428 Relation tr = new Relation(); 429 429 tr.put("type", "restriction"); 430 430 return tr; … … 441 441 public synchronized Relation build(List<OsmPrimitive> primitives){ 442 442 if (primitives == null || primitives.isEmpty()) { 443 443 return initEmptyTurnRestriction(); 444 444 } 445 445 Relation tr; … … 447 447 // case 0 already handled 448 448 case 1: 449 450 451 452 453 454 455 456 449 tr = initEmptyTurnRestriction(); 450 if (OsmPrimitive.getFilteredList(primitives, Way.class).size() == 1) { 451 // we have exactly one selected way? -> init the "from" leg 452 // of the turn restriction with it 453 tr.addMember(new RelationMember("from", primitives.get(0))); 454 } 455 return tr; 456 457 457 case 2: 458 459 460 461 462 return initEmptyTurnRestriction();463 464 default: 465 466 467 458 tr = initNoUTurnRestriction(primitives); 459 if (tr != null) return tr; 460 tr = initTurnRestrictionFromTwoWays(primitives); 461 if (tr != null) return tr; 462 return initEmptyTurnRestriction(); 463 464 default: 465 tr = initTurnRestrictionFromTwoWays(primitives); 466 if (tr != null) return tr; 467 return initEmptyTurnRestriction(); 468 468 } 469 469 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java
r29854 r30365 92 92 DefaultListSelectionModel selectionModel = new DefaultListSelectionModel(); 93 93 spVias = new JScrollPane(lstVias = new ViaList(new ViaListModel(model, selectionModel), selectionModel)) { 94 95 96 94 // fixes #6016 : Scrollbar hides field entry 95 public Dimension getPreferredSize() { 96 return new Dimension(100, 80); // only height is relevant, 80 is just a heuristical value 97 97 } 98 98 }; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java
r29854 r30365 119 119 // select it in the list of selected JOSM objects too. 120 120 if (getSelected().isEmpty() && this.selection.size() == 1) { 121 121 setSelected(this.selection); 122 122 } 123 123 } … … 143 143 144 144 public ListSelectionModel getListSelectionModel() { 145 145 return selectionModel; 146 146 } 147 147 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java
r29854 r30365 445 445 446 446 public int getRowCount() { 447 447 return members.size(); 448 448 } 449 449 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java
r29854 r30365 94 94 */ 95 95 public JosmSelectionListModel getJosmSelectionListModel() { 96 96 return selectionModel; 97 97 } 98 98 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditor.java
r29854 r30365 278 278 */ 279 279 class AcceptAction extends AbstractAction implements ListSelectionListener { 280 281 282 283 284 285 286 updateEnabledState(); 287 288 289 290 291 292 Way w = selWays.get(0);280 281 public AcceptAction() { 282 putValue(SHORT_DESCRIPTION, tr("Accept the currently selected way")); 283 putValue(NAME, tr("Accept")); 284 putValue(SMALL_ICON, ImageProvider.get("accept")); 285 model.getJosmSelectionListModel().getListSelectionModel().addListSelectionListener(this); 286 updateEnabledState(); 287 } 288 289 public void actionPerformed(ActionEvent e) { 290 List<Way> selWays = OsmPrimitive.getFilteredList(model.getJosmSelectionListModel().getSelected(), Way.class); 291 if (selWays.size() != 1) return; 292 Way w = selWays.get(0); 293 293 model.setTurnRestrictionLeg(role, w); 294 294 } 295 295 296 296 public void updateEnabledState() { 297 297 setEnabled(OsmPrimitive.getFilteredList(model.getJosmSelectionListModel().getSelected(), Way.class).size() == 1); 298 298 } 299 299 300 301 302 303 300 @Override 301 public void valueChanged(ListSelectionEvent e) { 302 updateEnabledState(); 303 } 304 304 } 305 305 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditor.java
r29854 r30365 232 232 233 233 protected void init() { 234 235 236 237 238 239 240 241 242 243 244 234 try { 235 // temporarily disable the checkbox listeners while initializing the 236 // checkboxes with the input value 237 this.svtChangeListener.setEnabled(false); 238 cbPsv.setSelected(exceptValue.isVehicleException("psv")); 239 cbBicyle.setSelected(exceptValue.isVehicleException("bicycle")); 240 cbMotorcar.setSelected(exceptValue.isVehicleException("motorcar")); 241 cbHgv.setSelected(exceptValue.isVehicleException("hgv")); 242 } finally { 243 this.svtChangeListener.setEnabled(true); 244 } 245 245 if (!exceptValue.isStandard()){ 246 246 rbNonStandardException.setSelected(true); … … 309 309 310 310 class StandardVehicleTypeChangeListener implements ItemListener { 311 312 313 314 315 316 317 public void itemStateChanged(ItemEvent e) { 318 311 private boolean enabled = true; 312 313 public void setEnabled(boolean enabled){ 314 this.enabled = enabled; 315 } 316 317 public void itemStateChanged(ItemEvent e) { 318 if (!enabled) return; 319 319 exceptValue.setVehicleException("bicycle", cbBicyle.isSelected()); 320 320 exceptValue.setVehicleException("hgv", cbHgv.isSelected()); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java
r29854 r30365 93 93 } 94 94 95 95 /** 96 96 * The transfer handler for Drag-and-Drop. 97 97 */ -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java
r23593 r30365 212 212 issues.add(new IntersectionMissingAsViaError(this, from, to, intersect)); 213 213 } 214 215 216 217 218 219 220 214 if (isInnerNode(from, intersect) && isInnerNode(to, intersect)) { 215 issues.add(new TurnRestrictionLegSplitRequiredError(this, from, to)); 216 } else if (isInnerNode(from, intersect) && ! isInnerNode(to, intersect)) { 217 issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.FROM, from, to, intersect)); 218 } else if (!isInnerNode(from, intersect) && isInnerNode(to, intersect)) { 219 issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.TO, from, to, intersect)); 220 } 221 221 } else { 222 223 224 225 226 }222 if (editorModel.getVias().isEmpty() && ! from.equals(to)){ 223 // the two turn restriction legs aren't connected and we don't have configured 224 // via objects 225 issues.add(new MissingViaError(this)); 226 } 227 227 } 228 228 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingViaError.java
r23571 r30365 14 14 public class MissingViaError extends Issue { 15 15 16 17 18 19 16 public MissingViaError(IssuesModel parent) throws IllegalArgumentException { 17 super(parent, Severity.WARNING); 18 actions.add(new FixAction()); 19 } 20 20 21 22 23 24 25 26 27 28 21 @Override 22 public String getText() { 23 String msg = 24 tr("The two ways participating in the turn restriction <strong>aren''t connected.</strong>") 25 + "<p>" 26 + tr("Make sure you add one or more via objects (nodes or ways) to the turn restriction."); 27 return msg; 28 } 29 29 30 30 class FixAction extends AbstractAction { 31 31 public FixAction() { 32 32 putValue(NAME, tr("Fix in editor")); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java
r25845 r30365 28 28 */ 29 29 public class TurnRestrictionLegSplitRequiredError extends Issue{ 30 31 30 static private final Logger logger = Logger.getLogger(TurnRestrictionLegSplitRequiredError.class.getName()); 31 32 32 private TurnRestrictionLegRole role; 33 33 private Way from; … … 45 45 */ 46 46 public TurnRestrictionLegSplitRequiredError(IssuesModel parent, Way from, Way to){ 47 48 49 CheckParameterUtil.ensureParameterNotNull(to, "to");50 51 52 53 54 55 56 57 58 47 super(parent, Severity.ERROR); 48 CheckParameterUtil.ensureParameterNotNull(from, "from"); 49 CheckParameterUtil.ensureParameterNotNull(to, "to"); 50 51 intersect= TurnRestrictionBuilder.getUniqueCommonNode(from, to); 52 if (intersect == null) 53 throw new IllegalArgumentException("exactly one intersecting node required"); 54 55 this.from = from; 56 this.to = to; 57 this.role = null; 58 actions.add(new SplitAction()); 59 59 } 60 60 … … 81 81 String msg = null; 82 82 if (role == null){ 83 84 85 86 87 + "way <span class=\"object-name\">{1}</span> with role <tt>to</tt> intersect "88 89 90 83 /* 84 * from and to intersect at a common node. Both have to be split. 85 */ 86 return tr("The way <span class=\"object-name\">{0}</span> with role <tt>from</tt> and the " 87 + "way <span class=\"object-name\">{1}</span> with role <tt>to</tt> intersect " 88 + "at node <span class=\"object-name\">{2}</span>. " 89 + "<p> " 90 + "Both ways should be split at the intersecting node.", 91 91 from.getDisplayName(DefaultNameFormatter.getInstance()), 92 92 to.getDisplayName(DefaultNameFormatter.getInstance()), … … 96 96 switch(role){ 97 97 case FROM: 98 99 100 98 /* 99 * "to" joins "from" at a common node. Only from has to be split 100 */ 101 101 msg = tr("The way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split " 102 102 + "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.", … … 108 108 break; 109 109 case TO: 110 111 112 110 /* 111 * "from" joins "to" at a common node. Only to has to be split 112 */ 113 113 msg = tr("The way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split " 114 114 + "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.", … … 131 131 public void actionPerformed(ActionEvent e) { 132 132 133 133 SplitWayResult result = null; 134 134 if (role == null || role.equals(TurnRestrictionLegRole.FROM)){ 135 135 result = SplitWayAction.split( 136 136 parent.getEditorModel().getLayer(), 137 137 from, … … 139 139 Collections.<OsmPrimitive>emptyList() 140 140 ); 141 141 if (result != null){ 142 142 Main.main.undoRedo.add(result.getCommand()); 143 143 } … … 145 145 146 146 if (role == null || role.equals(TurnRestrictionLegRole.TO)) { 147 147 result = SplitWayAction.split( 148 148 parent.getEditorModel().getLayer(), 149 149 to, … … 151 151 Collections.<OsmPrimitive>emptyList() 152 152 ); 153 153 if (result != null){ 154 154 Main.main.undoRedo.add(result.getCommand()); 155 155 } 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 );171 172 173 ); 156 if (result == null) return; 157 TurnRestrictionType restrictionType = TurnRestrictionType.fromTagValue(getIssuesModel().getEditorModel().getRestrictionTagValue()); 158 if (restrictionType == null) return; 159 Way adjustedTo = TurnRestrictionBuilder.selectToWayAfterSplit( 160 from, 161 result.getOriginalWay(), 162 result.getNewWays().get(0), 163 restrictionType 164 ); 165 166 if (adjustedTo == null) return; 167 getIssuesModel().getEditorModel().setTurnRestrictionLeg( 168 TurnRestrictionLegRole.TO, 169 adjustedTo 170 ); 171 getIssuesModel().getEditorModel().getLayer().data.setSelected( 172 Arrays.asList(from, adjustedTo) 173 ); 174 174 } else { 175 176 177 ); 175 getIssuesModel().getEditorModel().getLayer().data.setSelected( 176 Arrays.asList(from, to) 177 ); 178 178 } 179 179 }
Note:
See TracChangeset
for help on using the changeset viewer.