Changeset 16629 in osm for applications
- Timestamp:
- 2009-07-21T22:06:43+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/validator
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/build.xml
r16409 r16629 26 26 <attribute name="Plugin-Description" value="An OSM data validator. It checks for problems in data, and provides fixes for the common ones. Spellcheck integrated for tag names."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Validator"/> 28 <attribute name="Plugin-Mainversion" value="1 755"/>28 <attribute name="Plugin-Mainversion" value="1815"/> 29 29 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 30 30 </manifest> -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/GridLayer.java
r16294 r16629 1 1 package org.openstreetmap.josm.plugins.validator; 2 2 3 import java.awt.*; 3 import java.awt.Color; 4 import java.awt.Component; 5 import java.awt.Graphics; 6 import java.awt.Point; 4 7 import java.awt.geom.Point2D; 5 8 … … 11 14 import org.openstreetmap.josm.actions.RenameLayerAction; 12 15 import org.openstreetmap.josm.data.coor.EastNorth; 13 import org.openstreetmap.josm.data.osm.*; 16 import org.openstreetmap.josm.data.osm.Node; 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 import org.openstreetmap.josm.data.osm.Relation; 19 import org.openstreetmap.josm.data.osm.Way; 20 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 14 21 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 15 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;16 22 import org.openstreetmap.josm.gui.MapView; 17 23 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; … … 65 71 g.setColor(Color.RED.darker().darker()); 66 72 HighlightCellVisitor visitor = new HighlightCellVisitor(g, mv, gridWidth); 67 for(OsmPrimitive p : Main. ds.getSelected() )73 for(OsmPrimitive p : Main.main.getCurrentDataSet().getSelected() ) 68 74 p.visit(visitor); 69 75 -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateAction.java
r13497 r16629 37 37 */ 38 38 public ValidateAction(OSMValidatorPlugin plugin) { 39 super(tr("Validation"), "validator", tr("Performs the data validation"), 39 super(tr("Validation"), "validator", tr("Performs the data validation"), 40 40 Shortcut.registerShortcut("tools:validate", tr("Tool: {0}", tr("Validation")), KeyEvent.VK_V, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true); 41 41 this.plugin = plugin; … … 68 68 Collection<OsmPrimitive> selection; 69 69 if (getSelectedItems) { 70 selection = Main. ds.getSelected();70 selection = Main.main.getCurrentDataSet().getSelected(); 71 71 if (selection.isEmpty()) { 72 selection = Main. ds.allNonDeletedPrimitives();72 selection = Main.main.getCurrentDataSet().allNonDeletedPrimitives(); 73 73 lastSelection = null; 74 74 } else { … … 79 79 } else { 80 80 if (lastSelection == null) 81 selection = Main. ds.allNonDeletedPrimitives();81 selection = Main.main.getCurrentDataSet().allNonDeletedPrimitives(); 82 82 else 83 83 selection = lastSelection; … … 109 109 plugin.validationDialog.tree.setErrors(errors); 110 110 plugin.validationDialog.setVisible(true); 111 DataSet.fireSelectionChanged(Main. ds.getSelected());111 DataSet.fireSelectionChanged(Main.main.getCurrentDataSet().getSelected()); 112 112 } 113 113 } -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateUploadHook.java
r14015 r16629 120 120 plugin.validationDialog.tree.setErrors(errors); 121 121 plugin.validationDialog.setVisible(true); 122 DataSet.fireSelectionChanged(Main. ds.getSelected());122 DataSet.fireSelectionChanged(Main.main.getCurrentDataSet().getSelected()); 123 123 } 124 124 return res == JOptionPane.YES_OPTION; -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java
r16290 r16629 42 42 * respects clicks into the selection list. Ctrl-click will remove entries from 43 43 * the list while single click will make the clicked entry the only selection. 44 * 44 * 45 45 * @author frsantos 46 46 */ … … 127 127 /** 128 128 * Fix selected errors 129 * 129 * 130 130 * @param e 131 131 */ … … 163 163 Main.map.repaint(); 164 164 tree.resetErrors(); 165 DataSet.fireSelectionChanged(Main. ds.getSelected());165 DataSet.fireSelectionChanged(Main.main.getCurrentDataSet().getSelected()); 166 166 } 167 167 168 168 /** 169 169 * Set selected errors to ignore state 170 * 170 * 171 171 * @param e 172 172 */ … … 295 295 } 296 296 297 Main. ds.setSelected(sel);297 Main.main.getCurrentDataSet().setSelected(sel); 298 298 } 299 299 … … 313 313 * Checks for fixes in selected element and, if needed, adds to the sel 314 314 * parameter all selected elements 315 * 315 * 316 316 * @param sel 317 317 * The collection where to add all selected elements … … 381 381 382 382 if (isDblClick) { 383 Main. ds.setSelected(sel);383 Main.main.getCurrentDataSet().setSelected(sel); 384 384 } 385 385 } -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/ChangePropertyKeyCommand.java
r13497 r16629 14 14 import org.openstreetmap.josm.command.Command; 15 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm. data.osm.visitor.NameVisitor;16 import org.openstreetmap.josm.plugins.validator.util.NameVisitor; 17 17 import org.openstreetmap.josm.tools.ImageProvider; 18 18 19 19 /** 20 20 * Command that replaces the key of several objects 21 * 21 * 22 22 */ 23 23 public class ChangePropertyKeyCommand extends Command { … … 34 34 */ 35 35 private final String newKey; 36 36 37 37 /** 38 38 * Constructor 39 * 39 * 40 40 * @param objects all objects subject to change replacement 41 41 * @param key The key to replace … … 47 47 this.newKey = newKey; 48 48 } 49 49 50 50 @Override public boolean executeCommand() { 51 51 if (!super.executeCommand()) return false; // save old 52 52 for (OsmPrimitive osm : objects) { 53 if(osm.keys != null) 53 if(osm.keys != null) 54 54 { 55 55 osm.modified = true; -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateNode.java
r16159 r16629 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.util.*; 5 import java.util.Collection; 6 import java.util.LinkedList; 7 import java.util.List; 6 8 7 9 import org.openstreetmap.josm.actions.MergeNodesAction; 8 import org.openstreetmap.josm.command. *;10 import org.openstreetmap.josm.command.Command; 9 11 import org.openstreetmap.josm.data.coor.LatLon; 10 import org.openstreetmap.josm.data.osm.*; 12 import org.openstreetmap.josm.data.osm.Node; 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 14 import org.openstreetmap.josm.plugins.validator.Severity; 12 15 import org.openstreetmap.josm.plugins.validator.Test; … … 90 93 target = nodes.iterator().next(); 91 94 92 MergeNodesAction.mergeNodes(nodes, target);95 new MergeNodesAction().mergeNodes(nodes, target); 93 96 94 97 return null; // undoRedo handling done in mergeNodes -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java
r16345 r16629 6 6 import java.awt.geom.Line2D; 7 7 import java.util.Arrays; 8 import java.util.Map;9 8 import java.util.HashMap; 10 9 import java.util.HashSet; 10 import java.util.Map; 11 11 import java.util.Set; 12 12 13 import org.openstreetmap.josm.Main; 13 14 import org.openstreetmap.josm.data.osm.Node; 14 15 import org.openstreetmap.josm.data.osm.OsmUtils; 15 16 import org.openstreetmap.josm.data.osm.Way; 16 import org.openstreetmap.josm.Main;17 17 import org.openstreetmap.josm.plugins.validator.PreferenceEditor; 18 18 import org.openstreetmap.josm.plugins.validator.Severity; … … 62 62 public void endTest() 63 63 { 64 Area a = Main. ds.getDataSourceArea();64 Area a = Main.main.getCurrentDataSet().getDataSourceArea(); 65 65 Map<Node, Way> map = new HashMap<Node, Way>(); 66 66 for(Node en : endnodes_highway) -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedNode.java
r14121 r16629 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.util.*; 5 import java.util.Collection; 6 import java.util.HashSet; 7 import java.util.Set; 6 8 7 9 import org.openstreetmap.josm.Main; … … 9 11 import org.openstreetmap.josm.command.DeleteCommand; 10 12 import org.openstreetmap.josm.data.osm.Node; 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 14 import org.openstreetmap.josm.data.osm.Way; 12 import org.openstreetmap.josm.data.osm.OsmPrimitive;13 15 import org.openstreetmap.josm.plugins.validator.Severity; 14 16 import org.openstreetmap.josm.plugins.validator.Test; … … 54 56 } 55 57 } 56 for (Way w : Main. ds.ways) {58 for (Way w : Main.main.getCurrentDataSet().ways) { 57 59 visit(w); 58 60 } -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedWay.java
r16434 r16629 115 115 { 116 116 multipolygonways = new LinkedList<Way>(); 117 for (final Relation r : Main. ds.relations)117 for (final Relation r : Main.main.getCurrentDataSet().relations) 118 118 { 119 119 if(!r.deleted && !r.incomplete && r.keys != null -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/MultipleNameVisitor.java
r13497 r16629 10 10 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 import org.openstreetmap.josm.data.osm.visitor.NameVisitor;13 12 import org.openstreetmap.josm.tools.ImageProvider; 14 13
Note:
See TracChangeset
for help on using the changeset viewer.