Changeset 36352 in osm for applications/editors/josm/plugins/opendata
- Timestamp:
- 2024-10-31T14:18:10+01:00 (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeotoolsConverter.java
r36176 r36352 3 3 4 4 import static org.openstreetmap.josm.plugins.opendata.core.io.geographic.GeographicReader.wgs84; 5 import static org.openstreetmap.josm.tools.I18n.marktr; 5 6 import static org.openstreetmap.josm.tools.I18n.tr; 6 7 … … 43 44 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 44 45 import org.openstreetmap.josm.gui.util.GuiHelper; 46 import org.openstreetmap.josm.plugins.opendata.core.io.geographic.geopackage.GeoPackageReader; 45 47 import org.openstreetmap.josm.tools.Logging; 46 48 import org.openstreetmap.josm.tools.UserCancelException; … … 77 79 String[] typeNames = dataStore.getTypeNames(); 78 80 if (progressMonitor != null) { 79 progressMonitor.beginTask(tr( "Loading shapefile ({0} layers)", typeNames.length), typeNames.length);81 progressMonitor.beginTask(tr(getLayerMessage(this.reader.getClass()), typeNames.length), typeNames.length); 80 82 } 81 83 try { … … 114 116 throws FactoryException, GeoMathTransformException, TransformException, GeoCrsException { 115 117 if (progressMonitor != null) { 116 progressMonitor.beginTask(tr( "Loading shapefile ({0} features)", collection.size()), collection.size());118 progressMonitor.beginTask(tr(getFeatureMessage(this.reader.getClass()), collection.size()), collection.size()); 117 119 } 118 120 … … 151 153 } 152 154 } 155 } 156 157 /** 158 * Get the message for loading layers 159 * @param clazz The class to use to figure out which message to show 160 * @return The message to show the user 161 */ 162 private static String getLayerMessage(Class<? extends GeographicReader> clazz) { 163 if (GeoPackageReader.class.equals(clazz)) { 164 return marktr("Loading GeoPackage ({0} layers)"); 165 } else if (GmlReader.class.equals(clazz)) { 166 return marktr("Loading GML ({0} layers)"); 167 } 168 return marktr("Loading shapefile ({0} layers)"); 169 } 170 171 /** 172 * Get the message for loading features 173 * @param clazz The class to use to figure out which message to show 174 * @return The message to show the user 175 */ 176 private static String getFeatureMessage(Class<? extends GeographicReader> clazz) { 177 if (GeoPackageReader.class.equals(clazz)) { 178 return marktr("Loading GeoPackage ({0} features)"); 179 } else if (GmlReader.class.equals(clazz)) { 180 return marktr("Loading GML ({0} features)"); 181 } 182 return marktr("Loading shapefile ({0} features)"); 153 183 } 154 184
Note:
See TracChangeset
for help on using the changeset viewer.