Changeset 34496 in osm for applications/editors/josm


Ignore:
Timestamp:
2018-08-18T03:13:39+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153, fix warnings

Location:
applications/editors/josm/plugins/ColumbusCSV
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/ColumbusCSV/.settings/org.eclipse.jdt.core.prefs

    r32699 r34496  
    1414org.eclipse.jdt.core.compiler.debug.localVariable=generate
    1515org.eclipse.jdt.core.compiler.debug.sourceFile=generate
     16org.eclipse.jdt.core.compiler.doc.comment.support=enabled
    1617org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
    1718org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
     
    3738org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
    3839org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
     40org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
     41org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
     42org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
     43org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
     44org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
    3945org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
    4046org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
     
    4349org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
    4450org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
     51org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
     52org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
     53org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
     54org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
     55org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
     56org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
     57org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
     58org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
    4559org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
    4660org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
  • applications/editors/josm/plugins/ColumbusCSV/build.xml

    r33862 r34496  
    44    <property name="commit.message" value="Commit message"/>
    55    <!-- Enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="12840"/>
     6    <property name="plugin.main.version" value="14153"/>
    77   
    88    <!-- Plugin meta data -->
  • applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVImporter.java

    r34379 r34496  
    77import java.io.IOException;
    88
    9 import org.openstreetmap.josm.Main;
    109import org.openstreetmap.josm.actions.AutoScaleAction;
    1110import org.openstreetmap.josm.actions.ExtensionFileFilter;
     
    1817import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    1918import org.openstreetmap.josm.io.IllegalDataException;
     19import org.openstreetmap.josm.spi.preferences.Config;
    2020import org.openstreetmap.josm.tools.Logging;
    2121
    2222/**
    2323 *
    24  * @author Oliver Wieland <oliver.wieland@online.de>
     24 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    2525 *
    2626 */
     
    8989                progressMonitor.setTicksCount(4);
    9090       
    91                 if (Main.pref.getBoolean("marker.makeautomarkers", true)) {
     91                if (Config.getPref().getBoolean("marker.makeautomarkers", true)) {
    9292                    try {
    9393                        MarkerLayer ml = new MarkerLayer(gpxData,
  • applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVPlugin.java

    r34379 r34496  
    1010 * Plugin class to import Columbus V-900 CSV files into JOSM.
    1111 *
    12  * @author Oliver Wieland <oliver.wieland@online.de> Wieland
     12 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt; Wieland
    1313 *
    1414 */
    1515public class ColumbusCSVPlugin extends Plugin {
    1616    private static PreferenceSetting columbusSettings;
     17
    1718    /**
    1819     * Plugin constructor (adds menu entry to file menu).
     20     * @param info plugin information
    1921     */
    2022    public ColumbusCSVPlugin(PluginInformation info) {
  • applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVPreferences.java

    r34379 r34496  
    77import javax.swing.JCheckBox;
    88
    9 import org.openstreetmap.josm.Main;
    109import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
    1110import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     11import org.openstreetmap.josm.spi.preferences.Config;
    1212
    1313/**
    1414 * Implements the preferences dialog for this plugin.
    15  * @author Oliver Wieland <oliver.wieland@online.de>
     15 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    1616 */
    1717public class ColumbusCSVPreferences extends DefaultTabPreferenceSetting {
     
    6161    @Override
    6262    public boolean ok() {
    63         Main.pref.putBoolean(SHOW_SUMMARY, colCSVShowSummary.isSelected());
    64         Main.pref.putBoolean(ZOOM_AFTER_IMPORT, colCSVDontZoomAfterImport.isSelected());
    65         Main.pref.putBoolean(IGNORE_VDOP, colCSVIgnoreVDOP.isSelected());
    66         Main.pref.putBoolean(WARN_CONVERSION_ERRORS, colCSVWarnConversionErrors.isSelected());
    67         Main.pref.putBoolean(WARN_MISSING_AUDIO, colCSVWarnMissingAudio.isSelected());       
     63        Config.getPref().putBoolean(SHOW_SUMMARY, colCSVShowSummary.isSelected());
     64        Config.getPref().putBoolean(ZOOM_AFTER_IMPORT, colCSVDontZoomAfterImport.isSelected());
     65        Config.getPref().putBoolean(IGNORE_VDOP, colCSVIgnoreVDOP.isSelected());
     66        Config.getPref().putBoolean(WARN_CONVERSION_ERRORS, colCSVWarnConversionErrors.isSelected());
     67        Config.getPref().putBoolean(WARN_MISSING_AUDIO, colCSVWarnMissingAudio.isSelected());       
    6868        return false;
    6969    }
     
    7171    /**
    7272     * If <tt>true</tt>, a summary dialog is shown after import. Default is <tt>true</tt>.
    73      * @return
     73     * @return <tt>true</tt> if a summary dialog is shown after import
    7474     */
    7575    public static boolean showSummary() {
    76         return Main.pref.getBoolean(SHOW_SUMMARY, true);
     76        return Config.getPref().getBoolean(SHOW_SUMMARY, true);
    7777    }
    7878   
    7979    /**
    80      * If <tt>true</tt>, a the bounding box will not be scaled to the imported data.
    81      * @return
     80     * If <tt>true</tt>, the bounding box will not be scaled to the imported data.
     81     * @return <tt>true</tt> if the bounding box will not be scaled to the imported data
    8282     */
    8383    public static boolean zoomAfterImport() {
    84         return Main.pref.getBoolean(ZOOM_AFTER_IMPORT, true);
     84        return Config.getPref().getBoolean(ZOOM_AFTER_IMPORT, true);
    8585    }
    8686   
     
    8989     * this setting has no effect.
    9090     * Default is <tt>false</tt>.
    91      * @return
     91     * @return <tt>true</tt> if all DOP values (hdop, vdop, pdop) are ignored
    9292     */
    9393    public static boolean ignoreDOP() {
    94         return Main.pref.getBoolean(IGNORE_VDOP, false);
     94        return Config.getPref().getBoolean(IGNORE_VDOP, false);
    9595    }
    9696   
    9797    /**
    98      * If <tt>true</tt>, the plugin issues warnings if either date or position errors have been occurred.
     98     * If <tt>true</tt>, the plugin issues warnings when either date or position errors occurr.
    9999     * Default is <tt>true</tt>.
    100      * @return
     100     * @return <tt>true</tt> if the plugin issues warnings when either date or position errors occurr.
    101101     */
    102102    public static boolean warnConversion() {
    103         return Main.pref.getBoolean(WARN_CONVERSION_ERRORS, false);
     103        return Config.getPref().getBoolean(WARN_CONVERSION_ERRORS, false);
    104104    }
    105105   
     
    107107     * If <tt>true</tt>, the plugin issues a warning if a referenced audio file is missing.
    108108     * Default is <tt>true</tt>.
    109      * @return
     109     * @return <tt>true</tt> if the plugin issues a warning when a referenced audio file is missing
    110110     */
    111111    public static boolean warnMissingAudio() {
    112         return Main.pref.getBoolean(WARN_MISSING_AUDIO, false);
     112        return Config.getPref().getBoolean(WARN_MISSING_AUDIO, false);
    113113    }
    114114
     
    131131
    132132        // Apply settings
    133         colCSVShowSummary.setSelected(Main.pref.getBoolean(SHOW_SUMMARY, true));
    134         colCSVDontZoomAfterImport.setSelected(Main.pref.getBoolean(ZOOM_AFTER_IMPORT, true));
    135         colCSVIgnoreVDOP.setSelected(Main.pref.getBoolean(IGNORE_VDOP, false));
    136         colCSVWarnConversionErrors.setSelected(Main.pref.getBoolean(WARN_CONVERSION_ERRORS, true));
    137         colCSVWarnMissingAudio.setSelected(Main.pref.getBoolean(WARN_MISSING_AUDIO, true));
     133        colCSVShowSummary.setSelected(Config.getPref().getBoolean(SHOW_SUMMARY, true));
     134        colCSVDontZoomAfterImport.setSelected(Config.getPref().getBoolean(ZOOM_AFTER_IMPORT, true));
     135        colCSVIgnoreVDOP.setSelected(Config.getPref().getBoolean(IGNORE_VDOP, false));
     136        colCSVWarnConversionErrors.setSelected(Config.getPref().getBoolean(WARN_CONVERSION_ERRORS, true));
     137        colCSVWarnMissingAudio.setSelected(Config.getPref().getBoolean(WARN_MISSING_AUDIO, true));
    138138    }
    139139
  • applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVReader.java

    r34379 r34496  
    1010import java.io.IOException;
    1111import java.io.InputStreamReader;
     12import java.nio.charset.StandardCharsets;
    1213import java.text.ParseException;
    1314import java.text.SimpleDateFormat;
     
    5960 *  </code>
    6061 *
    61  * @author Oliver Wieland <oliver.wieland@online.de>
     62 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    6263 *
    6364 */
     
    114115        // Get the object of DataInputStream
    115116        DataInputStream in = new DataInputStream(fstream);
    116         BufferedReader br = new BufferedReader(new InputStreamReader(in));
     117        BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
    117118        String strLine;
    118119        // Initial values
     
    225226        // Get the object of DataInputStream
    226227        DataInputStream in = new DataInputStream(fstream);
    227         BufferedReader br = new BufferedReader(new InputStreamReader(in));
     228        BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
    228229        String strLine;
    229230        // Initial values
  • applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVUtils.java

    r34379 r34496  
    66import javax.swing.JOptionPane;
    77
    8 import org.openstreetmap.josm.Main;
     8import org.openstreetmap.josm.gui.MainApplication;
    99
    1010/**
    1111 * Utility functions.
    12  * @author Oliver Wieland <oliver.wieland@online.de>
     12 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt;
    1313 *
    1414 */
     
    5454        if (isStringNullOrEmpty(txt)) return;
    5555       
    56         JOptionPane.showMessageDialog(Main.parent, tr(txt), caption, icon);
     56        JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr(txt), caption, icon);
    5757    }
    5858   
     
    6565     */
    6666    public static boolean isStringNullOrEmpty(String txt) {
    67         return txt == null || txt.length() == 0;
     67        return txt == null || txt.isEmpty();
    6868    }
    6969   
    7070    /**
    7171     * Parses a float number from a string.
    72      * @param txt
     72     * @param txt float value as string
    7373     * @return The corresponding float instance or Float.NaN, if txt was empty or contained an invalid float number.
    7474     */
    7575    public static Float floatFromString(String txt) {
    76         Float f;
    77        
    7876        if (isStringNullOrEmpty(txt)) return Float.NaN;
    79        
     77
    8078        try {
    81             f = Float.parseFloat(txt);
     79            return Float.parseFloat(txt);
    8280        } catch (NumberFormatException nex) {
    83             f = Float.NaN;
     81            return Float.NaN;
    8482        }
    85         return f;
    8683    }   
    8784}
  • applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/WayPointHelper.java

    r34379 r34496  
    1717
    1818/**
    19  * @author Oliver Wieland <oliver.wieland@online.de> Provides several static methods to access way point
     19 * @author Oliver Wieland &lt;oliver.wieland@online.de&gt; Provides several static methods to access way point
    2020 *         attributes.
    2121 */
     
    7474     * @param dlat The distance in latitude direction in meters
    7575     * @param dlon The distance in longitude direction in meters
    76      * @return
     76     * @return new lat/lon coordinates
    7777     */
    7878    public static LatLon moveLatLon(LatLon src, double dlat, double dlon) {
Note: See TracChangeset for help on using the changeset viewer.