Changeset 1622 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-05-26T21:44:31+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 21 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r1523 r1622 107 107 108 108 private final void resolve() { 109 String method = Main.pref.get("conflict.resolution", "traditional"); 110 method = method.trim().toLowerCase(); 111 if (method.equals("traditional")) { 112 resolveTraditional(); 113 } else if (method.equals("extended")) { 114 resolveExtended(); 115 } else { 116 System.out.println(tr("WARNING: unexpected value for preference conflict.resolution, got " + method)); 117 resolveTraditional(); 118 } 119 } 120 121 122 private final void resolveExtended() { 123 if(model.size() == 1) 124 displaylist.setSelectedIndex(0); 125 126 if (displaylist.getSelectedIndex() == -1) 127 return; 128 129 int [] selectedRows = displaylist.getSelectedIndices(); 130 if (selectedRows == null || selectedRows.length == 0) { 131 return; 132 } 133 int row = selectedRows[0]; 134 OsmPrimitive my = (OsmPrimitive)model.get(row); 135 OsmPrimitive their = conflicts.get(my); 136 ConflictResolutionDialog dialog = new ConflictResolutionDialog(Main.parent); 137 dialog.getConflictResolver().populate(my, their); 138 dialog.setVisible(true); 139 Main.map.mapView.repaint(); 140 } 141 142 143 private final void resolveTraditional() { 109 144 if(model.size() == 1) 110 145 displaylist.setSelectedIndex(0); … … 133 168 public final void rebuildList() { 134 169 model.removeAllElements(); 135 for (OsmPrimitive osm : this.conflicts.keySet()) 136 if (osm instanceof Node) 137 model.addElement(osm); 138 for (OsmPrimitive osm : this.conflicts.keySet()) 139 if (osm instanceof Way) 140 model.addElement(osm); 141 for (OsmPrimitive osm : this.conflicts.keySet()) 142 if (osm instanceof Relation) 143 model.addElement(osm); 144 170 for (OsmPrimitive osm : this.conflicts.keySet()) { 171 model.addElement(osm); 172 } 173 145 174 if(model.size() != 0) { 146 175 setTitle(tr("Conflicts: {0}", model.size()), true); … … 197 226 } 198 227 }; 199 for (Object o : displaylist.getSelectedValues()) 228 for (Object o : displaylist.getSelectedValues()) { 229 if (conflicts.get(o) == null) { 230 continue; 231 } 200 232 conflicts.get(o).visit(conflictPainter); 233 } 201 234 } 202 235 }
Note:
See TracChangeset
for help on using the changeset viewer.