Changeset 6622 in josm for trunk/src


Ignore:
Timestamp:
2014-01-04T04:55:24+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #9526 - Undesirable messages during data validation (introduced in r6575)

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r6600 r6622  
    184184        selectedWays.addAll(selectedMultipolygonRelation.getMemberPrimitives(Way.class));
    185185
    186         final MultipolygonCreate polygon = analyzeWays(selectedWays);
     186        final MultipolygonCreate polygon = analyzeWays(selectedWays, true);
    187187        if (polygon == null) {
    188188            return null; //could not make multipolygon.
     
    195195     * Returns a {@link Pair} null and the newly created/modified multipolygon {@link Relation}.
    196196     */
    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);
    200200        if (polygon == null) {
    201201            return null; //could not make multipolygon.
     
    211211
    212212        final Pair<Relation, Relation> rr = selectedMultipolygonRelation == null
    213                 ? createMultipolygonRelation(selectedWays)
     213                ? createMultipolygonRelation(selectedWays, true)
    214214                : updateMultipolygonRelation(selectedWays, selectedMultipolygonRelation);
    215215        if (rr == null) {
     
    258258     * @return <code>null</code>, if there was a problem with the ways.
    259259     */
    260     private static MultipolygonCreate analyzeWays(Collection < Way > selectedWays) {
     260    private static MultipolygonCreate analyzeWays(Collection < Way > selectedWays, boolean showNotif) {
    261261
    262262        MultipolygonCreate pol = new MultipolygonCreate();
     
    264264
    265265        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            }
    269271            return null;
    270272        } else {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r6597 r6622  
    184184
    185185            // 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);
    187187            if (newMP != null) {
    188188                for (RelationMember member : r.getMembers()) {
Note: See TracChangeset for help on using the changeset viewer.