---
core-dave/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java | 29 ++++------
1 file changed, 12 insertions(+), 17 deletions(-)
diff -puN src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java~fix-multipolygon-selection src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
|
a
|
b
|
public class MapPaintVisitor extends Sim
|
| 390 | 390 | displaySegments(); |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | | public Collection<Way> joinWays(Collection<Way> join, OsmPrimitive errs) |
| | 393 | public Way joinWays(Collection<Way> join, OsmPrimitive errs) |
| 394 | 394 | { |
| 395 | | Collection<Way> res = new LinkedList<Way>(); |
| | 395 | Way res = null; |
| 396 | 396 | Object[] joinArray = join.toArray(); |
| 397 | 397 | int left = join.size(); |
| 398 | 398 | while(left != 0) |
| … |
… |
public class MapPaintVisitor extends Sim
|
| 479 | 479 | { |
| 480 | 480 | w = new Way(w); |
| 481 | 481 | w.setNodes(n); |
| 482 | | if (selected) { |
| 483 | | data.addSelected(Collections.singleton(w),false /* don't notify listeners */); |
| 484 | | } else { |
| 485 | | data.clearSelection(w); |
| 486 | | } |
| | 482 | // Do not mess with the DataSet's contents here. |
| 487 | 483 | } |
| 488 | 484 | if(!w.isClosed()) |
| 489 | 485 | { |
| … |
… |
public class MapPaintVisitor extends Sim
|
| 493 | 489 | w.getDisplayName(DefaultNameFormatter.getInstance())), true); |
| 494 | 490 | } |
| 495 | 491 | } |
| 496 | | res.add(w); |
| | 492 | res = w; |
| 497 | 493 | } /* while(left != 0) */ |
| 498 | 494 | |
| 499 | 495 | return res; |
| … |
… |
public class MapPaintVisitor extends Sim
|
| 911 | 907 | { |
| 912 | 908 | Boolean zoomok = isZoomOk(wayStyle); |
| 913 | 909 | Boolean visible = false; |
| | 910 | Boolean outerSelected = false; |
| 914 | 911 | Collection<Way> join = new LinkedList<Way>(); |
| 915 | 912 | |
| 916 | 913 | drawn = true; |
| 917 | 914 | for (Way w : outer) |
| 918 | 915 | { |
| | 916 | if (data.isSelected(w)) |
| | 917 | outerSelected = true; |
| 919 | 918 | if(w.isClosed()) { |
| 920 | 919 | outerclosed.add(w); |
| 921 | 920 | } else { |
| … |
… |
public class MapPaintVisitor extends Sim
|
| 924 | 923 | } |
| 925 | 924 | if(join.size() != 0) |
| 926 | 925 | { |
| 927 | | for(Way w : joinWays(join, incomplete ? null : r)) { |
| 928 | | outerclosed.add(w); |
| 929 | | } |
| | 926 | outerclosed.add(joinWays(join, incomplete ? null : r)); |
| 930 | 927 | } |
| 931 | 928 | |
| 932 | 929 | join.clear(); |
| … |
… |
public class MapPaintVisitor extends Sim
|
| 940 | 937 | } |
| 941 | 938 | if(join.size() != 0) |
| 942 | 939 | { |
| 943 | | for(Way w : joinWays(join, incomplete ? null : r)) { |
| 944 | | innerclosed.add(w); |
| 945 | | } |
| | 940 | innerclosed.add(joinWays(join, incomplete ? null : r)); |
| 946 | 941 | } |
| 947 | 942 | |
| 948 | 943 | if(outerclosed.size() == 0) |
| … |
… |
public class MapPaintVisitor extends Sim
|
| 1061 | 1056 | Polygon p = pd.get(); |
| 1062 | 1057 | if(isPolygonVisible(p)) |
| 1063 | 1058 | { |
| 1064 | | drawAreaPolygon(p, (data.isSelected(pd.way) || data.isSelected(r)) ? selectedColor |
| 1065 | | : areaStyle.color); |
| | 1059 | boolean selected = (data.isSelected(pd.way) || data.isSelected(r) || outerSelected); |
| | 1060 | drawAreaPolygon(p, selected ? selectedColor : areaStyle.color); |
| 1066 | 1061 | visible = true; |
| 1067 | 1062 | } |
| 1068 | 1063 | } |
| … |
… |
public class MapPaintVisitor extends Sim
|
| 1130 | 1125 | r.putError(tr("Style for outer way ''{0}'' mismatches.", |
| 1131 | 1126 | wOuter.getDisplayName(DefaultNameFormatter.getInstance())), true); |
| 1132 | 1127 | } |
| 1133 | | if(data.isSelected(r)) |
| | 1128 | if(data.isSelected(r) || outerSelected) |
| 1134 | 1129 | { |
| 1135 | 1130 | drawSelectedMember(wOuter, outerStyle, false, false); |
| 1136 | 1131 | } |