Changeset 6529 in josm


Ignore:
Timestamp:
2013-12-25T17:42:08+01:00 (6 years ago)
Author:
Don-vip
Message:

Various stuff:

  • see #9414: remove old DeprecatedTags test
  • refactor some classes in gui.preferences package
  • improve javadoc
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  
    1818import org.openstreetmap.josm.data.validation.util.AggregatePrimitivesVisitor;
    1919import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    20 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
     20import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    2121import org.openstreetmap.josm.gui.util.GuiHelper;
    2222import org.openstreetmap.josm.io.OsmTransferException;
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r6436 r6529  
    2424import org.openstreetmap.josm.gui.dialogs.validator.ValidatorTreePanel;
    2525import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    26 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
     26import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    2727import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    2828import org.openstreetmap.josm.tools.GBC;
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r6515 r6529  
    2929import org.openstreetmap.josm.data.validation.tests.Coastlines;
    3030import org.openstreetmap.josm.data.validation.tests.CrossingWays;
    31 import org.openstreetmap.josm.data.validation.tests.DeprecatedTags;
    3231import org.openstreetmap.josm.data.validation.tests.DuplicateNode;
    3332import org.openstreetmap.josm.data.validation.tests.DuplicateRelation;
     
    5958import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    6059import org.openstreetmap.josm.gui.layer.ValidatorLayer;
    61 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
    6260import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
     61import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    6362import org.openstreetmap.josm.tools.Utils;
    6463
     
    219218    }
    220219
    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
    224223     */
    225224    public static Map<String, Test> getAllTestsMap() {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r6513 r6529  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.validation.tests;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
     5
     6import java.io.InputStreamReader;
     7import java.io.Reader;
     8import java.io.UnsupportedEncodingException;
     9import java.util.ArrayList;
     10import java.util.Collection;
     11import java.util.HashMap;
     12import java.util.LinkedHashMap;
     13import java.util.LinkedList;
     14import java.util.List;
     15import java.util.Map;
    316
    417import org.openstreetmap.josm.command.ChangePropertyCommand;
     
    2740import org.openstreetmap.josm.tools.Utils;
    2841
    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 */
    4146public class MapCSSTagChecker extends Test {
    4247
     48    /**
     49     * Constructs a new {@code MapCSSTagChecker}.
     50     */
    4351    public MapCSSTagChecker() {
    4452        super(tr("Tag checker (new)"), tr("This test checks for errors in tag keys and values."));
     
    222230    }
    223231
     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     */
    224237    public void addMapCSS(Reader css) throws ParseException {
    225238        checks.addAll(TagCheck.readMapCSS(css));
    226239    }
    227240
     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
    228251    @Override
    229252    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");
    232255    }
    233256}
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r6494 r6529  
    5252import org.openstreetmap.josm.data.validation.TestError;
    5353import org.openstreetmap.josm.data.validation.util.Entities;
    54 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
    5554import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference;
     55import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    5656import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    5757import org.openstreetmap.josm.gui.tagging.TaggingPreset;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java

    r6528 r6529  
    2929import org.openstreetmap.josm.data.validation.Test;
    3030import org.openstreetmap.josm.data.validation.TestError;
    31 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
     31import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    3232import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3333
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r6436 r6529  
    4747import org.openstreetmap.josm.gui.layer.Layer;
    4848import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    49 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
     49import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    5050import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    5151import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java

    r6469 r6529  
    2929import org.openstreetmap.josm.data.validation.TestError;
    3030import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor;
    31 import org.openstreetmap.josm.gui.preferences.ValidatorPreference;
     31import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    3232import org.openstreetmap.josm.tools.Destroyable;
    3333import org.openstreetmap.josm.tools.MultiMap;
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r6523 r6529  
    3434import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    3535import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference;
     36import org.openstreetmap.josm.gui.preferences.audio.AudioPreference;
    3637import org.openstreetmap.josm.gui.preferences.display.ColorPreference;
    3738import org.openstreetmap.josm.gui.preferences.display.DisplayPreference;
     
    4445import org.openstreetmap.josm.gui.preferences.map.MapPreference;
    4546import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference;
     47import org.openstreetmap.josm.gui.preferences.plugin.PluginPreference;
    4648import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
     49import org.openstreetmap.josm.gui.preferences.remotecontrol.RemoteControlPreference;
    4750import org.openstreetmap.josm.gui.preferences.server.AuthenticationPreference;
    4851import org.openstreetmap.josm.gui.preferences.server.ProxyPreference;
     52import org.openstreetmap.josm.gui.preferences.server.ServerAccessPreference;
    4953import org.openstreetmap.josm.gui.preferences.shortcut.ShortcutPreference;
     54import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference;
    5055import org.openstreetmap.josm.plugins.PluginDownloadTask;
    5156import org.openstreetmap.josm.plugins.PluginHandler;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r6380 r6529  
    5050public final class AdvancedPreference extends DefaultTabPreferenceSetting {
    5151
     52    /**
     53     * Factory used to create a new {@code AdvancedPreference}.
     54     */
    5255    public static class Factory implements PreferenceSettingFactory {
    5356        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java

    r6525 r6529  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.gui.preferences;
     2package org.openstreetmap.josm.gui.preferences.audio;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    1212
    1313import org.openstreetmap.josm.Main;
     14import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
     15import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     16import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
     17import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    1418import org.openstreetmap.josm.gui.widgets.JosmTextField;
    1519import org.openstreetmap.josm.tools.GBC;
     
    2933public final class AudioPreference extends DefaultTabPreferenceSetting {
    3034
     35    /**
     36     * Factory used to create a new {@code AudioPreference}.
     37     */
    3138    public static class Factory implements PreferenceSettingFactory {
    3239        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r6380 r6529  
    5252public class ColorPreference implements SubPreferenceSetting {
    5353
     54    /**
     55     * Factory used to create a new {@code ColorPreference}.
     56     */
    5457    public static class Factory implements PreferenceSettingFactory {
    5558        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java

    r6380 r6529  
    1313
    1414public final class DisplayPreference extends DefaultTabPreferenceSetting {
     15
     16    /**
     17     * Factory used to create a new {@code DisplayPreference}.
     18     */
    1519    public static class Factory implements PreferenceSettingFactory {
    1620        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java

    r6380 r6529  
    2626public class DrawingPreference implements SubPreferenceSetting {
    2727
     28    /**
     29     * Factory used to create a new {@code DrawingPreference}.
     30     */
    2831    public static class Factory implements PreferenceSettingFactory {
    2932        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r6380 r6529  
    3131public class LafPreference implements SubPreferenceSetting {
    3232
     33    /**
     34     * Factory used to create a new {@code LafPreference}.
     35     */
    3336    public static class Factory implements PreferenceSettingFactory {
    3437        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java

    r6084 r6529  
    2929
    3030public class LanguagePreference implements SubPreferenceSetting {
     31
     32    /**
     33     * Factory used to create a new {@code LanguagePreference}.
     34     */
    3135    public static class Factory implements PreferenceSettingFactory {
    3236        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r6364 r6529  
    6868
    6969public final class ImageryPreference extends DefaultTabPreferenceSetting {
     70
     71    /**
     72     * Factory used to create a new {@code ImageryPreference}.
     73     */
    7074    public static class Factory implements PreferenceSettingFactory {
    7175        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java

    r6357 r6529  
    2929public class BackupPreference implements SubPreferenceSetting {
    3030
     31    /**
     32     * Factory used to create a new {@code BackupPreference}.
     33     */
    3134    public static class Factory implements PreferenceSettingFactory {
    3235        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r6380 r6529  
    4747    }
    4848
     49    /**
     50     * Factory used to create a new {@code MapPaintPreference}.
     51     */
    4952    public static class Factory implements PreferenceSettingFactory {
    5053        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java

    r6380 r6529  
    1313
    1414public final class MapPreference extends DefaultTabPreferenceSetting {
     15
     16    /**
     17     * Factory used to create a new {@code MapPreference}.
     18     */
    1519    public static class Factory implements PreferenceSettingFactory {
    1620        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r6380 r6529  
    4848public final class TaggingPresetPreference implements SubPreferenceSetting {
    4949
     50    /**
     51     * Factory used to create a new {@code TaggingPresetPreference}.
     52     */
    5053    public static class Factory implements PreferenceSettingFactory {
    5154        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java

    r6525 r6529  
    11//License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.gui.preferences;
     2package org.openstreetmap.josm.gui.preferences.plugin;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    4040import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    4141import org.openstreetmap.josm.gui.help.HelpUtil;
     42import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
     43import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     44import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
     45import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    4246import 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;
    4647import org.openstreetmap.josm.gui.util.GuiHelper;
    4748import org.openstreetmap.josm.gui.widgets.JosmTextField;
     
    5556
    5657public final class PluginPreference extends DefaultTabPreferenceSetting {
     58
     59    /**
     60     * Factory used to create a new {@code PluginPreference}.
     61     */
    5762    public static class Factory implements PreferenceSettingFactory {
    5863        @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r6488 r6529  
    5656public class ProjectionPreference implements SubPreferenceSetting {
    5757
     58    /**
     59     * Factory used to create a new {@code ProjectionPreference}.
     60     */
    5861    public static class Factory implements PreferenceSettingFactory {
    5962        @Override
     
    9194         * see http://www.epsg-registry.org/
    9295         */
    93         mercator = registerProjectionChoice(tr("Mercator"), "core:mercator",
    94                 3857);
     96        mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857);
    9597
    9698        /**
  • trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java

    r6525 r6529  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.gui.preferences;
     2package org.openstreetmap.josm.gui.preferences.remotecontrol;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    2121
    2222import org.openstreetmap.josm.Main;
     23import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
     24import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     25import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
     26import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    2327import org.openstreetmap.josm.gui.util.GuiHelper;
    2428import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
     
    2832
    2933/**
    30  * Preference settings for the Remote Control plugin
     34 * Preference settings for Remote Control.
    3135 *
    3236 * @author Frederik Ramm
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTask.java

    r6083 r6529  
    219219    }
    220220
     221    /**
     222     * Determines if the test has been canceled.
     223     * @return {@code true} if canceled, {@code false} otherwise
     224     */
    221225    public boolean isCanceled() {
    222226        return canceled;
    223227    }
    224228
     229    /**
     230     * Determines if the test has succeeded.
     231     * @return {@code true} if success, {@code false} otherwise
     232     */
    225233    public boolean isSuccess() {
    226234        return success;
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreference.java

    r6525 r6529  
    77import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
    88import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    9 import org.openstreetmap.josm.gui.preferences.ServerAccessPreference;
    109import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
    1110import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java

    r6267 r6529  
    8484    }
    8585
     86    /**
     87     * Constructs a new {@code BasicAuthenticationPreferencesPanel}.
     88     */
    8689    public BasicAuthenticationPreferencesPanel() {
    8790        build();
    8891    }
    8992
     93    /**
     94     * Inits contents from preferences.
     95     */
    9096    public void initFromPreferences() {
    9197        CredentialsAgent cm = CredentialsManager.getInstance();
     
    110116    }
    111117
     118    /**
     119     * Saves contents to preferences.
     120     */
    112121    public void saveToPreferences() {
    113122        CredentialsAgent cm = CredentialsManager.getInstance();
     
    125134    }
    126135
     136    /**
     137     * Clears the password field.
     138     */
    127139    public void clearPassword() {
    128140        tfOsmPassword.setText("");
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java

    r6248 r6529  
    1111import org.openstreetmap.josm.tools.CheckParameterUtil;
    1212
    13 
     13/**
     14 * Class holding OAuth access token key and secret.
     15 */
    1416public class OAuthAccessTokenHolder {
    1517    private  static OAuthAccessTokenHolder instance;
    1618
     19    /**
     20     * Replies the unique instance.
     21     * @return The unique instance of {@code OAuthAccessTokenHolder}
     22     */
    1723    public static OAuthAccessTokenHolder getInstance() {
    1824        if (instance == null) {
     
    8793    }
    8894
     95    /**
     96     * Replies the access token.
     97     * @return the access token, can be {@code null}
     98     */
    8999    public OAuthToken getAccessToken() {
    90100        if (!containsAccessToken())
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r6296 r6529  
    3030import org.openstreetmap.josm.gui.help.HelpUtil;
    3131import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator;
     32import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3233import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    3334import org.openstreetmap.josm.io.OsmApi;
    3435import 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 */
    3740public class OsmApiUrlInputPanel extends JPanel {
     41   
     42    /**
     43     * OSM API URL property key.
     44     */
    3845    static public final String API_URL_PROP = OsmApiUrlInputPanel.class.getName() + ".apiUrl";
    3946
     
    225232    }
    226233
     234    /**
     235     * Enables or disables the API URL input.
     236     * @param enabled {@code true} to enable input, {@code false} otherwise
     237     */
    227238    public void setApiUrlInputEnabled(boolean enabled) {
    228239        lblApiUrl.setEnabled(enabled);
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreference.java

    r6525 r6529  
    1010import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
    1111import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    12 import org.openstreetmap.josm.gui.preferences.ServerAccessPreference;
    1312import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
    1413import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java

    r6525 r6529  
    3636import org.openstreetmap.josm.tools.GBC;
    3737
     38/**
     39 * Component allowing input of proxy settings.
     40 */
    3841public class ProxyPreferencesPanel extends VerticallyScrollablePanel {
    3942
     43    /**
     44     * The proxy policy is how JOSM will use proxy information.
     45     */
    4046    public enum ProxyPolicy {
     47        /** No proxy: JOSM will access Internet resources directly */
    4148        NO_PROXY("no-proxy"),
     49        /** Use system settings: JOSM will use system proxy settings */
    4250        USE_SYSTEM_SETTINGS("use-system-settings"),
     51        /** Use HTTP proxy: JOSM will use the given HTTP proxy, configured manually */
    4352        USE_HTTP_PROXY("use-http-proxy"),
     53        /** Use HTTP proxy: JOSM will use the given SOCKS proxy */
    4454        USE_SOCKS_PROXY("use-socks-proxy");
    4555
     
    4959        }
    5060
     61        /**
     62         * Replies the policy name, to be stored in proxy preferences.
     63         * @return the policy unique name
     64         */
    5165        public String getName() {
    5266            return policyName;
    5367        }
    5468
     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         */
    5574        static public ProxyPolicy fromName(String policyName) {
    5675            if (policyName == null) return null;
     
    6483    }
    6584
     85    /** Property key for proxy policy */
    6686    public static final String PROXY_POLICY = "proxy.policy";
     87    /** Property key for HTTP proxy host */
    6788    public static final String PROXY_HTTP_HOST = "proxy.http.host";
     89    /** Property key for HTTP proxy port */
    6890    public static final String PROXY_HTTP_PORT = "proxy.http.port";
     91    /** Property key for SOCKS proxy host */
    6992    public static final String PROXY_SOCKS_HOST = "proxy.socks.host";
     93    /** Property key for SOCKS proxy port */
    7094    public static final String PROXY_SOCKS_PORT = "proxy.socks.port";
     95    /** Property key for proxy username */
    7196    public static final String PROXY_USER = "proxy.user";
     97    /** Property key for proxy password */
    7298    public static final String PROXY_PASS = "proxy.pass";
    7399
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreference.java

    r6525 r6529  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.gui.preferences;
     2package org.openstreetmap.josm.gui.preferences.server;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    1515
    1616import org.openstreetmap.josm.gui.help.HelpUtil;
    17 import org.openstreetmap.josm.gui.preferences.server.OsmApiUrlInputPanel;
     17import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
     18import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     19import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
     20import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    1821import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    1922
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/UserNameValidator.java

    r3083 r6529  
    88import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator;
    99
     10/**
     11 * Validator for OSM username.
     12 */
    1013public class UserNameValidator extends AbstractTextComponentValidator {
    1114
     15    /**
     16     * Constructs a new {@code UserNameValidator}.
     17     * @param tc the text component used to enter username
     18     */
    1219    public UserNameValidator(JTextComponent tc) {
    1320        super(tc);
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java

    r6335 r6529  
    5151/**
    5252 * This is the keyboard preferences content.
    53  * If someone wants to merge it with ShortcutPreference.java, feel free.
    5453 */
    5554public class PrefJPanel extends JPanel {
     
    6160    // on the physical keyboard. What language pack is installed in JOSM is completely
    6261    // 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.
    6563    private static String SHIFT = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.SHIFT_DOWN_MASK).getModifiers());
    6664    private static String CTRL  = KeyEvent.getKeyModifiersText(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_DOWN_MASK).getModifiers());
     
    106104
    107105    /** Creates new form prefJPanel */
    108     public PrefJPanel(AbstractTableModel model) {
    109         this.model = model;
     106    public PrefJPanel() {
     107        this.model = new ScListModel();
    110108        initComponents();
    111109    }
    112110
    113111    /**
    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
    115114     */
    116115    public void filter(String substring) {
    117116        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        }
    118146    }
    119147
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreference.java

    r6380 r6529  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.util.List;
    7 
    86import javax.swing.JPanel;
    9 import javax.swing.table.AbstractTableModel;
    107
    118import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
     
    1613import org.openstreetmap.josm.tools.Shortcut;
    1714
     15/**
     16 * Keyboard shortcut preferences.
     17 */
    1818public final class ShortcutPreference extends DefaultTabPreferenceSetting {
    1919
    2020    private String defaultFilter;
    2121
     22    /**
     23     * Factory used to create a new {@code ShortcutPreference}.
     24     */
    2225    public static class Factory implements PreferenceSettingFactory {
    2326        @Override
     
    2831
    2932    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=on
    31         // icon licence: GPL
    32         // icon designer: Paolino, http://www.paolinoland.it/
    33         // icon original filename: keyboard.png
    34         // icon original size: 128x128
    35         // modifications: icon was cropped, then resized
    3633        super("shortcuts", tr("Keyboard Shortcuts"), tr("Changing keyboard shortcuts manually."));
    3734    }
     
    4138        JPanel p = gui.createPreferenceTab(this);
    4239
    43         PrefJPanel prefpanel = new PrefJPanel(new ScListModel());
     40        PrefJPanel prefpanel = new PrefJPanel();
    4441        p.add(prefpanel, GBC.eol().fill(GBC.BOTH));
    45         if (defaultFilter!=null) prefpanel.filter(defaultFilter);
     42        if (defaultFilter != null) {
     43            prefpanel.filter(defaultFilter);
     44        }
    4645    }
    4746
     
    5150    }
    5251
     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     */
    5357    public void setDefaultFilter(String substring) {
    5458        defaultFilter = substring;
    5559    }
    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         @Override
    66         public int getColumnCount() {
    67             return columnNames.length;
    68         }
    69         @Override
    70         public int getRowCount() {
    71             return data.size();
    72         }
    73         @Override
    74         public String getColumnName(int col) {
    75             return columnNames[col];
    76         }
    77         @Override
    78         public Object getValueAt(int row, int col) {
    79             return (col==0)?  data.get(row).getLongText() : data.get(row);
    80         }
    81         @Override
    82         public boolean isCellEditable(int row, int col) {
    83             return false;
    84         }
    85     }
    8660}
  • trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreference.java

    r6525 r6529  
    11// License: GPL. See LICENSE file for details.
    2 package org.openstreetmap.josm.gui.preferences;
     2package org.openstreetmap.josm.gui.preferences.validator;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     
    1717import org.openstreetmap.josm.data.validation.OsmValidator;
    1818import org.openstreetmap.josm.data.validation.Test;
     19import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
     20import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     21import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
     22import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    1923import org.openstreetmap.josm.tools.GBC;
    2024
     
    2630public final class ValidatorPreference extends DefaultTabPreferenceSetting {
    2731
     32    /**
     33     * Factory used to create a new {@code ValidatorPreference}.
     34     */
    2835    public static class Factory implements PreferenceSettingFactory {
    2936        @Override
Note: See TracChangeset for help on using the changeset viewer.