Changeset 34496 in osm for applications/editors
- Timestamp:
- 2018-08-18T03:13:39+02:00 (6 years ago)
- 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 14 14 org.eclipse.jdt.core.compiler.debug.localVariable=generate 15 15 org.eclipse.jdt.core.compiler.debug.sourceFile=generate 16 org.eclipse.jdt.core.compiler.doc.comment.support=enabled 16 17 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 17 18 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error … … 37 38 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 38 39 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 40 org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning 41 org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled 42 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled 43 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled 44 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private 39 45 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 40 46 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning … … 43 49 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 44 50 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 51 org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore 52 org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled 53 org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public 54 org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags 55 org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning 56 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled 57 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled 58 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private 45 59 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 46 60 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -
applications/editors/josm/plugins/ColumbusCSV/build.xml
r33862 r34496 4 4 <property name="commit.message" value="Commit message"/> 5 5 <!-- Enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 2840"/>6 <property name="plugin.main.version" value="14153"/> 7 7 8 8 <!-- Plugin meta data --> -
applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVImporter.java
r34379 r34496 7 7 import java.io.IOException; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.actions.AutoScaleAction; 11 10 import org.openstreetmap.josm.actions.ExtensionFileFilter; … … 18 17 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 19 18 import org.openstreetmap.josm.io.IllegalDataException; 19 import org.openstreetmap.josm.spi.preferences.Config; 20 20 import org.openstreetmap.josm.tools.Logging; 21 21 22 22 /** 23 23 * 24 * @author Oliver Wieland <oliver.wieland@online.de>24 * @author Oliver Wieland <oliver.wieland@online.de> 25 25 * 26 26 */ … … 89 89 progressMonitor.setTicksCount(4); 90 90 91 if ( Main.pref.getBoolean("marker.makeautomarkers", true)) {91 if (Config.getPref().getBoolean("marker.makeautomarkers", true)) { 92 92 try { 93 93 MarkerLayer ml = new MarkerLayer(gpxData, -
applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVPlugin.java
r34379 r34496 10 10 * Plugin class to import Columbus V-900 CSV files into JOSM. 11 11 * 12 * @author Oliver Wieland <oliver.wieland@online.de>Wieland12 * @author Oliver Wieland <oliver.wieland@online.de> Wieland 13 13 * 14 14 */ 15 15 public class ColumbusCSVPlugin extends Plugin { 16 16 private static PreferenceSetting columbusSettings; 17 17 18 /** 18 19 * Plugin constructor (adds menu entry to file menu). 20 * @param info plugin information 19 21 */ 20 22 public ColumbusCSVPlugin(PluginInformation info) { -
applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVPreferences.java
r34379 r34496 7 7 import javax.swing.JCheckBox; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 11 10 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 11 import org.openstreetmap.josm.spi.preferences.Config; 12 12 13 13 /** 14 14 * Implements the preferences dialog for this plugin. 15 * @author Oliver Wieland <oliver.wieland@online.de>15 * @author Oliver Wieland <oliver.wieland@online.de> 16 16 */ 17 17 public class ColumbusCSVPreferences extends DefaultTabPreferenceSetting { … … 61 61 @Override 62 62 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()); 68 68 return false; 69 69 } … … 71 71 /** 72 72 * 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 74 74 */ 75 75 public static boolean showSummary() { 76 return Main.pref.getBoolean(SHOW_SUMMARY, true);76 return Config.getPref().getBoolean(SHOW_SUMMARY, true); 77 77 } 78 78 79 79 /** 80 * If <tt>true</tt>, athe 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 82 82 */ 83 83 public static boolean zoomAfterImport() { 84 return Main.pref.getBoolean(ZOOM_AFTER_IMPORT, true);84 return Config.getPref().getBoolean(ZOOM_AFTER_IMPORT, true); 85 85 } 86 86 … … 89 89 * this setting has no effect. 90 90 * Default is <tt>false</tt>. 91 * @return 91 * @return <tt>true</tt> if all DOP values (hdop, vdop, pdop) are ignored 92 92 */ 93 93 public static boolean ignoreDOP() { 94 return Main.pref.getBoolean(IGNORE_VDOP, false);94 return Config.getPref().getBoolean(IGNORE_VDOP, false); 95 95 } 96 96 97 97 /** 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. 99 99 * Default is <tt>true</tt>. 100 * @return 100 * @return <tt>true</tt> if the plugin issues warnings when either date or position errors occurr. 101 101 */ 102 102 public static boolean warnConversion() { 103 return Main.pref.getBoolean(WARN_CONVERSION_ERRORS, false);103 return Config.getPref().getBoolean(WARN_CONVERSION_ERRORS, false); 104 104 } 105 105 … … 107 107 * If <tt>true</tt>, the plugin issues a warning if a referenced audio file is missing. 108 108 * 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 110 110 */ 111 111 public static boolean warnMissingAudio() { 112 return Main.pref.getBoolean(WARN_MISSING_AUDIO, false);112 return Config.getPref().getBoolean(WARN_MISSING_AUDIO, false); 113 113 } 114 114 … … 131 131 132 132 // 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)); 138 138 } 139 139 -
applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVReader.java
r34379 r34496 10 10 import java.io.IOException; 11 11 import java.io.InputStreamReader; 12 import java.nio.charset.StandardCharsets; 12 13 import java.text.ParseException; 13 14 import java.text.SimpleDateFormat; … … 59 60 * </code> 60 61 * 61 * @author Oliver Wieland <oliver.wieland@online.de>62 * @author Oliver Wieland <oliver.wieland@online.de> 62 63 * 63 64 */ … … 114 115 // Get the object of DataInputStream 115 116 DataInputStream in = new DataInputStream(fstream); 116 BufferedReader br = new BufferedReader(new InputStreamReader(in ));117 BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)); 117 118 String strLine; 118 119 // Initial values … … 225 226 // Get the object of DataInputStream 226 227 DataInputStream in = new DataInputStream(fstream); 227 BufferedReader br = new BufferedReader(new InputStreamReader(in ));228 BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)); 228 229 String strLine; 229 230 // Initial values -
applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/ColumbusCSVUtils.java
r34379 r34496 6 6 import javax.swing.JOptionPane; 7 7 8 import org.openstreetmap.josm. Main;8 import org.openstreetmap.josm.gui.MainApplication; 9 9 10 10 /** 11 11 * Utility functions. 12 * @author Oliver Wieland <oliver.wieland@online.de>12 * @author Oliver Wieland <oliver.wieland@online.de> 13 13 * 14 14 */ … … 54 54 if (isStringNullOrEmpty(txt)) return; 55 55 56 JOptionPane.showMessageDialog(Main .parent, tr(txt), caption, icon);56 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr(txt), caption, icon); 57 57 } 58 58 … … 65 65 */ 66 66 public static boolean isStringNullOrEmpty(String txt) { 67 return txt == null || txt. length() == 0;67 return txt == null || txt.isEmpty(); 68 68 } 69 69 70 70 /** 71 71 * Parses a float number from a string. 72 * @param txt 72 * @param txt float value as string 73 73 * @return The corresponding float instance or Float.NaN, if txt was empty or contained an invalid float number. 74 74 */ 75 75 public static Float floatFromString(String txt) { 76 Float f;77 78 76 if (isStringNullOrEmpty(txt)) return Float.NaN; 79 77 80 78 try { 81 f =Float.parseFloat(txt);79 return Float.parseFloat(txt); 82 80 } catch (NumberFormatException nex) { 83 f =Float.NaN;81 return Float.NaN; 84 82 } 85 return f;86 83 } 87 84 } -
applications/editors/josm/plugins/ColumbusCSV/src/org/openstreetmap/josm/plugins/columbusCSV/WayPointHelper.java
r34379 r34496 17 17 18 18 /** 19 * @author Oliver Wieland <oliver.wieland@online.de>Provides several static methods to access way point19 * @author Oliver Wieland <oliver.wieland@online.de> Provides several static methods to access way point 20 20 * attributes. 21 21 */ … … 74 74 * @param dlat The distance in latitude direction in meters 75 75 * @param dlon The distance in longitude direction in meters 76 * @return 76 * @return new lat/lon coordinates 77 77 */ 78 78 public static LatLon moveLatLon(LatLon src, double dlat, double dlon) {
Note:
See TracChangeset
for help on using the changeset viewer.