Changeset 6143 in josm for trunk/src/org


Ignore:
Timestamp:
2013-08-11T23:47:22+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8885 - cleanup in command line arguments and website URL handling

Location:
trunk/src/org/openstreetmap/josm
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r6125 r6143  
    6969import org.openstreetmap.josm.gui.NavigatableComponent.ViewportData;
    7070import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
     71import org.openstreetmap.josm.gui.help.HelpUtil;
    7172import org.openstreetmap.josm.gui.io.SaveLayersDialog;
    7273import org.openstreetmap.josm.gui.layer.Layer;
     
    101102abstract public class Main {
    102103
     104    /**
     105     * The JOSM website URL.
     106     * @since 6143
     107     */
     108    public static final String JOSM_WEBSITE = "http://josm.openstreetmap.de";
     109   
    103110    /**
    104111     * Replies true if JOSM currently displays a map view. False, if it doesn't, i.e. if
     
    922929                                "<li>use an earlier (Java 5 compatible) version of JOSM.</li></ul>"+
    923930                                "More Info:", version)+"</html>");
    924                 JTextArea link = new JTextArea("http://josm.openstreetmap.de/wiki/Help/SystemRequirements");
     931                JTextArea link = new JTextArea(HelpUtil.getWikiBaseHelpUrl()+"/Help/SystemRequirements");
    925932                link.setEditable(false);
    926933                link.setBackground(panel.getBackground());
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r6084 r6143  
    8585        info.add(GBC.glue(0,10), GBC.eol());
    8686        info.add(new JLabel(tr("Homepage")), GBC.std().insets(10,0,10,0));
    87         info.add(new UrlLabel("http://josm.openstreetmap.de",2), GBC.eol().fill(GBC.HORIZONTAL));
     87        info.add(new UrlLabel(Main.JOSM_WEBSITE,2), GBC.eol().fill(GBC.HORIZONTAL));
    8888        info.add(GBC.glue(0,5), GBC.eol());
    8989        info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(10,0,10,0));
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r6142 r6143  
    13701370     */
    13711371    private final static String[] DEFAULT_PLUGIN_SITE = {
    1372     "http://josm.openstreetmap.de/plugin%<?plugins=>"};
     1372    Main.JOSM_WEBSITE+"/plugin%<?plugins=>"};
    13731373
    13741374    /**
     
    16121612        StringBuilder b = new StringBuilder(
    16131613                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
    1614                 "<preferences xmlns=\"http://josm.openstreetmap.de/preferences-1.0\" version=\""+
     1614                "<preferences xmlns=\""+Main.JOSM_WEBSITE+"/preferences-1.0\" version=\""+
    16151615                Version.getInstance().getVersion() + "\">\n");
    16161616        SettingToXml toXml = new SettingToXml(b, nopass);
    1617         Map<String, Setting> settings = new TreeMap<String, Setting>();
     1617        Map<String, Setting<?>> settings = new TreeMap<String, Setting<?>>();
    16181618
    16191619        for (Entry<String, String> e : properties.entrySet()) {
     
    16291629            settings.put(e.getKey(), new MapListSetting(e.getValue()));
    16301630        }
    1631         for (Entry<String, Setting> e : settings.entrySet()) {
     1631        for (Entry<String, Setting<?>> e : settings.entrySet()) {
    16321632            toXml.setKey(e.getKey());
    16331633            e.getValue().visit(toXml);
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxConstants.java

    r5910 r6143  
    44import java.util.Arrays;
    55import java.util.List;
     6
     7import org.openstreetmap.josm.Main;
    68
    79/**
     
    2426    public static final String META_EXTENSIONS = META_PREFIX + "extensions";
    2527
    26     public static final String JOSM_EXTENSIONS_NAMESPACE_URI = "http://josm.openstreetmap.de/gpx-extensions-1.0";
     28    public static final String JOSM_EXTENSIONS_NAMESPACE_URI = Main.JOSM_WEBSITE + "/gpx-extensions-1.0";
    2729
    2830    public static List<String> WPT_KEYS = Arrays.asList("ele", "time", "magvar", "geoidheight",
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r6093 r6143  
    2727
    2828    private final static String[] DEFAULT_LAYER_SITES = {
    29         "http://josm.openstreetmap.de/maps"
     29        Main.JOSM_WEBSITE+"/maps"
    3030    };
    3131
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r6084 r6143  
    152152
    153153    private String fixImageLinks(String s) {
    154         Matcher m = Pattern.compile("src=\"http://josm.openstreetmap.de/browser/trunk(/images/.*?\\.png)\\?format=raw\"").matcher(s);
     154        Matcher m = Pattern.compile("src=\""+Main.JOSM_WEBSITE+"/browser/trunk(/images/.*?\\.png)\\?format=raw\"").matcher(s);
    155155        StringBuffer sb = new StringBuffer();
    156156        while (m.find()) {
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r6125 r6143  
    9292    /**
    9393     * Displays help on the console
    94      *
     94     * @since 2748
    9595     */
    9696    public static void showHelp() {
     
    132132    }
    133133
     134    /**
     135     * JOSM command line options.
     136     * @see <a href="http://josm.openstreetmap.de/wiki/Help/CommandLineOptions">Help/CommandLineOptions</a>
     137     * @since 5279
     138     */
    134139    public enum Option {
     140        /** --help|-h                                 Show this help */
    135141        HELP(false),
     142        /** --version                                 Displays the JOSM version and exits */
    136143        VERSION(false),
     144        /** --language=<language>                     Set the language */
    137145        LANGUAGE(true),
     146        /** --reset-preferences                       Reset the preferences to default */
    138147        RESET_PREFERENCES(false),
     148        /** --load-preferences=<url-to-xml>           Changes preferences according to the XML file */
    139149        LOAD_PREFERENCES(true),
     150        /** --set=<key>=<value>                       Set preference key to value */
    140151        SET(true),
     152        /** --geometry=widthxheight(+|-)x(+|-)y       Standard unix geometry argument */
    141153        GEOMETRY(true),
     154        /** --no-maximize                             Do not launch in maximized mode */
    142155        NO_MAXIMIZE(false),
     156        /** --maximize                                Launch in maximized mode */
    143157        MAXIMIZE(false),
     158        /** --download=minlat,minlon,maxlat,maxlon    Download the bounding box <br>
     159         *  --download=<URL>                          Download the location at the URL (with lat=x&lon=y&zoom=z) <br>
     160         *  --download=<filename>                     Open a file (any file type that can be opened with File/Open) */
    144161        DOWNLOAD(true),
     162        /** --downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw GPS <br>
     163         *  --downloadgps=<URL>                       Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS */
    145164        DOWNLOADGPS(true),
     165        /** --selection=<searchstring>                Select with the given search */
    146166        SELECTION(true);
    147167
     
    154174        }
    155175
     176        /**
     177         * Replies the option name
     178         * @return The option name, in lowercase
     179         */
    156180        public String getName() {
    157181            return name;
    158182        }
    159183
     184        /**
     185         * Determines if this option requires an argument.
     186         * @return {@code true} if this option requires an argument, {@code false} otherwise
     187         */
    160188        public boolean requiresArgument() {
    161189            return requiresArgument;
  • trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java

    r5916 r6143  
    2424     */
    2525    static public String getWikiBaseUrl() {
    26         return Main.pref.get("help.baseurl", "http://josm.openstreetmap.de");
     26        return Main.pref.get("help.baseurl", Main.JOSM_WEBSITE);
    2727    }
    2828
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r6104 r6143  
    787787        public void actionPerformed(ActionEvent ev) {
    788788            // Delete small files, because they're probably blank tiles.
    789             // See https://josm.openstreetmap.de/ticket/2307
     789            // See #2307
    790790            cache.cleanSmallFiles(4096);
    791791
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r6084 r6143  
    7171            XmlObjectParser parser = new XmlObjectParser(new XmlStyleSourceHandler(this));
    7272            parser.startWithValidation(reader,
    73                     "http://josm.openstreetmap.de/mappaint-style-1.0",
     73                    Main.JOSM_WEBSITE+"/mappaint-style-1.0",
    7474                    "resource://data/mappaint-style.xsd");
    7575            while(parser.hasNext()) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r6084 r6143  
    8989
    9090        public MapPaintSourceEditor() {
    91             super(true, "http://josm.openstreetmap.de/styles", styleSourceProviders);
     91            super(true, Main.JOSM_WEBSITE+"/styles", styleSourceProviders);
    9292        }
    9393
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r6084 r6143  
    190190
    191191        public TaggingPresetSourceEditor() {
    192             super(false, "http://josm.openstreetmap.de/presets", presetSourceProviders);
     192            super(false, Main.JOSM_WEBSITE+"/presets", presetSourceProviders);
    193193        }
    194194
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java

    r6139 r6143  
    7575
    7676        if (validate) {
    77             parser.startWithValidation(in, "http://josm.openstreetmap.de/tagging-preset-1.0", "resource://data/tagging-preset.xsd");
     77            parser.startWithValidation(in, Main.JOSM_WEBSITE+"/tagging-preset-1.0", "resource://data/tagging-preset.xsd");
    7878        } else {
    7979            parser.start(in);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r6142 r6143  
    2424import java.util.regex.Pattern;
    2525
     26import org.openstreetmap.josm.Main;
     27import org.openstreetmap.josm.gui.help.HelpUtil;
    2628import org.openstreetmap.josm.io.remotecontrol.handler.AddNodeHandler;
    2729import org.openstreetmap.josm.io.remotecontrol.handler.AddWayHandler;
     
    211213            if (handlerClass == null) {
    212214                String usage = getUsageAsHtml();
    213                 String websiteDoc = "http://josm.openstreetmap.de/wiki/Help/Preferences/RemoteControl";
     215                String websiteDoc = HelpUtil.getWikiBaseHelpUrl() +"/Help/Preferences/RemoteControl";
    214216                String help = "No command specified! The following commands are available:<ul>"
    215217                        + usage.toString()
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java

    r6091 r6143  
    5353    @Override
    5454    public String[] getUsageExamples() {
    55         return new String[] { "/import?urlhttp://josm.openstreetmap.de/browser/josm/trunk/data_nodist/direction-arrows.osm" };
     55        return new String[] { "/import?url="+Main.JOSM_WEBSITE+"/browser/josm/trunk/data_nodist/direction-arrows.osm" };
    5656    }
    5757   
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r6084 r6143  
    135135                                    tr("You have encountered an error in JOSM. Before you file a bug report " +
    136136                                            "make sure you have updated to the latest version of JOSM here:")), GBC.eol());
    137                             p.add(new UrlLabel("http://josm.openstreetmap.de",2), GBC.eop().insets(8,0,0,0));
     137                            p.add(new UrlLabel(Main.JOSM_WEBSITE,2), GBC.eop().insets(8,0,0,0));
    138138                            p.add(new JMultilineLabel(
    139139                                    tr("You should also update your plugins. If neither of those help please " +
     
    147147                                    tr("Alternatively, if that does not work you can manually fill in the information " +
    148148                                            "below at this URL:")), GBC.eol());
    149                             p.add(new UrlLabel("http://josm.openstreetmap.de/newticket",2), GBC.eop().insets(8,0,0,0));
     149                            p.add(new UrlLabel(Main.JOSM_WEBSITE+"/newticket",2), GBC.eop().insets(8,0,0,0));
    150150                            if (Utils.copyToClipboard(text)) {
    151151                                p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")), GBC.eop());
     
    196196            Utils.close(gzip);
    197197
    198             return new URL("http://josm.openstreetmap.de/josmticket?" +
     198            return new URL(Main.JOSM_WEBSITE+"/josmticket?" +
    199199                    "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
    200200        } catch (IOException e) {
     
    213213        URL url = getBugReportUrl(debugText);
    214214        if (url != null) {
    215             return new UrlLabel(url.toString(), "http://josm.openstreetmap.de/josmticket?...", 2);
     215            return new UrlLabel(url.toString(), Main.JOSM_WEBSITE+"/josmticket?...", 2);
    216216        }
    217217        return null;
  • trunk/src/org/openstreetmap/josm/tools/WikiReader.java

    r5937 r6143  
    2323
    2424    public WikiReader() {
    25         this.baseurl = Main.pref.get("help.baseurl", "http://josm.openstreetmap.de");
     25        this.baseurl = Main.pref.get("help.baseurl", Main.JOSM_WEBSITE);
    2626    }
    2727
Note: See TracChangeset for help on using the changeset viewer.