Changeset 3973 in josm


Ignore:
Timestamp:
2011-03-10T00:39:28+01:00 (11 years ago)
Author:
mjulius
Message:

Zoom to conflict now zooms to first selected conflict if there is one selected. Otherwise it zooms to all conflicts (as before).
closes #3266

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

Legend:

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

    r3760 r3973  
    1616import org.openstreetmap.josm.Main;
    1717import org.openstreetmap.josm.data.Bounds;
     18import org.openstreetmap.josm.data.conflict.Conflict;
    1819import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1920import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     
    201202                sel = getCurrentDataSet().getSelected();
    202203            } else if (mode.equals("conflict")) {
    203                 if (Main.map.conflictDialog.getConflicts() != null) {
     204                Conflict<? extends OsmPrimitive> c = Main.map.conflictDialog.getSelectedConflict();
     205                if (c != null) {
     206                    sel.add(c.getMy());
     207                } else if (Main.map.conflictDialog.getConflicts() != null) {
    204208                    sel = Main.map.conflictDialog.getConflicts().getMyConflictParties();
    205209                }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r3765 r3973  
    236236    }
    237237
     238    /**
     239     * returns the first selected item of the conflicts list
     240     *
     241     * @return Conflict
     242     */
     243    public Conflict<? extends OsmPrimitive> getSelectedConflict() {
     244        if (conflicts == null || model.getSize() == 0) return null;
     245
     246        int index = lstConflicts.getSelectedIndex();
     247        if (index < 0) return null;
     248
     249        return conflicts.get(index);
     250    }
     251
    238252    public void onConflictsAdded(ConflictCollection conflicts) {
    239253        refreshView();
Note: See TracChangeset for help on using the changeset viewer.