Changeset 3707 in josm for trunk/src/org/openstreetmap/josm/data/validation
- Timestamp:
- 2010-12-08T11:02:25+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r3671 r3707 46 46 import org.openstreetmap.josm.data.validation.tests.UntaggedWay; 47 47 import org.openstreetmap.josm.data.validation.tests.WronglyOrderedWays; 48 import org.openstreetmap.josm.data.validation.util.ValUtil;49 48 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 50 import org.openstreetmap.josm.gui.dialogs.ValidatorDialog;51 49 import org.openstreetmap.josm.gui.layer.ValidatorLayer; 52 50 import org.openstreetmap.josm.gui.layer.Layer; … … 66 64 /** The validate action */ 67 65 public ValidateAction validateAction = new ValidateAction(); 68 69 /** The validation dialog */70 ValidatorDialog validationDialog;71 66 72 67 /** Grid detail, multiplier of east,north values for valuable cell sizing */ … … 103 98 104 99 public OsmValidator() { 105 check PluginDir();100 checkValidatorDir(); 106 101 initializeGridDetail(); 107 102 initializeTests(getTests()); … … 110 105 111 106 /** 107 * Returns the plugin's directory of the plugin 108 * 109 * @return The directory of the plugin 110 */ 111 public static String getValidatorDir() 112 { 113 return Main.pref.getPreferencesDir() + "validator/"; 114 } 115 116 /** 112 117 * Check if plugin directory exists (store ignored errors file) 113 118 */ 114 private void check PluginDir() {119 private void checkValidatorDir() { 115 120 try { 116 File pathDir = new File( ValUtil.getPluginDir());121 File pathDir = new File(getValidatorDir()); 117 122 if (!pathDir.exists()) { 118 123 pathDir.mkdirs(); … … 127 132 if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) { 128 133 try { 129 final BufferedReader in = new BufferedReader(new FileReader( ValUtil.getPluginDir() + "ignorederrors"));134 final BufferedReader in = new BufferedReader(new FileReader(getValidatorDir() + "ignorederrors")); 130 135 for (String line = in.readLine(); line != null; line = in.readLine()) { 131 136 ignoredErrors.add(line); … … 149 154 public static void saveIgnoredErrors() { 150 155 try { 151 final PrintWriter out = new PrintWriter(new FileWriter( ValUtil.getPluginDir() + "ignorederrors"), false);156 final PrintWriter out = new PrintWriter(new FileWriter(getValidatorDir() + "ignorederrors"), false); 152 157 for (String e : ignoredErrors) { 153 158 out.println(e); -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r3674 r3707 48 48 import org.openstreetmap.josm.data.osm.Relation; 49 49 import org.openstreetmap.josm.data.osm.Way; 50 import org.openstreetmap.josm.data.validation.OsmValidator; 50 51 import org.openstreetmap.josm.data.validation.Severity; 51 52 import org.openstreetmap.josm.data.validation.Test; 52 53 import org.openstreetmap.josm.data.validation.TestError; 53 54 import org.openstreetmap.josm.data.validation.util.Entities; 54 import org.openstreetmap.josm.data.validation.util.ValUtil;55 55 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 56 56 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference; … … 199 199 for (String source : sources.split(";")) { 200 200 try { 201 MirroredInputStream s = new MirroredInputStream(source, ValUtil.getPluginDir(), -1);201 MirroredInputStream s = new MirroredInputStream(source, OsmValidator.getValidatorDir(), -1); 202 202 InputStreamReader r; 203 203 try { -
trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java
r3671 r3707 10 10 import java.util.Set; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.osm.Node; 14 13 import org.openstreetmap.josm.data.osm.Way; … … 22 21 public class ValUtil 23 22 { 24 /**25 * Returns the plugin's directory of the plugin26 *27 * @return The directory of the plugin28 */29 public static String getPluginDir()30 {31 return Main.pref.getPreferencesDir() + "validator/";32 }33 34 23 /** 35 24 * Returns the start and end cells of a way.
Note:
See TracChangeset
for help on using the changeset viewer.