source: josm/trunk/src/org/openstreetmap/josm/data/DataSetChecker.java@ 1180

Last change on this file since 1180 was 1169, checked in by stoecker, 15 years ago

removed usage of tab stops

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.data;
3
4import java.util.HashSet;
5import java.util.Set;
6
7import javax.swing.JOptionPane;
8
9import org.openstreetmap.josm.Main;
10import org.openstreetmap.josm.data.osm.OsmPrimitive;
11import org.openstreetmap.josm.gui.layer.Layer;
12import org.openstreetmap.josm.gui.layer.OsmDataLayer;
13
14public class DataSetChecker {
15
16 public static void check() {
17 if (Main.map == null)
18 return;
19
20 Set<OsmPrimitive> s = new HashSet<OsmPrimitive>();
21 for (Layer l : Main.map.mapView.getAllLayers()) {
22 if (l instanceof OsmDataLayer) {
23 for (OsmPrimitive osm : ((OsmDataLayer)l).data.allPrimitives()) {
24 if (s.contains(osm)) {
25 JOptionPane.showMessageDialog(Main.parent, "cross references");
26 return;
27 }
28 s.add(osm);
29 }
30 }
31 }
32
33 if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {
34 OsmDataLayer l = (OsmDataLayer)Main.map.mapView.getActiveLayer();
35 if (l.data != Main.ds) {
36 JOptionPane.showMessageDialog(Main.parent, "Main.ds / active layer mismatch");
37 return;
38 }
39 }
40
41 JOptionPane.showMessageDialog(Main.parent, "working");
42 }
43}
Note: See TracBrowser for help on using the repository browser.