Ignore:
Timestamp:
2009-07-08T21:50:32+02:00 (15 years ago)
Author:
Gubaer
Message:

new: replaced global conflict list by conflict list per layer, similar to datasets

File:
1 edited

Legend:

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

    r1662 r1750  
    88import java.awt.event.KeyEvent;
    99import java.util.Collection;
     10import java.util.HashSet;
    1011
    1112import javax.swing.JOptionPane;
     
    7071        BoundingXYVisitor v = new BoundingXYVisitor();
    7172        if (mode.equals("data")) {
    72             for (Layer l : Main.map.mapView.getAllLayers())
     73            for (Layer l : Main.map.mapView.getAllLayers()) {
    7374                l.visitBoundingBox(v);
    74         } else if (mode.equals("layer"))
     75            }
     76        } else if (mode.equals("layer")) {
    7577            Main.map.mapView.getActiveLayer().visitBoundingBox(v);
    76         else if (mode.equals("selection") || mode.equals("conflict")) {
    77             Collection<OsmPrimitive> sel = mode.equals("selection") ? Main.ds.getSelected()
    78                     : Main.map.conflictDialog.conflicts.keySet();
     78        } else if (mode.equals("selection") || mode.equals("conflict")) {
     79            Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>();
     80            if (mode.equals("selection")) {
     81                sel = Main.ds.getSelected();
     82            } else if (mode.equals("conflict")) {
     83                if (Main.map.conflictDialog.getConflicts() != null) {
     84                    sel = Main.map.conflictDialog.getConflicts().getMyConflictParties();
     85                }
     86            }
    7987            if (sel.isEmpty()) {
    8088                JOptionPane.showMessageDialog(Main.parent,
     
    8290                return null;
    8391            }
    84             for (OsmPrimitive osm : sel)
     92            for (OsmPrimitive osm : sel) {
    8593                osm.visit(v);
     94            }
    8695            // increase bbox by 0.001 degrees on each side. this is required
    8796            // especially if the bbox contains one single node, but helpful
Note: See TracChangeset for help on using the changeset viewer.