Permalink
Browse files

Small fix

  • Loading branch information...
1 parent 291ad8d commit 200bbbfd5f838d74f010528db08e8d9c3fdb2dc9 @olejorgenb committed Jun 8, 2011
Showing with 9 additions and 11 deletions.
  1. +9 −11 src/org/openstreetmap/josm/plugins/parallelway/ParallelWayMode.java
@@ -395,15 +395,6 @@ public void mouseDragged(MouseEvent e) {
if (!isModifiersValidForDragMode())
return;
if (!initParallelWays(mousePressedPos, copyTags)) {
- // TODO: Not ideal feedback. Maybe changing the cursor could be a good mechanism?
- JOptionPane.showMessageDialog(
- Main.parent,
- tr("ParallelWayAction\n" +
- "The ways selected must form a simple branchless path"),
- tr("Make parallel way error"),
- JOptionPane.INFORMATION_MESSAGE);
- // The error dialog prevents us from getting the mouseReleased event
- resetMouseTrackingState();
return;
}
setMode(Mode.dragging);
@@ -521,8 +512,6 @@ private boolean initParallelWays(Point p, boolean copyTags) {
if (referenceSegment == null)
return false;
- // The collection returned is very inefficient so we collect it in an ArrayList
- // Not sure if the list is iterated multiple times any more...
if (!sourceWays.contains(referenceSegment.way)) {
clearSourceWays();
addSourceWay(referenceSegment.way);
@@ -542,6 +531,15 @@ private boolean initParallelWays(Point p, boolean copyTags) {
getCurrentDataSet().setSelected(pWays.ways);
return true;
} catch (IllegalArgumentException e) {
+ // TODO: Not ideal feedback. Maybe changing the cursor could be a good mechanism?
+ JOptionPane.showMessageDialog(
+ Main.parent,
+ tr("ParallelWayAction\n" +
+ "The ways selected must form a simple branchless path"),
+ tr("Make parallel way error"),
+ JOptionPane.INFORMATION_MESSAGE);
+ // The error dialog prevents us from getting the mouseReleased event
+ resetMouseTrackingState();
pWays = null;
return false;
}

0 comments on commit 200bbbf

Please sign in to comment.