Last change
on this file since 319 was 298, checked in by imi, 17 years ago |
- added license description to head of each source file
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | package org.openstreetmap.josm.data;
|
---|
3 |
|
---|
4 | import java.util.HashSet;
|
---|
5 | import java.util.Set;
|
---|
6 |
|
---|
7 | import javax.swing.JOptionPane;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.Main;
|
---|
10 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
11 | import org.openstreetmap.josm.gui.layer.Layer;
|
---|
12 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
13 |
|
---|
14 | public 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.