Changeset 6529 in josm for trunk/src/org
- Timestamp:
- 2013-12-25T17:42:08+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 added
- 1 deleted
- 31 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
r6084 r6529 18 18 import org.openstreetmap.josm.data.validation.util.AggregatePrimitivesVisitor; 19 19 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 20 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 20 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 21 21 import org.openstreetmap.josm.gui.util.GuiHelper; 22 22 import org.openstreetmap.josm.io.OsmTransferException; -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r6436 r6529 24 24 import org.openstreetmap.josm.gui.dialogs.validator.ValidatorTreePanel; 25 25 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 26 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 26 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 27 27 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 28 28 import org.openstreetmap.josm.tools.GBC; -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r6515 r6529 29 29 import org.openstreetmap.josm.data.validation.tests.Coastlines; 30 30 import org.openstreetmap.josm.data.validation.tests.CrossingWays; 31 import org.openstreetmap.josm.data.validation.tests.DeprecatedTags;32 31 import org.openstreetmap.josm.data.validation.tests.DuplicateNode; 33 32 import org.openstreetmap.josm.data.validation.tests.DuplicateRelation; … … 59 58 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 60 59 import org.openstreetmap.josm.gui.layer.ValidatorLayer; 61 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;62 60 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 61 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 63 62 import org.openstreetmap.josm.tools.Utils; 64 63 … … 219 218 } 220 219 221 /** 222 * Gets a map from simple names to all tests. 223 * @return A map of all tests, indexed by the simple name of their Java class 220 /** 221 * Gets a map from simple names to all tests. 222 * @return A map of all tests, indexed by the simple name of their Java class 224 223 */ 225 224 public static Map<String, Test> getAllTestsMap() { -
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r6513 r6529 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.validation.tests; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import java.io.InputStreamReader; 7 import java.io.Reader; 8 import java.io.UnsupportedEncodingException; 9 import java.util.ArrayList; 10 import java.util.Collection; 11 import java.util.HashMap; 12 import java.util.LinkedHashMap; 13 import java.util.LinkedList; 14 import java.util.List; 15 import java.util.Map; 3 16 4 17 import org.openstreetmap.josm.command.ChangePropertyCommand; … … 27 40 import org.openstreetmap.josm.tools.Utils; 28 41 29 import java.io.InputStreamReader; 30 import java.io.Reader; 31 import java.util.ArrayList; 32 import java.util.Collection; 33 import java.util.HashMap; 34 import java.util.LinkedHashMap; 35 import java.util.LinkedList; 36 import java.util.List; 37 import java.util.Map; 38 39 import static org.openstreetmap.josm.tools.I18n.tr; 40 42 /** 43 * MapCSS-based tag checker/fixer. 44 * @since 6506 45 */ 41 46 public class MapCSSTagChecker extends Test { 42 47 48 /** 49 * Constructs a new {@code MapCSSTagChecker}. 50 */ 43 51 public MapCSSTagChecker() { 44 52 super(tr("Tag checker (new)"), tr("This test checks for errors in tag keys and values.")); … … 222 230 } 223 231 232 /** 233 * Adds a new MapCSS config file from the given {@code Reader}. 234 * @param css The reader 235 * @throws ParseException if the config file does not match MapCSS syntax 236 */ 224 237 public void addMapCSS(Reader css) throws ParseException { 225 238 checks.addAll(TagCheck.readMapCSS(css)); 226 239 } 227 240 241 /** 242 * Adds a new MapCSS config file from the given internal filename. 243 * @param internalConfigFile the filename in data/validator 244 * @throws ParseException if the config file does not match MapCSS syntax 245 * @throws UnsupportedEncodingException if UTF-8 charset is not supported on the platform 246 */ 247 private void addMapCSS(String internalConfigFile) throws ParseException, UnsupportedEncodingException { 248 addMapCSS(new InputStreamReader(getClass().getResourceAsStream("/data/validator/"+internalConfigFile), "UTF-8")); 249 } 250 228 251 @Override 229 252 public void initialize() throws Exception { 230 addMapCSS( new InputStreamReader(getClass().getResourceAsStream("/data/validator/deprecated.mapcss"), "UTF-8"));231 addMapCSS( new InputStreamReader(getClass().getResourceAsStream("/data/validator/highway.mapcss"), "UTF-8"));253 addMapCSS("deprecated.mapcss"); 254 addMapCSS("highway.mapcss"); 232 255 } 233 256 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r6494 r6529 52 52 import org.openstreetmap.josm.data.validation.TestError; 53 53 import org.openstreetmap.josm.data.validation.util.Entities; 54 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;55 54 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; 55 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 56 56 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 57 57 import org.openstreetmap.josm.gui.tagging.TaggingPreset; -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r6528 r6529 29 29 import org.openstreetmap.josm.data.validation.Test; 30 30 import org.openstreetmap.josm.data.validation.TestError; 31 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 31 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 32 32 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 33 33 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r6436 r6529 47 47 import org.openstreetmap.josm.gui.layer.Layer; 48 48 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 49 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 49 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 50 50 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 51 51 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; -
trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
r6469 r6529 29 29 import org.openstreetmap.josm.data.validation.TestError; 30 30 import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor; 31 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 31 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 32 32 import org.openstreetmap.josm.tools.Destroyable; 33 33 import org.openstreetmap.josm.tools.MultiMap; -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r6523 r6529 34 34 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 35 35 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference; 36 import org.openstreetmap.josm.gui.preferences.audio.AudioPreference; 36 37 import org.openstreetmap.josm.gui.preferences.display.ColorPreference; 37 38 import org.openstreetmap.josm.gui.preferences.display.DisplayPreference; … … 44 45 import org.openstreetmap.josm.gui.preferences.map.MapPreference; 45 46 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; 47 import org.openstreetmap.josm.gui.preferences.plugin.PluginPreference; 46 48 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 49 import org.openstreetmap.josm.gui.preferences.remotecontrol.RemoteControlPreference; 47 50 import org.openstreetmap.josm.gui.preferences.server.AuthenticationPreference; 48 51 import org.openstreetmap.josm.gui.preferences.server.ProxyPreference; 52 import org.openstreetmap.josm.gui.preferences.server.ServerAccessPreference; 49 53 import org.openstreetmap.josm.gui.preferences.shortcut.ShortcutPreference; 54 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 50 55 import org.openstreetmap.josm.plugins.PluginDownloadTask; 51 56 import org.openstreetmap.josm.plugins.PluginHandler; -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r6380 r6529 50 50 public final class AdvancedPreference extends DefaultTabPreferenceSetting { 51 51 52 /** 53 * Factory used to create a new {@code AdvancedPreference}. 54 */ 52 55 public static class Factory implements PreferenceSettingFactory { 53 56 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java
r6525 r6529 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm.gui.preferences; 2 package org.openstreetmap.josm.gui.preferences.audio; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 12 12 13 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 15 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 16 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 17 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 14 18 import org.openstreetmap.josm.gui.widgets.JosmTextField; 15 19 import org.openstreetmap.josm.tools.GBC; … … 29 33 public final class AudioPreference extends DefaultTabPreferenceSetting { 30 34 35 /** 36 * Factory used to create a new {@code AudioPreference}. 37 */ 31 38 public static class Factory implements PreferenceSettingFactory { 32 39 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r6380 r6529 52 52 public class ColorPreference implements SubPreferenceSetting { 53 53 54 /** 55 * Factory used to create a new {@code ColorPreference}. 56 */ 54 57 public static class Factory implements PreferenceSettingFactory { 55 58 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java
r6380 r6529 13 13 14 14 public final class DisplayPreference extends DefaultTabPreferenceSetting { 15 16 /** 17 * Factory used to create a new {@code DisplayPreference}. 18 */ 15 19 public static class Factory implements PreferenceSettingFactory { 16 20 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java
r6380 r6529 26 26 public class DrawingPreference implements SubPreferenceSetting { 27 27 28 /** 29 * Factory used to create a new {@code DrawingPreference}. 30 */ 28 31 public static class Factory implements PreferenceSettingFactory { 29 32 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r6380 r6529 31 31 public class LafPreference implements SubPreferenceSetting { 32 32 33 /** 34 * Factory used to create a new {@code LafPreference}. 35 */ 33 36 public static class Factory implements PreferenceSettingFactory { 34 37 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
r6084 r6529 29 29 30 30 public class LanguagePreference implements SubPreferenceSetting { 31 32 /** 33 * Factory used to create a new {@code LanguagePreference}. 34 */ 31 35 public static class Factory implements PreferenceSettingFactory { 32 36 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r6364 r6529 68 68 69 69 public final class ImageryPreference extends DefaultTabPreferenceSetting { 70 71 /** 72 * Factory used to create a new {@code ImageryPreference}. 73 */ 70 74 public static class Factory implements PreferenceSettingFactory { 71 75 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java
r6357 r6529 29 29 public class BackupPreference implements SubPreferenceSetting { 30 30 31 /** 32 * Factory used to create a new {@code BackupPreference}. 33 */ 31 34 public static class Factory implements PreferenceSettingFactory { 32 35 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r6380 r6529 47 47 } 48 48 49 /** 50 * Factory used to create a new {@code MapPaintPreference}. 51 */ 49 52 public static class Factory implements PreferenceSettingFactory { 50 53 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java
r6380 r6529 13 13 14 14 public final class MapPreference extends DefaultTabPreferenceSetting { 15 16 /** 17 * Factory used to create a new {@code MapPreference}. 18 */ 15 19 public static class Factory implements PreferenceSettingFactory { 16 20 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r6380 r6529 48 48 public final class TaggingPresetPreference implements SubPreferenceSetting { 49 49 50 /** 51 * Factory used to create a new {@code TaggingPresetPreference}. 52 */ 50 53 public static class Factory implements PreferenceSettingFactory { 51 54 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r6525 r6529 1 1 //License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm.gui.preferences; 2 package org.openstreetmap.josm.gui.preferences.plugin; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 40 40 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 41 41 import org.openstreetmap.josm.gui.help.HelpUtil; 42 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 43 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 44 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 45 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 42 46 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.PreferencePanel; 43 import org.openstreetmap.josm.gui.preferences.plugin.PluginListPanel;44 import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferencesModel;45 import org.openstreetmap.josm.gui.preferences.plugin.PluginUpdatePolicyPanel;46 47 import org.openstreetmap.josm.gui.util.GuiHelper; 47 48 import org.openstreetmap.josm.gui.widgets.JosmTextField; … … 55 56 56 57 public final class PluginPreference extends DefaultTabPreferenceSetting { 58 59 /** 60 * Factory used to create a new {@code PluginPreference}. 61 */ 57 62 public static class Factory implements PreferenceSettingFactory { 58 63 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r6488 r6529 56 56 public class ProjectionPreference implements SubPreferenceSetting { 57 57 58 /** 59 * Factory used to create a new {@code ProjectionPreference}. 60 */ 58 61 public static class Factory implements PreferenceSettingFactory { 59 62 @Override … … 91 94 * see http://www.epsg-registry.org/ 92 95 */ 93 mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 94 3857); 96 mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857); 95 97 96 98 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
r6525 r6529 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm.gui.preferences; 2 package org.openstreetmap.josm.gui.preferences.remotecontrol; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 21 21 22 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 24 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 25 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 26 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 23 27 import org.openstreetmap.josm.gui.util.GuiHelper; 24 28 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; … … 28 32 29 33 /** 30 * Preference settings for theRemote Controlplugin34 * Preference settings for Remote Control. 31 35 * 32 36 * @author Frederik Ramm -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTask.java
r6083 r6529 219 219 } 220 220 221 /** 222 * Determines if the test has been canceled. 223 * @return {@code true} if canceled, {@code false} otherwise 224 */ 221 225 public boolean isCanceled() { 222 226 return canceled; 223 227 } 224 228 229 /** 230 * Determines if the test has succeeded. 231 * @return {@code true} if success, {@code false} otherwise 232 */ 225 233 public boolean isSuccess() { 226 234 return success; -
trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreference.java
r6525 r6529 7 7 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 8 8 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 import org.openstreetmap.josm.gui.preferences.ServerAccessPreference;10 9 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 11 10 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; -
trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
r6267 r6529 84 84 } 85 85 86 /** 87 * Constructs a new {@code BasicAuthenticationPreferencesPanel}. 88 */ 86 89 public BasicAuthenticationPreferencesPanel() { 87 90 build(); 88 91 } 89 92 93 /** 94 * Inits contents from preferences. 95 */ 90 96 public void initFromPreferences() { 91 97 CredentialsAgent cm = CredentialsManager.getInstance(); … … 110 116 } 111 117 118 /** 119 * Saves contents to preferences. 120 */ 112 121 public void saveToPreferences() { 113 122 CredentialsAgent cm = CredentialsManager.getInstance(); … … 125 134 } 126 135 136 /** 137 * Clears the password field. 138 */ 127 139 public void clearPassword() { 128 140 tfOsmPassword.setText(""); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java
r6248 r6529 11 11 import org.openstreetmap.josm.tools.CheckParameterUtil; 12 12 13 13 /** 14 * Class holding OAuth access token key and secret. 15 */ 14 16 public class OAuthAccessTokenHolder { 15 17 private static OAuthAccessTokenHolder instance; 16 18 19 /** 20 * Replies the unique instance. 21 * @return The unique instance of {@code OAuthAccessTokenHolder} 22 */ 17 23 public static OAuthAccessTokenHolder getInstance() { 18 24 if (instance == null) { … … 87 93 } 88 94 95 /** 96 * Replies the access token. 97 * @return the access token, can be {@code null} 98 */ 89 99 public OAuthToken getAccessToken() { 90 100 if (!containsAccessToken()) -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
r6296 r6529 30 30 import org.openstreetmap.josm.gui.help.HelpUtil; 31 31 import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator; 32 import org.openstreetmap.josm.gui.widgets.JosmTextField; 32 33 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 33 34 import org.openstreetmap.josm.io.OsmApi; 34 35 import org.openstreetmap.josm.tools.ImageProvider; 35 import org.openstreetmap.josm.gui.widgets.JosmTextField; 36 36 37 /** 38 * Component allowing input os OSM API URL. 39 */ 37 40 public class OsmApiUrlInputPanel extends JPanel { 41 42 /** 43 * OSM API URL property key. 44 */ 38 45 static public final String API_URL_PROP = OsmApiUrlInputPanel.class.getName() + ".apiUrl"; 39 46 … … 225 232 } 226 233 234 /** 235 * Enables or disables the API URL input. 236 * @param enabled {@code true} to enable input, {@code false} otherwise 237 */ 227 238 public void setApiUrlInputEnabled(boolean enabled) { 228 239 lblApiUrl.setEnabled(enabled); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreference.java
r6525 r6529 10 10 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 11 11 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 12 import org.openstreetmap.josm.gui.preferences.ServerAccessPreference;13 12 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 14 13 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
r6525 r6529 36 36 import org.openstreetmap.josm.tools.GBC; 37 37 38 /** 39 * Component allowing input of proxy settings. 40 */ 38 41 public class ProxyPreferencesPanel extends VerticallyScrollablePanel { 39 42 43 /** 44 * The proxy policy is how JOSM will use proxy information. 45 */ 40 46 public enum ProxyPolicy { 47 /** No proxy: JOSM will access Internet resources directly */ 41 48 NO_PROXY("no-proxy"), 49 /** Use system settings: JOSM will use system proxy settings */ 42 50 USE_SYSTEM_SETTINGS("use-system-settings"), 51 /** Use HTTP proxy: JOSM will use the given HTTP proxy, configured manually */ 43 52 USE_HTTP_PROXY("use-http-proxy"), 53 /** Use HTTP proxy: JOSM will use the given SOCKS proxy */ 44 54 USE_SOCKS_PROXY("use-socks-proxy"); 45 55 … … 49 59 } 50 60 61 /** 62 * Replies the policy name, to be stored in proxy preferences. 63 * @return the policy unique name 64 */ 51 65 public String getName() { 52 66 return policyName; 53 67 } 54 68 69 /** 70 * Retrieves a proxy policy from its name found in preferences. 71 * @param policyName The policy name 72 * @return The proxy policy matching the given name, or {@code null} 73 */ 55 74 static public ProxyPolicy fromName(String policyName) { 56 75 if (policyName == null) return null; … … 64 83 } 65 84 85 /** Property key for proxy policy */ 66 86 public static final String PROXY_POLICY = "proxy.policy"; 87 /** Property key for HTTP proxy host */ 67 88 public static final String PROXY_HTTP_HOST = "proxy.http.host"; 89 /** Property key for HTTP proxy port */ 68 90 public static final String PROXY_HTTP_PORT = "proxy.http.port"; 91 /** Property key for SOCKS proxy host */ 69 92 public static final String PROXY_SOCKS_HOST = "proxy.socks.host"; 93 /** Property key for SOCKS proxy port */ 70 94 public static final String PROXY_SOCKS_PORT = "proxy.socks.port"; 95 /** Property key for proxy username */ 71 96 public static final String PROXY_USER = "proxy.user"; 97 /** Property key for proxy password */ 72 98 public static final String PROXY_PASS = "proxy.pass"; 73 99 -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreference.java
r6525 r6529 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm.gui.preferences; 2 package org.openstreetmap.josm.gui.preferences.server; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 15 15 16 16 import org.openstreetmap.josm.gui.help.HelpUtil; 17 import org.openstreetmap.josm.gui.preferences.server.OsmApiUrlInputPanel; 17 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 18 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 19 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 20 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 18 21 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 19 22 -
trunk/src/org/openstreetmap/josm/gui/preferences/server/UserNameValidator.java
r3083 r6529 8 8 import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator; 9 9 10 /** 11 * Validator for OSM username. 12 */ 10 13 public class UserNameValidator extends AbstractTextComponentValidator { 11 14 15 /** 16 * Constructs a new {@code UserNameValidator}. 17 * @param tc the text component used to enter username 18 */ 12 19 public UserNameValidator(JTextComponent tc) { 13 20 super(tc); -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r6335 r6529 51 51 /** 52 52 * This is the keyboard preferences content. 53 * If someone wants to merge it with ShortcutPreference.java, feel free.54 53 */ 55 54 public class PrefJPanel extends JPanel { … … 61 60 // on the physical keyboard. What language pack is installed in JOSM is completely 62 61 // independent from the keyboard's labelling. But the operation system's locale 63 // usually matches the keyboard. This even works with my English Windows and my German 64 // keyboard. 62 // usually matches the keyboard. This even works with my English Windows and my German keyboard. 65 63 private static String SHIFT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers()); 66 64 private static String CTRL = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers()); … … 106 104 107 105 /** Creates new form prefJPanel */ 108 public PrefJPanel( AbstractTableModel model) {109 this.model = model;106 public PrefJPanel() { 107 this.model = new ScListModel(); 110 108 initComponents(); 111 109 } 112 110 113 111 /** 114 * Show only shortcuts with descriptions coontaing given substring 112 * Show only shortcuts with descriptions containing given substring 113 * @param substring The substring used to filter 115 114 */ 116 115 public void filter(String substring) { 117 116 filterField.setText(substring); 117 } 118 119 private static class ScListModel extends AbstractTableModel { 120 private String[] columnNames = new String[]{tr("Action"), tr("Shortcut")}; 121 private List<Shortcut> data; 122 123 public ScListModel() { 124 data = Shortcut.listAll(); 125 } 126 @Override 127 public int getColumnCount() { 128 return columnNames.length; 129 } 130 @Override 131 public int getRowCount() { 132 return data.size(); 133 } 134 @Override 135 public String getColumnName(int col) { 136 return columnNames[col]; 137 } 138 @Override 139 public Object getValueAt(int row, int col) { 140 return (col==0)? data.get(row).getLongText() : data.get(row); 141 } 142 @Override 143 public boolean isCellEditable(int row, int col) { 144 return false; 145 } 118 146 } 119 147 -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreference.java
r6380 r6529 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.List;7 8 6 import javax.swing.JPanel; 9 import javax.swing.table.AbstractTableModel;10 7 11 8 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; … … 16 13 import org.openstreetmap.josm.tools.Shortcut; 17 14 15 /** 16 * Keyboard shortcut preferences. 17 */ 18 18 public final class ShortcutPreference extends DefaultTabPreferenceSetting { 19 19 20 20 private String defaultFilter; 21 21 22 /** 23 * Factory used to create a new {@code ShortcutPreference}. 24 */ 22 25 public static class Factory implements PreferenceSettingFactory { 23 26 @Override … … 28 31 29 32 private ShortcutPreference() { 30 // icon source: http://www.iconfinder.net/index.php?q=key&page=icondetails&iconid=8553&size=128&q=key&s12=on&s16=on&s22=on&s32=on&s48=on&s64=on&s128=on31 // icon licence: GPL32 // icon designer: Paolino, http://www.paolinoland.it/33 // icon original filename: keyboard.png34 // icon original size: 128x12835 // modifications: icon was cropped, then resized36 33 super("shortcuts", tr("Keyboard Shortcuts"), tr("Changing keyboard shortcuts manually.")); 37 34 } … … 41 38 JPanel p = gui.createPreferenceTab(this); 42 39 43 PrefJPanel prefpanel = new PrefJPanel( new ScListModel());40 PrefJPanel prefpanel = new PrefJPanel(); 44 41 p.add(prefpanel, GBC.eol().fill(GBC.BOTH)); 45 if (defaultFilter!=null) prefpanel.filter(defaultFilter); 42 if (defaultFilter != null) { 43 prefpanel.filter(defaultFilter); 44 } 46 45 } 47 46 … … 51 50 } 52 51 52 /** 53 * Sets the default filter used to show only shortcuts with descriptions containing given substring. 54 * @param substring The substring used to filter 55 * @see PrefJPanel#filter(String) 56 */ 53 57 public void setDefaultFilter(String substring) { 54 58 defaultFilter = substring; 55 59 } 56 57 // Maybe move this to prefPanel? There's no need for it to be here.58 private static class ScListModel extends AbstractTableModel {59 private String[] columnNames = new String[]{tr("Action"), tr("Shortcut")};60 private List<Shortcut> data;61 62 public ScListModel() {63 data = Shortcut.listAll();64 }65 @Override66 public int getColumnCount() {67 return columnNames.length;68 }69 @Override70 public int getRowCount() {71 return data.size();72 }73 @Override74 public String getColumnName(int col) {75 return columnNames[col];76 }77 @Override78 public Object getValueAt(int row, int col) {79 return (col==0)? data.get(row).getLongText() : data.get(row);80 }81 @Override82 public boolean isCellEditable(int row, int col) {83 return false;84 }85 }86 60 } -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreference.java
r6525 r6529 1 1 // License: GPL. See LICENSE file for details. 2 package org.openstreetmap.josm.gui.preferences; 2 package org.openstreetmap.josm.gui.preferences.validator; 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 17 17 import org.openstreetmap.josm.data.validation.OsmValidator; 18 18 import org.openstreetmap.josm.data.validation.Test; 19 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 20 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 21 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 22 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 19 23 import org.openstreetmap.josm.tools.GBC; 20 24 … … 26 30 public final class ValidatorPreference extends DefaultTabPreferenceSetting { 27 31 32 /** 33 * Factory used to create a new {@code ValidatorPreference}. 34 */ 28 35 public static class Factory implements PreferenceSettingFactory { 29 36 @Override
Note:
See TracChangeset
for help on using the changeset viewer.