Changeset 1750 in josm for trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
- Timestamp:
- 2009-07-08T21:50:32+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r1690 r1750 19 19 import java.awt.event.ActionEvent; 20 20 import java.awt.geom.Area; 21 import java.awt.geom.Rectangle2D;22 21 import java.awt.image.BufferedImage; 23 22 import java.io.File; … … 42 41 import org.openstreetmap.josm.actions.SaveAction; 43 42 import org.openstreetmap.josm.actions.SaveAsAction; 43 import org.openstreetmap.josm.data.conflict.Conflict; 44 import org.openstreetmap.josm.data.conflict.ConflictCollection; 44 45 import org.openstreetmap.josm.data.coor.EastNorth; 45 46 import org.openstreetmap.josm.data.coor.LatLon; … … 60 61 import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor; 61 62 import org.openstreetmap.josm.gui.MapView; 62 import org.openstreetmap.josm.gui.dialogs.ConflictDialog;63 63 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 64 64 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; … … 74 74 */ 75 75 public class OsmDataLayer extends Layer { 76 77 /** the global counter for created data layers */ 78 static private int dataLayerCounter = 0; 79 80 /** 81 * Replies a new unique name for a data layer 82 * 83 * @return a new unique name for a data layer 84 */ 85 static public String createNewName() { 86 dataLayerCounter++; 87 return tr("Data Layer {0}", dataLayerCounter); 88 } 76 89 77 90 public final static class DataCountVisitor extends AbstractVisitor { … … 114 127 */ 115 128 public final DataSet data; 129 130 /** 131 * the collection of conflicts detected in this layer 132 */ 133 private ConflictCollection conflicts; 116 134 117 135 /** … … 159 177 this.data = data; 160 178 this.setAssociatedFile(associatedFile); 179 conflicts = new ConflictCollection(); 161 180 } 162 181 … … 177 196 boolean active = Main.map.mapView.getActiveLayer() == this; 178 197 boolean inactive = !active && Main.pref.getBoolean("draw.data.inactive_color", true); 179 boolean virtual = !inactive && Main.map.mapView. useVirtualNodes();198 boolean virtual = !inactive && Main.map.mapView.isVirtualNodesEnabled(); 180 199 181 200 // draw the hatched area for non-downloaded region. only draw if we're the active … … 271 290 Main.map.mapView.repaint(); 272 291 273 if (visitor.getConflicts().isEmpty()) 274 return; 275 final ConflictDialog dlg = Main.map.conflictDialog; 276 dlg.add(visitor.getConflicts()); 277 JOptionPane.showMessageDialog(Main.parent,tr("There were {0} conflicts during import.", visitor.getConflicts().size())); 278 if (!dlg.isVisible()) { 279 dlg.action.actionPerformed(new ActionEvent(this, 0, "")); 292 int numNewConflicts = 0; 293 for (Conflict c : visitor.getConflicts()) { 294 if (!conflicts.hasConflict(c)) { 295 numNewConflicts++; 296 conflicts.add(c); 297 } 298 } 299 if (numNewConflicts > 0) { 300 JOptionPane.showMessageDialog(Main.parent,tr("There were {0} conflicts during import.", numNewConflicts)); 280 301 } 281 302 } … … 510 531 return layer_bounds_point; 511 532 } 533 534 /** 535 * replies the set of conflicts currently managed in this layer 536 * 537 * @return the set of conflicts currently managed in this layer 538 */ 539 public ConflictCollection getConflicts() { 540 return conflicts; 541 } 512 542 }
Note:
See TracChangeset
for help on using the changeset viewer.