- Timestamp:
- 2014-01-04T04:55:24+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r6600 r6622 184 184 selectedWays.addAll(selectedMultipolygonRelation.getMemberPrimitives(Way.class)); 185 185 186 final MultipolygonCreate polygon = analyzeWays(selectedWays );186 final MultipolygonCreate polygon = analyzeWays(selectedWays, true); 187 187 if (polygon == null) { 188 188 return null; //could not make multipolygon. … … 195 195 * Returns a {@link Pair} null and the newly created/modified multipolygon {@link Relation}. 196 196 */ 197 public static Pair<Relation, Relation> createMultipolygonRelation(Collection<Way> selectedWays ) {198 199 final MultipolygonCreate polygon = analyzeWays(selectedWays );197 public static Pair<Relation, Relation> createMultipolygonRelation(Collection<Way> selectedWays, boolean showNotif) { 198 199 final MultipolygonCreate polygon = analyzeWays(selectedWays, showNotif); 200 200 if (polygon == null) { 201 201 return null; //could not make multipolygon. … … 211 211 212 212 final Pair<Relation, Relation> rr = selectedMultipolygonRelation == null 213 ? createMultipolygonRelation(selectedWays )213 ? createMultipolygonRelation(selectedWays, true) 214 214 : updateMultipolygonRelation(selectedWays, selectedMultipolygonRelation); 215 215 if (rr == null) { … … 258 258 * @return <code>null</code>, if there was a problem with the ways. 259 259 */ 260 private static MultipolygonCreate analyzeWays(Collection < Way > selectedWays ) {260 private static MultipolygonCreate analyzeWays(Collection < Way > selectedWays, boolean showNotif) { 261 261 262 262 MultipolygonCreate pol = new MultipolygonCreate(); … … 264 264 265 265 if (error != null) { 266 new Notification(error) 267 .setIcon(JOptionPane.INFORMATION_MESSAGE) 268 .show(); 266 if (showNotif) { 267 new Notification(error) 268 .setIcon(JOptionPane.INFORMATION_MESSAGE) 269 .show(); 270 } 269 271 return null; 270 272 } else { -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r6597 r6622 184 184 185 185 // Create new multipolygon using the logics from CreateMultipolygonAction and see if roles match. 186 final Pair<Relation, Relation> newMP = CreateMultipolygonAction.createMultipolygonRelation(r.getMemberPrimitives(Way.class) );186 final Pair<Relation, Relation> newMP = CreateMultipolygonAction.createMultipolygonRelation(r.getMemberPrimitives(Way.class), false); 187 187 if (newMP != null) { 188 188 for (RelationMember member : r.getMembers()) {
Note:
See TracChangeset
for help on using the changeset viewer.