Changeset 3707 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-12-08T11:02:25+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 14 added
- 6 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. -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r3686 r3707 39 39 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory; 40 40 import org.openstreetmap.josm.io.auth.DefaultAuthenticator; 41 import org.openstreetmap.josm.io.remotecontrol.RemoteControl; 41 42 import org.openstreetmap.josm.plugins.PluginHandler; 42 43 import org.openstreetmap.josm.plugins.PluginInformation; … … 220 221 monitor.worked(1); 221 222 223 if (RemoteControl.on && RemoteControl.PROP_REMOTECONTROL_ENABLED.get()) { 224 RemoteControl.start(); 225 } 226 222 227 monitor.indeterminateSubTask(tr("Creating main GUI")); 223 228 JFrame mainFrame = new JFrame(tr("Java OpenStreetMap Editor")); -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r3669 r3707 26 26 27 27 import org.openstreetmap.josm.Main; 28 import org.openstreetmap.josm.io.remotecontrol.RemoteControl; 28 29 import org.openstreetmap.josm.plugins.PluginDownloadTask; 29 30 import org.openstreetmap.josm.plugins.PluginHandler; … … 226 227 PreferenceSetting setting = factory.createPreferenceSetting(); 227 228 if (setting != null) { 228 settings.add( factory.createPreferenceSetting());229 settings.add(setting); 229 230 } 230 231 } … … 277 278 settingsFactory.add(new ShortcutPreference.Factory()); 278 279 settingsFactory.add(new ValidatorPreference.Factory()); 280 if (RemoteControl.on) { 281 settingsFactory.add(new RemoteControlPreference.Factory()); 282 } 279 283 280 284 PluginHandler.getPreferenceSetting(settingsFactory); -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r3612 r3707 7 7 8 8 import java.awt.Component; 9 import java.awt.Container;10 9 import java.awt.GridBagLayout; 11 10 import java.awt.Image; … … 61 60 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPritority; 62 61 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 62 import org.openstreetmap.josm.gui.util.GuiHelper; 63 63 import org.openstreetmap.josm.io.MirroredInputStream; 64 64 import org.openstreetmap.josm.tools.GBC; … … 896 896 p.add(items, GBC.eol().fill()); 897 897 if (selected.size() == 0 && !supportsRelation()) { 898 setEnabledRec(items, false);898 GuiHelper.setEnabledRec(items, false); 899 899 } 900 900 … … 904 904 905 905 return p; 906 }907 908 /**909 * setEnabled() does not propagate to child elements, so we need this workaround.910 */911 static void setEnabledRec(Container root, boolean enabled) {912 root.setEnabled(enabled);913 Component children[] = root.getComponents();914 for(int i = 0; i < children.length; i++) {915 if(children[i] instanceof Container) {916 setEnabledRec((Container)children[i], enabled);917 } else {918 children[i].setEnabled(enabled);919 }920 }921 906 } 922 907
Note:
See TracChangeset
for help on using the changeset viewer.