Ignore:
Timestamp:
2016-05-12T01:30:36+02:00 (9 years ago)
Author:
donvip
Message:

add license, sonarlint configuration, code cleanup

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/osmarender/.project

    r29635 r32174  
    2121                        </arguments>
    2222                </buildCommand>
     23                <buildCommand>
     24                        <name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
     25                        <arguments>
     26                        </arguments>
     27                </buildCommand>
    2328        </buildSpec>
    2429        <natures>
  • applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java

    r30738 r32174  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.plugins.osmarender;
    23
     
    6768            try {
    6869                writeGenerated(b);
    69             } catch (Exception ex) {
     70            } catch (IOException ex) {
    7071                // how handle the exception?
    7172                Main.error(ex);
     
    124125                Runtime.getRuntime().exec(new String[]{firefox, argument});
    125126            } catch (IOException e1) {
    126                 JOptionPane.showMessageDialog(Main.parent, tr("Firefox not found. Please set firefox executable in the Map Settings page of the preferences."));
     127                JOptionPane.showMessageDialog(Main.parent,
     128                        tr("Firefox not found. Please set firefox executable in the Map Settings page of the preferences."));
    127129            }
    128130        }
     
    131133    private JMenuItem osmarenderMenu;
    132134
     135    /**
     136     * Constructs a new {@code OsmarenderPlugin}.
     137     * @param info plugin info
     138     * @throws IOException if files cannot be copied
     139     */
    133140    public OsmarenderPlugin(PluginInformation info) throws IOException {
    134141        super(info);
     
    156163    }
    157164
    158     private class OsmarenderPreferenceSetting implements SubPreferenceSetting {
     165    private static class OsmarenderPreferenceSetting implements SubPreferenceSetting {
    159166
    160167        private JTextField firefox = new JTextField(10);
     
    191198
    192199    private void writeGenerated(Bounds b) throws IOException {
    193         String bounds_tag = "<bounds " +
     200        String boundsTag = "<bounds " +
    194201            "minlat=\"" + b.getMin().lat() + "\" " +
    195202            "maxlat=\"" + b.getMax().lat() + "\" " +
     
    204211            // osm-map-features.xml contain two placemark
    205212            // (bounds_mkr1 and bounds_mkr2). We write the bounds tag between the two
    206             String str = null;
     213            String str;
    207214            while( (str = reader.readLine()) != null ) {
    208215                if(str.contains("<!--bounds_mkr1-->")) {
    209216                    writer.println(str);
    210                     writer.println("    " + bounds_tag);
     217                    writer.println("    " + boundsTag);
    211218                    while(!str.contains("<!--bounds_mkr2-->")) {
    212219                        str = reader.readLine();
Note: See TracChangeset for help on using the changeset viewer.