Changeset 32673 in osm


Ignore:
Timestamp:
2016-07-18T23:29:28+02:00 (8 years ago)
Author:
donvip
Message:

checkstyle

Location:
applications/editors/josm/plugins
Files:
2 added
7 edited

Legend:

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

    r32619 r32673  
    508508                                                                         org/netbeans/**/*.java,
    509509                                                                                                                                                 org/openstreetmap/josm/plugins/ohe/parser/**/*.java
     510                                                                                                                                                 org/openstreetmap/josm/plugins/roadsigns/javacc/**/*.java
    510511                                                                         org/osgeo/**/*.java"/>
    511512            <fileset dir="${basedir}/test" includes="**/*.java" erroronmissingdir="false"/>
  • applications/editors/josm/plugins/roadsigns/.project

    r32176 r32673  
    1616                        </arguments>
    1717                </buildCommand>
     18                <buildCommand>
     19                        <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
     20                        <arguments>
     21                        </arguments>
     22                </buildCommand>
    1823        </buildSpec>
    1924        <natures>
    2025                <nature>org.eclipse.jdt.core.javanature</nature>
     26                <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
    2127        </natures>
    2228</projectDescription>
  • applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/ParametrizedString.java

    r30737 r32673  
    1 // License: GPL (v2 or later)
     1// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.roadsigns;
    33
     
    2828     * types have a single String object as their backing data.
    2929     */
    30     public static interface StringOrParameter {
     30    public interface StringOrParameter {
    3131    }
    3232
  • applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java

    r32507 r32673  
    1 // License: GPL (v2 or later)
     1// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.roadsigns;
    33
     
    109109    private MultiSplitPane multiSplitPane;
    110110
    111     public RoadSignInputDialog() {
     111    RoadSignInputDialog() {
    112112        super(Main.parent, tr("Road Sign Plugin"), new String[] {tr("OK"), tr("Cancel")}, false /* modal */);
    113113        setRememberWindowGeometry(getClass().getName() + ".geometry",
     
    116116        this.signs = RoadSignsPlugin.signs;
    117117        sel = new SignSelection();
    118         setButtonIcons(new String[] { "ok.png", "cancel.png" });
     118        setButtonIcons(new String[] {"ok.png", "cancel.png"});
    119119        final JTabbedPane tabs = new JTabbedPane();
    120120        tabs.add(tr("signs"), buildSignsPanel());
     
    168168    private Command createCommand(Collection<OsmPrimitive> selPrim) {
    169169        List<Command> cmds = new LinkedList<>();
    170         for (int i=0; i<previewModel.getRowCount(); i++) {
     170        for (int i = 0; i < previewModel.getRowCount(); i++) {
    171171            String key = (String) previewModel.getValueAt(i, 0);
    172172            String value = (String) previewModel.getValueAt(i, 1);
     
    230230        multiSplitPane.add(new JScrollPane(pnlSignSelection), "upperleft");
    231231        multiSplitPane.add(buildPreviewPanel(), "upperright");
    232         JScrollPane scroll1 = new JScrollPane(pnlPossibleSigns, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
     232        JScrollPane scroll1 = new JScrollPane(pnlPossibleSigns,
     233                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    233234        scroll1.setPreferredSize(new Dimension(10, 10));
    234235        multiSplitPane.add(scroll1, "middleleft");
    235236
    236         JScrollPane scroll2 = new JScrollPane(pnlPossibleSupplements, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
     237        JScrollPane scroll2 = new JScrollPane(pnlPossibleSupplements,
     238                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    237239        scroll2.setPreferredSize(new Dimension(10, 10));
    238240        multiSplitPane.add(scroll2, "middleright");
     
    244246        info.addHyperlinkListener(new HyperlinkListener() {
    245247            @Override
    246                         public void hyperlinkUpdate(HyperlinkEvent e) {
     248            public void hyperlinkUpdate(HyperlinkEvent e) {
    247249                if (e == null || e.getURL() == null)
    248250                    return;
     
    289291     * Manages the update of gui elements when the selection changes.
    290292     */
    291     public class SignSelection  {
    292         private final LinkedList<SignCombination> combos=new LinkedList<>();
     293    public class SignSelection {
     294        private final LinkedList<SignCombination> combos = new LinkedList<>();
    293295
    294296        public void remove(SignCombination sc) {
     
    335337
    336338        private int findIndex(SignCombination scFind) {
    337             int i=0;
     339            int i = 0;
    338340            for (SignCombination sc : combos) {
    339341                if (sc == scFind) {
     
    346348
    347349        private Pair<Integer, Integer> findIndex(SignWrapper swFind) {
    348             int selIdx=0;
     350            int selIdx = 0;
    349351            for (SignCombination sc : combos) {
    350                 int combIdx=0;
     352                int combIdx = 0;
    351353                for (SignWrapper sw : sc.signs) {
    352354                    if (swFind == sw) {
     
    364366            panel.setLayout(new GridBagLayout());
    365367            GridBagConstraints gbc = new GridBagConstraints();
    366             gbc.anchor=GridBagConstraints.NORTHWEST;
    367             gbc.gridx=0;
    368             gbc.gridy=0;
    369             gbc.weightx=0;
    370             gbc.weighty=1.0;
     368            gbc.anchor = GridBagConstraints.NORTHWEST;
     369            gbc.gridx = 0;
     370            gbc.gridy = 0;
     371            gbc.weightx = 0;
     372            gbc.weighty = 1.0;
    371373            gbc.insets = new Insets(10, 10, 0, 10);
    372374
     
    395397        public LinkedList<SignWrapper> signs;
    396398
    397         public SignCombination() {
     399        SignCombination() {
    398400            signs = new LinkedList<>();
    399401        }
     
    407409            panel.setBorder(BorderFactory.createCompoundBorder(etched, empty));
    408410
    409             int i=0;
     411            int i = 0;
    410412            for (SignWrapper sw : signs) {
    411413                GridBagConstraints gbc = new GridBagConstraints();
     
    429431        public void add(final Sign sign) {
    430432            if (!signs.isEmpty() && !sign.isSupplementing)
    431                 throw new IllegalArgumentException("any sign but the first must be a supplement sign");//FIXME
     433                throw new IllegalArgumentException("any sign but the first must be a supplement sign"); //FIXME
    432434            final SignWrapper signWrp = new SignWrapper(sign);
    433435            signs.add(signWrp);
     
    447449        JPanel paramsPanel;
    448450        Map<String, String> paramValues = new HashMap<>();
    449         public SignWrapper(Sign sign) {
     451
     452        SignWrapper(Sign sign) {
    450453            this.sign = sign;
    451454            for (final SignParameter p : this.sign.params) {
     
    453456            }
    454457        }
     458
    455459        @Override
    456460        public String toString() {
     
    475479                return paramsPanel;
    476480            paramsPanel = new JPanel(new GridBagLayout());
    477             int i=0;
     481            int i = 0;
    478482            for (final SignParameter p : this.sign.params) {
    479483                JPanel pnlInput = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
     
    491495                        class TFDocumentListener implements DocumentListener {
    492496                            @Override
    493                                                         public void insertUpdate(DocumentEvent e) {
     497                            public void insertUpdate(DocumentEvent e) {
    494498                                update();
    495499                            }
    496500
    497501                            @Override
    498                                                         public void removeUpdate(DocumentEvent e) {
     502                            public void removeUpdate(DocumentEvent e) {
    499503                                update();
    500504                            }
    501505
    502506                            @Override
    503                                                         public void changedUpdate(DocumentEvent e) {
     507                            public void changedUpdate(DocumentEvent e) {
    504508                                update();
    505509                            }
     510
    506511                            public void update() {
    507512                                paramValues.put(p.ident, tf.getText());
    508513                                previewModel.update();
    509514                            }
    510                         };
     515                        }
     516
    511517                        TFDocumentListener listener = new TFDocumentListener();
    512518                        tf.getDocument().addDocumentListener(listener);
     
    523529                gbc.gridy = i;
    524530                gbc.anchor = GridBagConstraints.WEST;
    525                 paramsPanel.add(pnlInput,gbc);
     531                paramsPanel.add(pnlInput, gbc);
    526532                i++;
    527533            }
    528             if (i>0) {
     534            if (i > 0) {
    529535                paramsPanel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0));
    530536            }
     
    562568        previewTable = new JTable(data, columnNames) {
    563569            @Override
    564                         public String getToolTipText(MouseEvent e) {
     570            public String getToolTipText(MouseEvent e) {
    565571                int rowIndex = rowAtPoint(e.getPoint());
    566572                int colIndex = columnAtPoint(e.getPoint());
     
    587593        addTrafficSignTag.addActionListener(new ActionListener() {
    588594            @Override
    589                         public void actionPerformed(ActionEvent e) {
     595            public void actionPerformed(ActionEvent e) {
    590596                previewModel.update();
    591597            }
     
    601607        private List<String> values = new ArrayList<>();
    602608
    603         int rows=3;
     609        int rows = 3;
    604610        String[] header = {tr("Key"), tr("Value")};
    605611
    606612        @Override
    607                 public int getRowCount() {
     613        public int getRowCount() {
    608614            return keys.size();
    609615        }
    610616
    611617        @Override
    612                 public int getColumnCount() {
     618        public int getColumnCount() {
    613619            return 2;
    614620        }
    615621
    616622        @Override
    617                 public Object getValueAt(int rowIndex, int columnIndex) {
     623        public Object getValueAt(int rowIndex, int columnIndex) {
    618624            if (columnIndex == 0) {
    619625                return keys.get(rowIndex);
     
    633639         */
    634640        public void update() {
    635             final TreeMap<String, String> map= new TreeMap<>();
     641            final TreeMap<String, String> map = new TreeMap<>();
    636642            String traffic_sign = "";
    637643
     
    649655                    List<String> values = new ArrayList<>();
    650656                    List<String> conditions = new ArrayList<>();
    651                     //String ident;
    652                     public TagEvaluater(Tag t) {
     657                    TagEvaluater(Tag t) {
    653658                        key = t.key.evaluate(env);
    654659                        default_value = t.value.evaluate(env);
    655                         //ident = t.ident;
    656660                    }
    657661
     
    672676                            for (String v : values) {
    673677                                value += sep+v;
    674                                 sep=";";
     678                                sep = ";";
    675679                            }
    676680                        }
     
    690694                Map<String, TagEvaluater> tags = new LinkedHashMap<>();
    691695                for (SignWrapper sw : sc.signs) {
    692                     for (Map.Entry<String,String> entry : sw.paramValues.entrySet()) {
     696                    for (Map.Entry<String, String> entry : sw.paramValues.entrySet()) {
    693697                        env.put(entry.getKey(), entry.getValue());
    694698                    }
     
    713717                                TagEvaluater te = tags.get(t.tag_ref);
    714718                                if (te == null) {
    715                                     System.err.println(String.format("warning: referenced tag with ident '%s' not found for appending tag %s.",t.tag_ref, t.toString()));
     719                                    System.err.println(String.format("warning: referenced tag with ident '%s' not found for appending tag %s.",
     720                                            t.tag_ref, t.toString()));
    716721                                } else {
    717722                                    te.append_value(t.append_value.evaluate(env));
     
    720725                                TagEvaluater te = tags.get(t.tag_ref);
    721726                                if (te == null) {
    722                                     System.err.println(String.format("warning: referenced tag with ident '%s' not found for condition tag %s.",t.tag_ref, t.toString()));
     727                                    System.err.println(String.format("warning: referenced tag with ident '%s' not found for condition tag %s.",
     728                                            t.tag_ref, t.toString()));
    723729                                } else {
    724730                                    te.condition(t.condition.evaluate(env));
    725731                                }
    726732                            } else {
    727                                 System.err.println(String.format("warning: found tag_ref but neither append_value nor condition for tag %s.", t.toString()));
     733                                System.err.println(String.format("warning: found tag_ref but neither append_value nor condition for tag %s.",
     734                                        t.toString()));
    728735                            }
    729736                        } else if (t.ident != null) {
     
    738745                            map.put(t.key.evaluate(env), t.value.evaluate(env));
    739746                        }
    740 
    741747                    }
    742748                }
     
    776782    private class SignClickListener extends MouseAdapter {
    777783        private Sign sign;
    778         public SignClickListener(Sign sign) {
     784        SignClickListener(Sign sign) {
    779785            this.sign = sign;
    780786        }
     787
    781788        @Override
    782789        public void mouseClicked(MouseEvent e) {
    783790            info.setText(longText());
    784791            /* scroll up again */
    785             SwingUtilities.invokeLater(new Runnable(){
     792            SwingUtilities.invokeLater(new Runnable() {
    786793                @Override
    787                                 public void run() {
     794                public void run() {
    788795                    scrollInfo.getVerticalScrollBar().setValue(0);
    789796                }
     
    814821                    txt.append("<br>");
    815822                }
    816                 if (sign.wiki != null && ! sign.wiki.equals(sign.loc_wiki)) {
     823                if (sign.wiki != null && !sign.wiki.equals(sign.loc_wiki)) {
    817824                    String link = wikiPrefix+sign.wiki;
    818825                    txt.append("<a href=\""+link+"\">"+link+"</a>");
     
    831838     */
    832839    public static class FixedWidthPanel extends JPanel implements Scrollable {
    833         public FixedWidthPanel() {
     840        FixedWidthPanel() {
    834841            super(new FlowLayout(FlowLayout.LEFT));
    835842        }
     
    846853
    847854        @Override
    848                 public Dimension getPreferredScrollableViewportSize() {
     855        public Dimension getPreferredScrollableViewportSize() {
    849856            return super.getPreferredSize();
    850857        }
    851858
    852859        @Override
    853                 public int getScrollableUnitIncrement( Rectangle visibleRect, int orientation, int direction ) {
     860        public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
    854861            final int FRAC = 20;
    855862            int inc = (orientation == SwingConstants.VERTICAL ? getParent().getHeight() : getParent().getWidth()) / FRAC;
     
    858865
    859866        @Override
    860                 public int getScrollableBlockIncrement( Rectangle visibleRect, int orientation, int direction ) {
     867        public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) {
    861868            return orientation == SwingConstants.VERTICAL ? getParent().getHeight() : getParent().getWidth();
    862869        }
    863870
    864871        @Override
    865                 public boolean getScrollableTracksViewportWidth() {
     872        public boolean getScrollableTracksViewportWidth() {
    866873            return true;
    867874        }
    868875
    869876        @Override
    870                 public boolean getScrollableTracksViewportHeight() {
     877        public boolean getScrollableTracksViewportHeight() {
    871878            return false;
    872879        }
     
    893900        JRadioButton rbAll, rbUseful;
    894901
    895         public SettingsPanel(boolean standalone, final Action update) {
     902        SettingsPanel(boolean standalone, final Action update) {
    896903            super(new GridBagLayout());
    897904            presetsData = RoadSignsPlugin.getAvailablePresetsMetaData();
  • applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsPlugin.java

    r30962 r32673  
    1 // License: GPL (v2 or later)
     1// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.roadsigns;
    33
     
    4444    public static RoadSignsPlugin plugin;
    4545
    46     public final static PresetMetaData PRESET_BE = new PresetMetaData("BE", tr("Belgium"), "resource://data/roadsignpresetBE.xml", "resource://images/BE/");
    47     public final static PresetMetaData PRESET_ES = new PresetMetaData("ES", tr("Spain"), "resource://data/roadsignpresetES.xml", "resource://images/ES/");
    48     public final static PresetMetaData PRESET_DE = new PresetMetaData("DE", tr("Germany"), "resource://data/roadsignpresetDE.xml", "resource://images/DE/");
    49     public final static PresetMetaData PRESET_PL = new PresetMetaData("PL", tr("Poland"), "resource://data/roadsignpresetPL.xml", "resource://images/PL/");
    50     public final static PresetMetaData PRESET_SK = new PresetMetaData("SK", tr("Slovakia"), "resource://data/roadsignpresetSK.xml", "resource://images/SK/");
    51     public final static Collection<PresetMetaData> DEFAULT_PRESETS = Arrays.asList(PRESET_BE, PRESET_ES, PRESET_DE, PRESET_PL, PRESET_SK);
     46    public static final PresetMetaData PRESET_BE = new PresetMetaData(
     47            "BE", tr("Belgium"), "resource://data/roadsignpresetBE.xml", "resource://images/BE/");
     48    public static final PresetMetaData PRESET_ES = new PresetMetaData(
     49            "ES", tr("Spain"), "resource://data/roadsignpresetES.xml", "resource://images/ES/");
     50    public static final PresetMetaData PRESET_DE = new PresetMetaData(
     51            "DE", tr("Germany"), "resource://data/roadsignpresetDE.xml", "resource://images/DE/");
     52    public static final PresetMetaData PRESET_PL = new PresetMetaData(
     53            "PL", tr("Poland"), "resource://data/roadsignpresetPL.xml", "resource://images/PL/");
     54    public static final PresetMetaData PRESET_SK = new PresetMetaData(
     55            "SK", tr("Slovakia"), "resource://data/roadsignpresetSK.xml", "resource://images/SK/");
     56    public static final Collection<PresetMetaData> DEFAULT_PRESETS = Arrays.asList(PRESET_BE, PRESET_ES, PRESET_DE, PRESET_PL, PRESET_SK);
    5257
    5358    public RoadSignsPlugin(PluginInformation info) {
     
    6974        btn.setText(null);
    7075        btn.setBorder(BorderFactory.createEmptyBorder());
    71         btn.setPreferredSize(new Dimension(18,18));
     76        btn.setPreferredSize(new Dimension(18, 18));
    7277        PropertiesDialog.pluginHook.add(btn);
    7378        PropertiesDialog.pluginHook.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
     
    7681
    7782    private static class RoadSignAction extends JosmAction {
    78         public RoadSignAction() {
     83        RoadSignAction() {
    7984            super(tr("Roadsign tagging"), "pref/roadsigns-small", tr("Add tags by clicking on road signs"),
    80                     Shortcut.registerShortcut("plugin:roadsigns:dialog", tr("Roadsigns plugin: open dialog"), KeyEvent.VK_Q, Shortcut.ALT_SHIFT), false);
     85                    Shortcut.registerShortcut("plugin:roadsigns:dialog", tr("Roadsigns plugin: open dialog"),
     86                            KeyEvent.VK_Q, Shortcut.ALT_SHIFT), false);
    8187        }
    8288
    8389        @Override
    84                 public void actionPerformed(ActionEvent e) {
     90        public void actionPerformed(ActionEvent e) {
    8591            String code = Main.pref.get("plugin.roadsigns.preset.selection", null);
    8692            if (code == null) {
    87                 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Settings"), new String[] { tr("Ok"), tr("Cancel") });
     93                ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Settings"), new String[] {tr("Ok"), tr("Cancel")});
    8894                ed.setButtonIcons(new String[] {"ok", "cancel"});
    8995                SettingsPanel settings = new SettingsPanel(true, null);
     
    196202
    197203    protected static void loadSignPreset() throws IOException {
    198         List<PresetMetaData> presetsData =  getAvailablePresetsMetaData();
     204        List<PresetMetaData> presetsData = getAvailablePresetsMetaData();
    199205        String code = Main.pref.get("plugin.roadsigns.preset.selection", null);
    200206
     
    224230            JOptionPane.showMessageDialog(
    225231                    Main.parent,
    226                     tr("Could not read tagging preset source: ''{0}''",source),
     232                    tr("Could not read tagging preset source: ''{0}''", source),
    227233                    tr("Error"),
    228234                    JOptionPane.ERROR_MESSAGE
     
    245251     */
    246252    @SuppressWarnings("resource")
    247         public static InputStream getInputStream(String source) throws IOException {
     253    public static InputStream getInputStream(String source) throws IOException {
    248254        InputStream in = null;
    249255        if (source.startsWith("http://") || source.startsWith("https://") || source.startsWith("ftp://")) {
  • applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsReader.java

    r30737 r32673  
    1 // License: GPL (v2 or later)
     1// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.roadsigns;
    33
     
    1515import javax.xml.parsers.SAXParserFactory;
    1616
    17 import org.xml.sax.Attributes;
    18 import org.xml.sax.InputSource;
    19 import org.xml.sax.Locator;
    20 import org.xml.sax.SAXException;
    21 import org.xml.sax.SAXParseException;
    22 import org.xml.sax.helpers.DefaultHandler;
    2317import org.openstreetmap.josm.Main;
    2418import org.openstreetmap.josm.plugins.roadsigns.Sign.SignParameter;
     
    2822import org.openstreetmap.josm.tools.LanguageInfo;
    2923import org.openstreetmap.josm.tools.XmlParsingException;
     24import org.xml.sax.Attributes;
     25import org.xml.sax.InputSource;
     26import org.xml.sax.Locator;
     27import org.xml.sax.SAXException;
     28import org.xml.sax.SAXParseException;
     29import org.xml.sax.helpers.DefaultHandler;
    3030
    3131/**
     
    6060            this.locator = locator;
    6161        }
    62 
    6362
    6463        @Override public void startElement(String ns, String lname, String qname, Attributes atts) throws SAXException {
     
    160159
    161160            if (debug) {
    162                 for (int i=0; i<atts.getLength(); ++i) {
     161                for (int i = 0; i < atts.getLength(); ++i) {
    163162                    System.err.println("  "+atts.getQName(i)+": "+atts.getValue(i));
    164163                }
    165164            }
    166165        }
     166
    167167        @Override public void endElement(String ns, String lname, String qname) throws SAXException {
    168168            if (debug) System.err.print("</"+qname+"> |");
     
    185185            if (debug) System.err.println("|");
    186186        }
     187
    187188        @Override public void characters(char[] ch, int start, int length) {
    188189            String s = new String(ch, start, length);
     
    222223            throw new ExtendedParsingException(e).rememberLocation(locator);
    223224        }
     225
    224226        protected void throwException(String msg) throws XmlParsingException {
    225227            throw new XmlParsingException(msg).rememberLocation(locator);
     
    233235            }
    234236        }
     237
    235238        public void wireSupplements() throws XmlParsingException {
    236239            Map<String, Sign> map = new HashMap<>();
     
    250253        }
    251254    }
    252 
    253255
    254256    public static class ExtendedParsingException extends SAXException {
     
    304306     *
    305307     * @return True if file was properly parsed, false if there was error during parsing but some data were parsed anyway
    306      * @throws SAXException
    307      * @throws IOException
    308308     */
    309309    public List<Sign> parse() throws SAXException, IOException {
  • applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/Sign.java

    r30737 r32673  
    1 // License: GPL (v2 or later)
     1// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.roadsigns;
    33
     
    5353
    5454    public static class SignParameter {
    55         public enum Input {TEXTFIELD, COMBO};
     55        public enum Input { TEXTFIELD, COMBO }
     56
    5657        public String ident;
    5758        public Input input;
     
    7374            return deflt == null ? "" : deflt;
    7475        }
     76
    7577        public String getPrefix() {
    7678            return prefix == null ? "" : prefix;
    7779        }
     80
    7881        public String getSuffix() {
    7982            return suffix == null ? "" : suffix;
     
    101104        r = r.replaceAll("\\[.*\\]", "");
    102105        if (r.startsWith("DE:")) {
    103             r=r.replaceAll("DE:", "");
     106            r = r.replaceAll("DE:", "");
    104107            /* normal sign: starts with 3 digits, then a non-digit */
    105             {
    106                 Pattern p = Pattern.compile("^\\d{3}(\\D|$)");
    107                 Matcher m = p.matcher(r);
    108                 if (m.find())
    109                     return tr("Sign {0}", r);
    110             }
     108            Pattern p1 = Pattern.compile("^\\d{3}(\\D|$)");
     109            Matcher m1 = p1.matcher(r);
     110            if (m1.find())
     111                return tr("Sign {0}", r);
    111112            /* supplementary sign: starts with 4 digits, then a non-digit */
    112             {
    113                 Pattern p = Pattern.compile("^\\d{4}(\\D|$)");
    114                 Matcher m = p.matcher(r);
    115                 if (m.find())
    116                     return tr("Additional sign {0}", r);
    117             }
     113            Pattern p2 = Pattern.compile("^\\d{4}(\\D|$)");
     114            Matcher m2 = p2.matcher(r);
     115            if (m2.find())
     116                return tr("Additional sign {0}", r);
    118117            return null;
    119118        }
Note: See TracChangeset for help on using the changeset viewer.