Ignore:
Timestamp:
2011-06-25T19:02:31+02:00 (13 years ago)
Author:
stoecker
Message:

i18n update, split plugin and core translation

Location:
applications/editors/josm/plugins/graphview
Files:
31 added
14 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/graphview/build.xml

    r25199 r26174  
    1 <?xml version="1.0" encoding="UTF-8"?>
     1<?xml version="1.0" encoding="utf-8"?>
    22<!--
    33** This is the build file for the graphview plugin
     
    2626-->
    2727<project name="graphview" default="dist" basedir=".">
    28 
    29         <property name="commit.message" value="option to change graph colors; closes ticket 5523 in JOSM Trac" />
    30         <property name="plugin.main.version" value="3835" />
    31 
    32     <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
    33     <property name="plugin.build.dir"       value="build"/>
    34     <property name="plugin.src.dir"         value="src"/>
     28    <property name="commit.message" value="option to change graph colors; closes ticket 5523 in JOSM Trac"/>
     29    <property name="plugin.main.version" value="4126"/>
     30    <property name="josm" location="../../core/dist/josm-custom.jar"/>
     31    <property name="plugin.build.dir" value="build"/>
     32    <property name="plugin.src.dir" value="src"/>
    3533    <!-- this is the directory where the plugin jar is copied to -->
    36     <property name="plugin.dist.dir"        value="../../dist"/>
     34    <property name="plugin.dist.dir" value="../../dist"/>
    3735    <property name="ant.build.javac.target" value="1.5"/>
    38     <property name="plugin.dist.dir"        value="../../dist"/>
    39     <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    40 
     36    <property name="plugin.dist.dir" value="../../dist"/>
     37    <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    4138    <!--
    4239    **********************************************************
     
    4744        <mkdir dir="${plugin.build.dir}"/>
    4845    </target>
    49 
    5046    <!--
    5147    **********************************************************
     
    6056        </javac>
    6157    </target>
    62 
    6358    <!--
    6459    **********************************************************
     
    7166            <fileset dir="images"/>
    7267        </copy>
     68        <copy todir="${plugin.build.dir}/data">
     69            <fileset dir="data"/>
     70        </copy>
    7371        <copy todir="${plugin.build.dir}/files">
    7472            <fileset dir="files"/>
     
    7674        <copy todir="${plugin.build.dir}">
    7775            <fileset dir=".">
    78                 <include name="LICENSE" />
     76                <include name="LICENSE"/>
    7977            </fileset>
    8078        </copy>
     
    9290        </jar>
    9391    </target>
    94 
    9592    <!--
    9693    **********************************************************
     
    10198    -->
    10299    <target name="revision">
    103 
    104100        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    105101            <env key="LANG" value="C"/>
     
    111107        <delete file="REVISION"/>
    112108    </target>
    113 
    114109    <!--
    115110    **********************************************************
     
    121116        <delete file="${plugin.jar}"/>
    122117    </target>
    123 
    124118    <!--
    125119    **********************************************************
     
    136130        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    137131    </target>
     132    <!--
     133         ************************** Publishing the plugin ***********************************
     134        -->
     135    <!--
     136        ** extracts the JOSM release for the JOSM version in ../core and saves it in the
     137        ** property ${coreversion.info.entry.revision}
     138        **
     139        -->
     140    <target name="core-info">
     141        <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
     142            <env key="LANG" value="C"/>
     143            <arg value="info"/>
     144            <arg value="--xml"/>
     145            <arg value="../../core"/>
     146        </exec>
     147        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
     148        <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
     149        <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
     150        <delete file="core.info.xml"/>
     151    </target>
     152    <!--
     153        ** commits the source tree for this plugin
     154        -->
     155    <target name="commit-current">
     156        <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
     157        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     158            <env key="LANG" value="C"/>
     159            <arg value="commit"/>
     160            <arg value="-m '${commit.message}'"/>
     161            <arg value="."/>
     162        </exec>
     163    </target>
     164    <!--
     165        ** updates (svn up) the source tree for this plugin
     166        -->
     167    <target name="update-current">
     168        <echo>Updating plugin source ...</echo>
     169        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     170            <env key="LANG" value="C"/>
     171            <arg value="up"/>
     172            <arg value="."/>
     173        </exec>
     174        <echo>Updating ${plugin.jar} ...</echo>
     175        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     176            <env key="LANG" value="C"/>
     177            <arg value="up"/>
     178            <arg value="../dist/${plugin.jar}"/>
     179        </exec>
     180    </target>
     181    <!--
     182        ** commits the plugin.jar
     183        -->
     184    <target name="commit-dist">
     185        <echo>
     186    ***** Properties of published ${plugin.jar} *****
     187    Commit message    : '${commit.message}'
     188    Plugin-Mainversion: ${plugin.main.version}
     189    JOSM build version: ${coreversion.info.entry.revision}
     190    Plugin-Version    : ${version.entry.commit.revision}
     191    ***** / Properties of published ${plugin.jar} *****
    138192
    139 
    140         <!--
    141                  ************************** Publishing the plugin ***********************************
    142                 -->
    143                 <!--
    144                 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    145                 ** property ${coreversion.info.entry.revision}
    146                 **
    147                 -->
    148                 <target name="core-info">
    149                         <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
    150                                 <env key="LANG" value="C"/>
    151                                 <arg value="info"/>
    152                                 <arg value="--xml"/>
    153                                 <arg value="../../core"/>
    154                         </exec>
    155                         <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
    156                         <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
    157                         <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    158                         <delete file="core.info.xml" />
    159                 </target>
    160 
    161                 <!--
    162                 ** commits the source tree for this plugin
    163                 -->
    164                 <target name="commit-current">
    165                         <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
    166                         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    167                                 <env key="LANG" value="C"/>
    168                                 <arg value="commit"/>
    169                                 <arg value="-m '${commit.message}'"/>
    170                                 <arg value="."/>
    171                         </exec>
    172                 </target>
    173 
    174                 <!--
    175                 ** updates (svn up) the source tree for this plugin
    176                 -->
    177                 <target name="update-current">
    178                         <echo>Updating plugin source ...</echo>
    179                         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    180                                 <env key="LANG" value="C"/>
    181                                 <arg value="up"/>
    182                                 <arg value="."/>
    183                         </exec>
    184                         <echo>Updating ${plugin.jar} ...</echo>
    185                         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    186                                 <env key="LANG" value="C"/>
    187                                 <arg value="up"/>
    188                                 <arg value="../dist/${plugin.jar}"/>
    189                         </exec>
    190                 </target>
    191 
    192                 <!--
    193                 ** commits the plugin.jar
    194                 -->
    195                 <target name="commit-dist">
    196                         <echo>
    197         ***** Properties of published ${plugin.jar} *****
    198         Commit message    : '${commit.message}'
    199         Plugin-Mainversion: ${plugin.main.version}
    200         JOSM build version: ${coreversion.info.entry.revision}
    201         Plugin-Version    : ${version.entry.commit.revision}
    202         ***** / Properties of published ${plugin.jar} *****
    203 
    204         Now commiting ${plugin.jar} ...
    205         </echo>
    206                         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    207                                 <env key="LANG" value="C"/>
    208                                 <arg value="-m '${commit.message}'"/>
    209                                 <arg value="commit"/>
    210                                 <arg value="${plugin.jar}"/>
    211                         </exec>
    212                 </target>
    213 
    214                 <!-- ** make sure svn is present as a command line tool ** -->
    215                 <target name="ensure-svn-present">
    216                         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
    217                                 <env key="LANG" value="C" />
    218                                 <arg value="--version" />
    219                         </exec>
    220                         <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
    221                                 <!-- return code not set at all? Most likely svn isn't installed -->
    222                                 <condition>
    223                                         <not>
    224                                                 <isset property="svn.exit.code" />
    225                                         </not>
    226                                 </condition>
    227                         </fail>
    228                         <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
    229                                 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
    230                                 <condition>
    231                                         <isfailure code="${svn.exit.code}" />
    232                                 </condition>
    233                         </fail>
    234                 </target>
    235 
    236                 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
    237                 </target>
     193    Now commiting ${plugin.jar} ...
     194    </echo>
     195        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     196            <env key="LANG" value="C"/>
     197            <arg value="-m '${commit.message}'"/>
     198            <arg value="commit"/>
     199            <arg value="${plugin.jar}"/>
     200        </exec>
     201    </target>
     202    <!-- ** make sure svn is present as a command line tool ** -->
     203    <target name="ensure-svn-present">
     204        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
     205            <env key="LANG" value="C"/>
     206            <arg value="--version"/>
     207        </exec>
     208        <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
     209            <!-- return code not set at all? Most likely svn isn't installed -->
     210            <condition>
     211                <not>
     212                    <isset property="svn.exit.code"/>
     213                </not>
     214            </condition>
     215        </fail>
     216        <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
     217            <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
     218            <condition>
     219                <isfailure code="${svn.exit.code}"/>
     220            </condition>
     221        </fail>
     222    </target>
     223    <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
     224        </target>
    238225</project>
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReader.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.core.access;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.IOException;
     
    120122
    121123                if (currentSection != Section.NONE) {
    122                     throw new SAXException("classes element below root child level");
     124                    throw new SAXException(tr("Classes element below root child level"));
    123125                }
    124126
     
    130132
    131133                if (currentSection != Section.CLASSES) {
    132                     throw new SAXException("class element (" + className + ") outside classes element");
     134                    throw new SAXException(tr("Class element ({0}) outside classes element", className));
    133135                } else if (className == null) {
    134                     throw new SAXException("class element without name");
     136                    throw new SAXException(tr("Class element without name"));
    135137                }
    136138
     
    144146
    145147                if (currentSection != Section.NONE) {
    146                     throw new SAXException("classes element below root child level");
     148                    throw new SAXException(tr("Classes element below root child level"));
    147149                }
    148150
     
    154156                    baseTags.add(readTag(attributes));
    155157                } else {
    156                     throw new SAXException("tag element outside basetag and implication elements");
     158                    throw new SAXException(tr("Tag element outside basetag and implication elements"));
    157159                }
    158160
     
    160162
    161163                if (currentSection != Section.NONE) {
    162                     throw new SAXException("implications element below root child level");
     164                    throw new SAXException(tr("Implications element below root child level"));
    163165                }
    164166
     
    176178
    177179            if (key == null) {
    178                 throw new SAXException("tag without key");
     180                throw new SAXException(tr("Tag without key"));
    179181            } else if (value == null) {
    180                 throw new SAXException("tag without value (key is " + key + ")");
     182                throw new SAXException(tr("Tag without value (key is {0})", key));
    181183            }
    182184
     
    195197
    196198                if (currentSection != Section.CLASSES) {
    197                     throw new SAXException("closed classes while it wasn't open");
     199                    throw new SAXException(tr("Closed classes while it was not open"));
    198200                } else if (currentAccessClass != null) {
    199                     throw new SAXException("closed classes element before all class elements were closed");
     201                    throw new SAXException(tr("Closed classes element before all class elements were closed"));
    200202                }
    201203
     
    205207
    206208                if (currentAccessClass == null) {
    207                     throw new SAXException("closed class element while none was open");
     209                    throw new SAXException(tr("Closed class element while none was open"));
    208210                }
    209211
     
    213215
    214216                if (currentSection != Section.BASETAGS) {
    215                     throw new SAXException("closed basetags while it wasn't open");
     217                    throw new SAXException(tr("Closed basetags while it was not open"));
    216218                }
    217219
     
    221223
    222224                if (currentSection != Section.IMPLICATIONS) {
    223                     throw new SAXException("closed implications while it wasn't open");
     225                    throw new SAXException(tr("Closed implications while it was not open"));
    224226                }
    225227
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/ImplicationXMLReader.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.core.access;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.ArrayList;
     
    6769                if ("tag".equals(name)) {
    6870                    if (tagOpen) {
    69                         throw new SAXException("tag element inside other tag element");
     71                        throw new SAXException(tr("Tag element inside other tag element"));
    7072                    }
    7173                    currentImpliedTags.add(readTag(attributes));
     
    7880
    7981        //all vaild paths end with return; reaching this indicates an invalid tag
    80         throw new SAXException("invalid opening xml tag <" + name + "> in state " + state);
     82        throw new SAXException(tr("Invalid opening xml tag <{0}> in state {1}", name, state));
    8183
    8284    }
     
    9193                if (name.equals("condition")) {
    9294                    if (!currentConditionReader.isFinished()) {
    93                         throw new SAXException("condition isn't finished at </condition> tag");
     95                        throw new SAXException(tr("Condition isn't finished at </condition> tag"));
    9496                    } else {
    9597                        currentCondition = currentConditionReader.getCondition();
     
    110112                } else if (name.equals("tag")) {
    111113                    if (!tagOpen) {
    112                         throw new SAXException("closing tag element that was not open");
     114                        throw new SAXException(tr("Closing tag element that was not open"));
    113115                    }
    114116                    tagOpen = false;
     
    131133
    132134        //all vaild paths end with return; reaching this indicates an invalid tag
    133         throw new SAXException("invalid closing xml tag </" + name + "> in state " + state);
     135        throw new SAXException(tr("Invalid closing xml tag </{0}> in state {1}", name, state));
    134136
    135137    }
     
    138140
    139141        if (state != State.BEFORE_IMPLICATION) {
    140             throw new SAXException("some tags not been closed; now in state " + state);
     142            throw new SAXException(tr("Some tags not been closed; now in state {0}", state));
    141143        } else {
    142144            return new ArrayList<Implication>(implications);
     
    150152
    151153        if (key == null) {
    152             throw new SAXException("tag without key");
     154            throw new SAXException(tr("Tag without key"));
    153155        } else if (value == null) {
    154             throw new SAXException("tag without value (key is " + key + ")");
     156            throw new SAXException(tr("Tag without value (key is {0})", key));
    155157        }
    156158
     
    163165
    164166        if (key == null) {
    165             throw new SAXException("key element without attribute k");
     167            throw new SAXException(tr("Key element without attribute k"));
    166168        }
    167169
     
    185187
    186188            if (finished) {
    187                 throw new SAXException("condition is already finished at <" + name + ">");
     189                throw new SAXException(tr("Condition is already finished at <{0}>", name));
    188190            }
    189191
     
    203205                    condition = TagConditionLogic.key(readKey(attributes));
    204206                } else if (!("or".equals(name)) && !("and".equals(name)) && !("not".equals(name))) {
    205                     throw new SAXException("unknown tag for condition: " + name);
     207                    throw new SAXException(tr("Unknown tag for condition: {0}", name));
    206208                }
    207209
     
    210212
    211213                if ("tag".equals(openingName) || "key".equals(openingName)) {
    212                     throw new SAXException("element must not have childs: " + openingName);
     214                    throw new SAXException(tr("Element must not have childs: {0}", openingName));
    213215                }
    214216
     
    224226
    225227            if (finished) {
    226                 throw new SAXException("condition is already finished at </" + name + ">");
     228                throw new SAXException(tr("Condition is already finished at </{0}>", name));
    227229            }
    228230
     
    250252                            condition = TagConditionLogic.and(childConditions);
    251253                        } else {
    252                             throw new SAXException("<and> needs at least one child");
     254                            throw new SAXException(tr("<and> needs at least one child"));
    253255                        }
    254256                    } else if ("or".equals(openingName)) {
     
    256258                            condition = TagConditionLogic.or(childConditions);
    257259                        } else {
    258                             throw new SAXException("<or> needs at least one child");
     260                            throw new SAXException(tr("<or> needs at least one child"));
    259261                        }
    260262                    } else if ("not".equals(openingName)) {
     
    262264                            condition = TagConditionLogic.not(childConditions.get(0));
    263265                        } else {
    264                             throw new SAXException("<not> needs at least one child");
     266                            throw new SAXException(tr("<not> needs at least one child"));
    265267                        }
    266268                    }
     
    269271
    270272                } else {
    271                     throw new SAXException("wrong closing tag " + name +
    272                             " (</" + openingName + "> expected");
     273                    throw new SAXException(tr("Wrong closing tag {0} (</{1}> expected)", name, openingName));
    273274                }
    274275
     
    283284        public TagCondition getCondition() {
    284285            if (!finished) {
    285                 throw new IllegalStateException("condition " + openingName + " not yet finished");
     286                throw new IllegalStateException(tr("Condition {0} not yet finished", openingName));
    286287            } else {
    287288                assert condition != null;
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/ConnectorEvaluationGroup.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.core.graph;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.ArrayList;
     
    6062        assert targetNode != null && borderNodes.contains(targetNode);
    6163
    62         if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
     64        if (!evaluated) { throw new IllegalStateException(tr("Group not yet evaluated")); }
    6365
    6466        int inboundIndex = borderNodes.indexOf(startNode);
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/JunctionEvaluationGroup.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.core.graph;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.ArrayList;
     
    3638     */
    3739    public Collection<Segment> getInboundSegments() {
    38         if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
     40        if (!evaluated) { throw new IllegalStateException(tr("Group not yet evaluated")); }
    3941        return inboundSegments;
    4042    }
     
    4749     */
    4850    public Collection<Segment> getOutboundSegments() {
    49         if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
     51        if (!evaluated) { throw new IllegalStateException(tr("Group not yet evaluated")); }
    5052        return outboundSegments;
    5153    }
     
    6668        assert outboundSegment != null && outboundSegments.contains(outboundSegment);
    6769
    68         if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
     70        if (!evaluated) { throw new IllegalStateException(tr("Group not yet evaluated")); }
    6971
    7072        int inboundIndex = inboundSegments.indexOf(inboundSegment);
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadValueLimit.java

    r23189 r26174  
    6767                case MINIMUM: return vehicleValue >= (Float) propertyValue;
    6868                case MAXIMUM: return vehicleValue <= (Float) propertyValue;
    69                 default:      throw new Error("unhandled LimitType");
     69                default:      throw new Error("Unhandled LimitType");
    7070            }
    7171        } else {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogic.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.core.util;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.util.Collection;
     
    8890    public static TagCondition and(final Collection<TagCondition> conditions) {
    8991        if (conditions.size() == 0) {
    90             throw new IllegalArgumentException("collection must contain at least one condition");
     92            throw new IllegalArgumentException(tr("Collection must contain at least one condition"));
    9193        }
    9294        return new TagCondition() {
     
    155157    public static TagCondition or(final Collection<TagCondition> conditions) {
    156158        if (conditions.size() == 0) {
    157             throw new IllegalArgumentException("collection must contain at least one condition");
     159            throw new IllegalArgumentException(tr("Collection must contain at least one condition"));
    158160        }
    159161        return new TagCondition() {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.plugin;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.io.File;
     
    9294
    9395                if (accessRuleset == null) {
    94                     JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!", "No ruleset", JOptionPane.ERROR_MESSAGE);
     96                    JOptionPane.showMessageDialog(Main.parent, tr("No ruleset has been selected!"), tr("No ruleset"), JOptionPane.ERROR_MESSAGE);
    9597                } else {
    9698                    transitionStructure.setAccessParametersAndRuleset(preferences.getCurrentParameterBookmark(), accessRuleset);
     
    103105
    104106                if (accessRuleset == null) {
    105                     JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!",
    106                             "No ruleset", JOptionPane.ERROR_MESSAGE);
     107                    JOptionPane.showMessageDialog(Main.parent, tr("No ruleset has been selected!"),
     108                            tr("No ruleset"), JOptionPane.ERROR_MESSAGE);
    107109                } else {
    108110
     
    126128
    127129        } catch (AccessRulesetSyntaxException e) {
    128             JOptionPane.showMessageDialog(Main.parent, "syntax exception in access ruleset:\n" + e);
     130            JOptionPane.showMessageDialog(Main.parent, tr("Syntax exception in access ruleset:\n{0}", e));
    129131            e.printStackTrace();
    130132        } catch (FileNotFoundException e) {
    131             JOptionPane.showMessageDialog(Main.parent, "file not found:\n" + e);
     133            JOptionPane.showMessageDialog(Main.parent, tr("File not found:\n{0}", e));
    132134            e.printStackTrace();
    133135        } catch (IOException e) {
    134             JOptionPane.showMessageDialog(Main.parent, "problem when accessing a file:\n" + e);
     136            JOptionPane.showMessageDialog(Main.parent, tr("Problem when accessing a file:\n{0}", e));
    135137            e.printStackTrace();
    136138        }
     
    148150
    149151                if (accessRuleset == null) {
    150                     JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!",
    151                             "No ruleset", JOptionPane.ERROR_MESSAGE);
     152                    JOptionPane.showMessageDialog(Main.parent, tr("No ruleset has been selected!"),
     153                            tr("No ruleset"), JOptionPane.ERROR_MESSAGE);
    152154                } else {
    153155                    transitionStructure.setAccessParametersAndRuleset(
     
    159161
    160162        } catch (AccessRulesetSyntaxException e) {
    161             JOptionPane.showMessageDialog(Main.parent, "syntax exception in access ruleset:\n" + e);
     163            JOptionPane.showMessageDialog(Main.parent, tr("Syntax exception in access ruleset:\n{0}", e));
    162164            e.printStackTrace();
    163165        } catch (FileNotFoundException e) {
    164             JOptionPane.showMessageDialog(Main.parent, "file not found:\n" + e);
     166            JOptionPane.showMessageDialog(Main.parent, tr("File not found:\n", e));
    165167            e.printStackTrace();
    166168        } catch (IOException e) {
    167             JOptionPane.showMessageDialog(Main.parent, "problem when accessing a file:\n" + e);
     169            JOptionPane.showMessageDialog(Main.parent, tr("Problem when accessing a file:\n{0}", e));
    168170            e.printStackTrace();
    169171        }
     
    206208                rulesetInputStream = rulesetURL.openStream();
    207209            } else {
    208                 throw new FileNotFoundException("couldn't find built-in ruleset " + ruleset);
     210                throw new FileNotFoundException(tr("Couldn't find built-in ruleset {0}", ruleset));
    209211            }
    210212
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/AccessParameterDialog.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.plugin.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import static org.openstreetmap.josm.plugins.graphview.core.property.VehiclePropertyTypes.MAX_INCLINE_DOWN;
     
    5052    static {
    5153        FLOAT_PROPERTIES = new LinkedHashMap<VehiclePropertyType<Float>, String>();
    52         FLOAT_PROPERTIES.put(VehiclePropertyTypes.HEIGHT, "height (m)");
    53         FLOAT_PROPERTIES.put(VehiclePropertyTypes.WIDTH, "width (m)");
    54         FLOAT_PROPERTIES.put(VehiclePropertyTypes.LENGTH, "length (m)");
    55         FLOAT_PROPERTIES.put(VehiclePropertyTypes.SPEED, "speed (km/h)");
    56         FLOAT_PROPERTIES.put(VehiclePropertyTypes.WEIGHT, "weight (t)");
    57         FLOAT_PROPERTIES.put(VehiclePropertyTypes.AXLELOAD, "axleload (t)");
     54        FLOAT_PROPERTIES.put(VehiclePropertyTypes.HEIGHT, tr("height (m)"));
     55        FLOAT_PROPERTIES.put(VehiclePropertyTypes.WIDTH, tr("width (m)"));
     56        FLOAT_PROPERTIES.put(VehiclePropertyTypes.LENGTH, tr("length (m)"));
     57        FLOAT_PROPERTIES.put(VehiclePropertyTypes.SPEED, tr("speed (km/h)"));
     58        FLOAT_PROPERTIES.put(VehiclePropertyTypes.WEIGHT, tr("weight (t)"));
     59        FLOAT_PROPERTIES.put(VehiclePropertyTypes.AXLELOAD, tr("axleload (t)"));
    5860    }
    5961
     
    6769        public BookmarkNamePanel(String initialName) {
    6870            super();
    69             this.setBorder(BorderFactory.createTitledBorder("bookmark name"));
     71            this.setBorder(BorderFactory.createTitledBorder(tr("Bookmark name")));
    7072
    7173            this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
     
    8183
    8284            if (existingBookmarkNames.contains(name)) {
    83                 JOptionPane.showMessageDialog(this, "Bookmark name already exists!");
     85                JOptionPane.showMessageDialog(this, tr("Bookmark name already exists!"));
    8486                return null;
    8587            }
     
    8789            for (char nameChar : name.toCharArray()) {
    8890                if (FORBIDDEN_CHARS.contains(nameChar)) {
    89                     JOptionPane.showMessageDialog(this, "Bookmark name must not contain '" +
    90                             nameChar + "'!");
     91                    JOptionPane.showMessageDialog(this, tr("Bookmark name must not contain ''{0}''!", nameChar));
    9192                    return null;
    9293                }
     
    103104        public AccessClassPanel(PreferenceAccessParameters initialParameters) {
    104105            super();
    105             this.setBorder(BorderFactory.createTitledBorder("access class"));
     106            this.setBorder(BorderFactory.createTitledBorder(tr("Access class")));
    106107
    107108            this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
     
    118119            for (char nameChar : name.toCharArray()) {
    119120                if (FORBIDDEN_CHARS.contains(nameChar)) {
    120                     JOptionPane.showMessageDialog(this, "Access class must not contain '" +
    121                             nameChar + "'!");
     121                    JOptionPane.showMessageDialog(this, tr("Access class must not contain ''{0}''!", nameChar));
    122122                    return null;
    123123                }
     
    137137        public AccessTypesPanel(PreferenceAccessParameters initialParameters) {
    138138            super();
    139             this.setBorder(BorderFactory.createTitledBorder("access types"));
     139            this.setBorder(BorderFactory.createTitledBorder(tr("Access types")));
    140140
    141141            this.setLayout(
     
    174174        public VehiclePropertiesPanel(PreferenceAccessParameters initialParameters) {
    175175            super();
    176             this.setBorder(BorderFactory.createTitledBorder("vehicle properties"));
     176            this.setBorder(BorderFactory.createTitledBorder(tr("Vehicle properties")));
    177177
    178178            this.setLayout(new GridLayout(((COLS-1 + FLOAT_PROPERTIES.size()) / COLS),
     
    223223        public RoadQualityPanel(PreferenceAccessParameters initialParameters) {
    224224            super();
    225             this.setBorder(BorderFactory.createTitledBorder("road requirements"));
     225            this.setBorder(BorderFactory.createTitledBorder(tr("Road requirements")));
    226226
    227227
     
    230230            /* incline up */
    231231            {
    232                 JLabel inclineUpLabel = new JLabel("max. incline up (%, pos.)");
    233                 inclineUpLabel.setToolTipText("maximum incline the vehicle can go up");
     232                JLabel inclineUpLabel = new JLabel(tr("Max. incline up (%, pos.)"));
     233                inclineUpLabel.setToolTipText(tr("Maximum incline the vehicle can go up"));
    234234                this.add(inclineUpLabel);
    235235
     
    241241                    inclineUpTextField.setText(vehiclePropertyString);
    242242                }
    243                 inclineUpTextField.setToolTipText("maximum incline the vehicle can go up");
     243                inclineUpTextField.setToolTipText(tr("Maximum incline the vehicle can go up"));
    244244
    245245                this.add(inclineUpTextField);
     
    248248            /* incline down */
    249249            {
    250                 JLabel inclineDownLabel = new JLabel("max. incline down (%, pos.)");
    251                 inclineDownLabel.setToolTipText("maximum incline the vehicle can go down");
     250                JLabel inclineDownLabel = new JLabel(tr("Max. incline down (%, pos.)"));
     251                inclineDownLabel.setToolTipText(tr("Maximum incline the vehicle can go down"));
    252252                this.add(inclineDownLabel);
    253253
     
    259259                    inclineDownTextField.setText(vehiclePropertyString);
    260260                }
    261                 inclineDownTextField.setToolTipText("maximum incline the vehicle can go down");
     261                inclineDownTextField.setToolTipText(tr("Maximum incline the vehicle can go down"));
    262262
    263263                this.add(inclineDownTextField);
     
    266266            /* surface */
    267267            {
    268                 JLabel surfaceLabel = new JLabel("surface blacklist");
    269                 surfaceLabel.setToolTipText("list of surfaces the vehicle cannot use, "
    270                         + "values are separated by semicolons (;)");
     268                JLabel surfaceLabel = new JLabel(tr("Surface blacklist"));
     269                surfaceLabel.setToolTipText(tr("List of surfaces the vehicle cannot use, "
     270                        + "values are separated by semicolons (;)"));
    271271                this.add(surfaceLabel);
    272272
     
    280280                }
    281281
    282                 surfaceTextField.setToolTipText("list of surfaces the vehicle cannot use, "
    283                         + "values are separated by semicolons (;)");
     282                surfaceTextField.setToolTipText(tr("List of surfaces the vehicle cannot use, "
     283                        + "values are separated by semicolons (;)"));
    284284
    285285                this.add(surfaceTextField);
     
    288288            /* tracktype */
    289289            {
    290                 JLabel tracktypeLabel = new JLabel("max. tracktype grade");
    291                 tracktypeLabel.setToolTipText("worst tracktype (1-5) the vehicle can still use,"
    292                         + " 0 for none");
     290                JLabel tracktypeLabel = new JLabel(tr("max. tracktype grade"));
     291                tracktypeLabel.setToolTipText(tr("Worst tracktype (1-5) the vehicle can still use,"
     292                        + " 0 for none"));
    293293                this.add(tracktypeLabel);
    294294
     
    300300                    tracktypeTextField.setText(vehiclePropertyString);
    301301                }
    302                 tracktypeTextField.setToolTipText("worst tracktype (1-5) the vehicle can still use,"
    303                         + " 0 for none");
     302                tracktypeTextField.setToolTipText(tr("Worst tracktype (1-5) the vehicle can still use,"
     303                        + " 0 for none"));
    304304
    305305                this.add(tracktypeTextField);
     
    343343            new BoxLayout(this, BoxLayout.X_AXIS);
    344344
    345             JButton okButton = new JButton(existingBookmark?"Change bookmark":"Create bookmark");
     345            JButton okButton = new JButton(existingBookmark?tr("Change bookmark"):tr("Create bookmark"));
    346346            okButton.addActionListener(new ActionListener() {
    347347                public void actionPerformed(ActionEvent e) {
     
    358358            this.add(okButton);
    359359
    360             JButton cancelButton = new JButton("Cancel");
     360            JButton cancelButton = new JButton(tr("Cancel"));
    361361            cancelButton.addActionListener(new ActionListener() {
    362362                public void actionPerformed(ActionEvent e) {
     
    384384            Collection<String> existingBookmarkNames,
    385385            PreferenceAccessParameters initialAccessParameters, BookmarkAction okAction) {
    386         super(owner, "edit access parameters", true);
     386        super(owner, tr("Edit access parameters"), true);
    387387
    388388        this.existingBookmark = existingBookmark;
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.plugin.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.BorderLayout;
     
    6567    public GraphViewDialog(final GraphViewPlugin plugin) {
    6668
    67         super("Graph View Dialog", "graphview",
    68                 "Open the dialog for graph view configuration.", (Shortcut)null, HEIGHT);
     69        super(tr("Graph View Dialog"), "graphview",
     70                tr("Open the dialog for graph view configuration."), (Shortcut)null, HEIGHT);
    6971
    7072        this.preferences = GraphViewPreferences.getInstance();
     
    7375        availableColorSchemes = new LinkedHashMap<String, ColorScheme>();
    7476
    75         availableColorSchemes.put("default",
     77        availableColorSchemes.put(tr("default"),
    7678                new PreferencesColorScheme(preferences));
    77         availableColorSchemes.put("end nodes",
     79        availableColorSchemes.put(tr("end nodes"),
    7880                new EndNodeColorScheme(Color.GRAY, Color.RED, Color.GRAY));
    79         availableColorSchemes.put("maxspeed",
     81        availableColorSchemes.put(tr("maxspeed"),
    8082                new MaxspeedColorScheme());
    81         availableColorSchemes.put("maxweight",
     83        availableColorSchemes.put(tr("maxweight"),
    8284                new MaxweightColorScheme());
    83         availableColorSchemes.put("maxheight",
     85        availableColorSchemes.put(tr("maxheight"),
    8486                new MaxheightColorScheme());
    85         availableColorSchemes.put("incline",
     87        availableColorSchemes.put(tr("incline"),
    8688                new InclineColorScheme());
    8789
     
    103105        /* create ruleset label and combo box */
    104106        {
    105             JLabel rulesetLabel = new JLabel("ruleset:");
     107            JLabel rulesetLabel = new JLabel(tr("Ruleset:"));
    106108            gbcLabel.gridy = 0;
    107109            selectionLayout.setConstraints(rulesetLabel, gbcLabel);
     
    117119        /* create bookmark label and combo box */
    118120        {
    119             JLabel bookmarkLabel = new JLabel("parameters:");
     121            JLabel bookmarkLabel = new JLabel(tr("Parameters:"));
    120122            gbcLabel.gridy = 1;
    121123            selectionLayout.setConstraints(bookmarkLabel, gbcLabel);
     
    131133        /* create color scheme label and combo box */
    132134        {
    133             JLabel colorSchemeLabel = new JLabel("coloring:");
     135            JLabel colorSchemeLabel = new JLabel(tr("Coloring:"));
    134136            gbcLabel.gridy = 2;
    135137            selectionLayout.setConstraints(colorSchemeLabel, gbcLabel);
     
    154156
    155157        JPanel buttonPanel = new JPanel();
    156         JButton showLayerButton = new JButton("create/update graph");
     158        JButton showLayerButton = new JButton(tr("Create/update graph"));
    157159        showLayerButton.addActionListener(new ActionListener() {
    158160            public void actionPerformed(ActionEvent e) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java

    r23434 r26174  
    11package org.openstreetmap.josm.plugins.graphview.plugin.dialogs;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Color;
     
    5961        readPreferences();
    6062
    61         preferencePanel = gui.createPreferenceTab("graphview", "Graphview",
    62         "Settings for the Graphview plugin that visualizes routing graphs.");
     63        preferencePanel = gui.createPreferenceTab("graphview", tr("Graphview"),
     64        tr("Settings for the Graphview plugin that visualizes routing graphs."));
    6365
    6466        JPanel mainPanel = createMainPanel();
     
    123125
    124126        JPanel rulesetPanel = new JPanel();
    125         rulesetPanel.setBorder(BorderFactory.createTitledBorder("ruleset"));
     127        rulesetPanel.setBorder(BorderFactory.createTitledBorder(tr("Ruleset")));
    126128        rulesetPanel.setLayout(new BoxLayout(rulesetPanel, BoxLayout.Y_AXIS));
    127129
    128         internalRulesetCheckBox = new JCheckBox("use built-in rulesets");
     130        internalRulesetCheckBox = new JCheckBox(tr("Use built-in rulesets"));
    129131        internalRulesetCheckBox.setSelected(GraphViewPreferences.getInstance().getUseInternalRulesets());
    130132        internalRulesetCheckBox.addActionListener(internalRulesetActionListener);
    131133        rulesetPanel.add(internalRulesetCheckBox);
    132134
    133         rulesetFolderLabel = new JLabel("external ruleset directory:");
     135        rulesetFolderLabel = new JLabel(tr("Wxternal ruleset directory:"));
    134136        rulesetPanel.add(rulesetFolderLabel);
    135137
     
    139141        rulesetPanel.add(rulesetFolderTextField);
    140142
    141         selectRulesetFolderButton = new JButton("select directory");
     143        selectRulesetFolderButton = new JButton(tr("Select directory"));
    142144        selectRulesetFolderButton.addActionListener(selectRulesetFolderActionListener);
    143145        rulesetPanel.add(selectRulesetFolderButton);
     
    151153
    152154        JPanel vehiclePanel = new JPanel();
    153         vehiclePanel.setBorder(BorderFactory.createTitledBorder("vehicle"));
     155        vehiclePanel.setBorder(BorderFactory.createTitledBorder(tr("Vehicle")));
    154156        vehiclePanel.setLayout(new BoxLayout(vehiclePanel, BoxLayout.Y_AXIS));
    155157
     
    160162        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
    161163
    162         JButton createButton = new JButton("create");
     164        JButton createButton = new JButton(tr("Create"));
    163165        createButton.addActionListener(createVehicleActionListener);
    164166        buttonPanel.add(createButton);
    165167
    166         editBookmarkButton = new JButton("edit");
     168        editBookmarkButton = new JButton(tr("Edit"));
    167169        editBookmarkButton.addActionListener(editVehicleActionListener);
    168170        buttonPanel.add(editBookmarkButton);
    169171
    170         deleteBookmarkButton = new JButton("delete");
     172        deleteBookmarkButton = new JButton(tr("Delete"));
    171173        deleteBookmarkButton.addActionListener(deleteVehicleActionListener);
    172174        buttonPanel.add(deleteBookmarkButton);
    173175
    174         JButton restoreDefaultsButton = new JButton("restore defaults");
     176        JButton restoreDefaultsButton = new JButton(tr("Restore defaults"));
    175177        restoreDefaultsButton.addActionListener(restoreVehicleDefaultsActionListener);
    176178        buttonPanel.add(restoreDefaultsButton);
     
    184186       
    185187        JPanel visualizationPanel = new JPanel();
    186         visualizationPanel.setBorder(BorderFactory.createTitledBorder("visualization"));
     188        visualizationPanel.setBorder(BorderFactory.createTitledBorder(tr("Visualization")));
    187189        visualizationPanel.setLayout(new BoxLayout(visualizationPanel, BoxLayout.Y_AXIS));
    188190       
    189         separateDirectionsCheckBox = new JCheckBox("draw directions separately");
     191        separateDirectionsCheckBox = new JCheckBox(tr("Draw directions separately"));
    190192        separateDirectionsCheckBox.setSelected(GraphViewPreferences.getInstance().getSeparateDirections());
    191193        visualizationPanel.add(separateDirectionsCheckBox);
     
    198200                Color nodeColor = GraphViewPreferences.getInstance().getNodeColor();
    199201               
    200                 nodeColorButton = new JButton("node color");
     202                nodeColorButton = new JButton(tr("Node color"));
    201203                nodeColorButton.addActionListener(chooseNodeColorActionListener);
    202204                colorPanel.add(nodeColorButton);
     
    207209                Color segmentColor = GraphViewPreferences.getInstance().getSegmentColor();
    208210               
    209                 segmentColorButton = new JButton("arrow color");
     211                segmentColorButton = new JButton(tr("Arrow color"));
    210212                segmentColorButton.addActionListener(chooseSegmentColorActionListener);
    211213                colorPanel.add(segmentColorButton);
     
    280282                    null,
    281283                    false,
    282                     "new bookmark",
     284                    tr("New bookmark"),
    283285                    parameterBookmarks.keySet(),
    284286                    defaultBookmarkParameters,
     
    337339                int userChoice = JOptionPane.showConfirmDialog(
    338340                        preferencePanel,
    339                         "Really delete \"" + selectedBookmarkName + "\"?",
    340                         "Bookmark deletion",
     341                        tr("Really delete \"{0}\"?", selectedBookmarkName),
     342                        tr("Bookmark deletion"),
    341343                        JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    342344
     
    355357            int userChoice = JOptionPane.showConfirmDialog(
    356358                    preferencePanel,
    357                     "Really restore default bookmarks?\n"
    358                     + "All manually added or edited bookmarks will be lost!",
    359                     "Bookmark reset",
     359                    tr("Really restore default bookmarks?\n"
     360                    + "All manually added or edited bookmarks will be lost!"),
     361                    tr("Bookmark reset"),
    360362                    JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    361363
     
    374376               
    375377                Color selectedColor = JColorChooser.showDialog(
    376                                 preferencePanel, "Choose node color", nodeColorField.getBackground());
     378                                preferencePanel, tr("Choose node color"), nodeColorField.getBackground());
    377379               
    378380                if (selectedColor != null) {
     
    387389               
    388390                Color selectedColor = JColorChooser.showDialog(
    389                                 preferencePanel, "Choose arrow color", segmentColorField.getBackground());
     391                                preferencePanel, tr("Choose arrow color"), segmentColorField.getBackground());
    390392               
    391393                if (selectedColor != null) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java

    r23434 r26174  
    11package org.openstreetmap.josm.plugins.graphview.plugin.layer;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.BasicStroke;
     
    251253    private Point getNodePoint(LatLonCoords coords, MapView mv) {
    252254        LatLon latLon = new LatLon(coords.getLat(), coords.getLon());
    253         EastNorth eastNorth = Main.proj.latlon2eastNorth(latLon);
     255        EastNorth eastNorth = Main.getProjection().latlon2eastNorth(latLon);
    254256        return mv.getPoint(eastNorth);
    255257    }
     
    300302    @Override
    301303    public String getToolTipText() {
    302         return "routing graph calculated by the GraphView plugin";
     304        return tr("Routing graph calculated by the GraphView plugin");
    303305    }
    304306
    305307    @Override
    306308    public void mergeFrom(Layer from) {
    307         throw new AssertionError("GraphView layer is not mergable");
     309        throw new AssertionError(tr("GraphView layer is not mergable"));
    308310    }
    309311
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferences.java

    r23434 r26174  
    11package org.openstreetmap.josm.plugins.graphview.plugin.preferences;
     2
     3import static org.openstreetmap.josm.tools.I18n.marktr;
    24
    35import static org.openstreetmap.josm.plugins.graphview.core.property.VehiclePropertyTypes.AXLELOAD;
     
    216218        currentInternalRuleset = null;
    217219
    218         nodeColor = Color.WHITE;
    219         segmentColor = Color.WHITE;
    220220        currentColorScheme = new PreferencesColorScheme(this);
    221221
     
    244244        }
    245245
    246         Main.pref.put("graphview.defaultNodeColor", createColorString(nodeColor));
    247         Main.pref.put("graphview.defaultSegmentColor", createColorString(segmentColor));
     246        Main.pref.putColor(marktr("GraphView default node"), nodeColor);
     247        Main.pref.putColor(marktr("Graphview default segment"), segmentColor);
    248248
    249249        Main.pref.put("graphview.separateDirections", separateDirections);
     
    289289        }
    290290
    291         if (Main.pref.hasKey("graphview.defaultNodeColor")) {
    292             Color color = parseColorString(Main.pref.get("graphview.defaultNodeColor"));
    293             if (color != null) {
    294                 nodeColor = color;
    295             }
    296         }
    297         if (Main.pref.hasKey("graphview.defaultSegmentColor")) {
    298             Color color = parseColorString(Main.pref.get("graphview.defaultSegmentColor"));
    299             if (color != null) {
    300                 segmentColor = color;
    301             }
    302         }
    303 
     291        nodeColor = Main.pref.getColor(marktr("GraphView default node"), Color.white);
     292        segmentColor = Main.pref.getColor(marktr("Graphview default segment"), Color.white);
    304293        separateDirections = Main.pref.getBoolean("graphview.separateDirections", false);
    305294
     
    471460        }
    472461    }
    473 
    474     private static final Pattern COLOR_PATTERN =
    475         Pattern.compile("^(\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})$");
    476     private String createColorString(Color color) {
    477         return color.getRed() + ", " + color.getGreen() + ", " + color.getBlue();
    478     }
    479 
    480     private Color parseColorString(String string) {
    481         Matcher matcher = COLOR_PATTERN.matcher(string);
    482         if (!matcher.matches()) {
    483             return null;
    484         } else {
    485             int r = Integer.parseInt(matcher.group(1));
    486             int g = Integer.parseInt(matcher.group(2));
    487             int b = Integer.parseInt(matcher.group(3));
    488             return new Color(r, g, b);
    489         }
    490     }
    491 
    492462}
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/VehiclePropertyStringParser.java

    r23189 r26174  
    11package org.openstreetmap.josm.plugins.graphview.plugin.preferences;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.security.InvalidParameterException;
     
    3133
    3234    public static final String ERROR_WEIGHT =
    33         "Weights must be given as positive decimal numbers with unit \"t\" or without unit.";
     35        tr("Weights must be given as positive decimal numbers with unit \"t\" or without unit.");
    3436    public static final String ERROR_LENGTH =
    35         "Lengths must be given as positive decimal numbers with unit \"m\", \"km\", \"mi\"" +
    36         " or without unit.\nAlternatively, the format FEET' INCHES\" can be used.";
     37        tr("Lengths must be given as positive decimal numbers with unit \"m\", \"km\", \"mi\"" +
     38        " or without unit.\nAlternatively, the format FEET' INCHES\" can be used.");
    3739    public static final String ERROR_SPEED =
    38         "Speeds should be given as numbers without unit or "
    39         + "as numbers followed by \"mph\".";
     40        tr("Speeds should be given as numbers without unit or "
     41        + "as numbers followed by \"mph\".");
    4042    public static final String ERROR_INCLINE =
    41         "Inclines must be given as positive decimal numbers with followed by \"%\".";
     43        tr("Inclines must be given as positive decimal numbers with followed by \"%\".");
    4244    public static final String ERROR_TRACKTYPE =
    43         "Tracktype grades must be given as integers between 0 and 5.";
     45        tr("Tracktype grades must be given as integers between 0 and 5.");
    4446    public static final String ERROR_SURFACE =
    45         "Surface values must not contain any of the following characters: ',' '{' '}' '=' '|";
     47        tr("Surface values must not contain any of the following characters: ',' '{' '}' '=' '|");
    4648
    4749    private static final List<Character> FORBIDDEN_SURFACE_CHARS =
     
    145147
    146148        } else {
    147             throw new InvalidParameterException("unknown property type: " + propertyType);
     149            throw new InvalidParameterException("Unknown property type: " + propertyType);
    148150        }
    149151
Note: See TracChangeset for help on using the changeset viewer.