Changeset 2500 in josm
- Timestamp:
- 2009-11-22T16:25:26+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r2369 r2500 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;6 6 7 7 import java.awt.Dimension; … … 22 22 import org.openstreetmap.josm.Main; 23 23 import org.openstreetmap.josm.data.Version; 24 import org.openstreetmap.josm.data.osm.DataSet; 25 import org.openstreetmap.josm.data.osm.DatasetConsistencyTest; 24 26 import org.openstreetmap.josm.gui.ExtendedDialog; 25 27 import org.openstreetmap.josm.plugins.PluginHandler; … … 59 61 text.append("Java version: " + System.getProperty("java.version")); 60 62 text.append("\n\n"); 63 DataSet dataset = Main.main.getCurrentDataSet(); 64 if (dataset != null) { 65 text.append("Dataset consistency test:\n"); 66 String result = DatasetConsistencyTest.runTests(dataset); 67 if (result.length() == 0) { 68 text.append("No problems found\n"); 69 } else { 70 text.append(result); 71 } 72 text.append("\n"); 73 } 74 text.append("\n"); 61 75 text.append(PluginHandler.getBugReportText()); 62 text.append("\n\n"); 76 text.append("\n"); 77 63 78 return text.toString(); 64 79 } -
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r2450 r2500 102 102 103 103 public boolean inside(BBox b) { 104 if (xmin > =b.xmax)104 if (xmin > b.xmax) 105 105 return false; 106 if (xmax < =b.xmin)106 if (xmax < b.xmin) 107 107 return false; 108 if (ymin > =b.ymax)108 if (ymin > b.ymax) 109 109 return false; 110 if (ymax < =b.ymin)110 if (ymax < b.ymin) 111 111 return false; 112 112 return true; -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r2450 r2500 34 34 import javax.swing.JOptionPane; 35 35 import javax.swing.JPanel; 36 import javax.swing.JScrollPane; 36 37 import javax.swing.JSeparator; 38 import javax.swing.JTextArea; 37 39 38 40 import org.openstreetmap.josm.Main; … … 51 53 import org.openstreetmap.josm.data.osm.DataSetMerger; 52 54 import org.openstreetmap.josm.data.osm.DataSource; 55 import org.openstreetmap.josm.data.osm.DatasetConsistencyTest; 53 56 import org.openstreetmap.josm.data.osm.Node; 54 57 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 232 235 233 236 // paint remainder 234 ((Graphics2D)g).setPaint(hatched);235 ((Graphics2D)g).fill(a);237 g.setPaint(hatched); 238 g.fill(a); 236 239 } 237 240 … … 536 539 new JSeparator(), 537 540 new JMenuItem(new RenameLayerAction(getAssociatedFile(), this)), 541 new JMenuItem(new ConsistencyTestAction()), 538 542 new JSeparator(), 539 543 new JMenuItem(new LayerListPopup.InfoAction(this))}; … … 550 554 new JSeparator(), 551 555 new JMenuItem(new RenameLayerAction(getAssociatedFile(), this)), 556 new JMenuItem(new ConsistencyTestAction()), 552 557 new JSeparator(), 553 558 new JMenuItem(new LayerListPopup.InfoAction(this))}; … … 614 619 wpt.attr.put("name", name); 615 620 } 616 ;617 621 } 618 622 return gpxData; … … 714 718 // keep requiresSaveToDisk unchanged 715 719 } 720 721 private class ConsistencyTestAction extends AbstractAction { 722 723 public ConsistencyTestAction() { 724 super(tr("Dataset consistency test")); 725 } 726 727 public void actionPerformed(ActionEvent e) { 728 String result = DatasetConsistencyTest.runTests(data); 729 if (result.length() == 0) { 730 JOptionPane.showMessageDialog(Main.parent, tr("No problems found")); 731 } else { 732 JPanel p = new JPanel(new GridBagLayout()); 733 p.add(new JLabel(tr("Following problems found:")), GBC.eol()); 734 JTextArea info = new JTextArea(result, 20, 60); 735 info.setCaretPosition(0); 736 info.setEditable(false); 737 p.add(new JScrollPane(info), GBC.eop()); 738 739 JOptionPane.showMessageDialog(Main.parent, p, tr("Warning"), JOptionPane.WARNING_MESSAGE); 740 } 741 } 742 743 } 716 744 }
Note:
See TracChangeset
for help on using the changeset viewer.