Changeset 34645 in osm for applications/editors/josm/plugins/imagery_cachexport/src
- Timestamp:
- 2018-09-14T21:30:53+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/imagery_cachexport/src/org/openstreetmap/josm/plugins/imagery_cachexport
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery_cachexport/src/org/openstreetmap/josm/plugins/imagery_cachexport/AbstractImageryCacheExportAction.java
r33748 r34645 14 14 import java.util.List; 15 15 import java.util.Set; 16 16 17 import javax.imageio.ImageIO; 17 18 18 import javax.swing.AbstractAction; 19 19 import javax.swing.JMenuItem; … … 21 21 22 22 import org.apache.commons.jcs.access.CacheAccess; 23 import org.openstreetmap.josm.Main;24 23 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 25 24 import org.openstreetmap.josm.gui.MainApplication; … … 52 51 * @return Currently selected layer. 53 52 */ 54 private AbstractCachedTileSourceLayer getSelectedLayer() {55 return (AbstractCachedTileSourceLayer )LayerListDialog.getInstance().getModel()53 private AbstractCachedTileSourceLayer<?> getSelectedLayer() { 54 return (AbstractCachedTileSourceLayer<?>)LayerListDialog.getInstance().getModel() 56 55 .getSelectedLayers().get(0); 57 56 } … … 81 80 * @return Cache key prefix. 82 81 */ 83 protected String getCacheKeyPrefix(final AbstractCachedTileSourceLayer layer) {82 protected String getCacheKeyPrefix(final AbstractCachedTileSourceLayer<?> layer) { 84 83 return layer.getName().replace(':', '_'); 85 84 } … … 92 91 @Override 93 92 public void actionPerformed(ActionEvent evt) { 94 final AbstractCachedTileSourceLayer layer = getSelectedLayer();93 final AbstractCachedTileSourceLayer<?> layer = getSelectedLayer(); 95 94 final String cacheName = layer.getName(); 96 95 final CacheAccess<String, BufferedImageCacheEntry> cache = getCache(); … … 172 171 @Override 173 172 public void run() { 174 JOptionPane.showMessageDialog(Main .parent, message,173 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), message, 175 174 tr("Error"), JOptionPane.ERROR_MESSAGE); 176 175 } … … 209 208 */ 210 209 private void exportImagery(final String exportPath, 211 final AbstractCachedTileSourceLayer layer,210 final AbstractCachedTileSourceLayer<?> layer, 212 211 final CacheAccess<String, BufferedImageCacheEntry> cache) { 213 212 try { 214 213 Files.createDirectories(Paths.get(exportPath)); 215 214 } catch (FileAlreadyExistsException exn) { 216 JOptionPane.showMessageDialog(Main .parent,215 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 217 216 tr("Export file system path already exists but is not a directory."), 218 217 tr("Error"), … … 222 221 final String message = exn.getLocalizedMessage(); 223 222 if (message != null) { 224 JOptionPane.showMessageDialog(Main .parent,223 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 225 224 tr("Failed to create export directory: {0}", message), 226 225 tr("Error"), 227 226 JOptionPane.ERROR_MESSAGE); 228 227 } else { 229 JOptionPane.showMessageDialog(Main .parent,228 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 230 229 tr("Failed to create export directory."), 231 230 tr("Error"), … … 265 264 * @param image Image to be written. 266 265 * @param file File the image is to be written to. 266 * @throws IOException in case of I/O error 267 267 */ 268 268 public void writeImage(BufferedImage image, File file) throws IOException { -
applications/editors/josm/plugins/imagery_cachexport/src/org/openstreetmap/josm/plugins/imagery_cachexport/ImageryCacheExportPlugin.java
r33073 r34645 2 2 3 3 import org.openstreetmap.josm.gui.layer.TMSLayer; 4 import org.openstreetmap.josm.gui.layer.WMSLayer;5 import org.openstreetmap.josm.gui.layer.WMTSLayer;6 4 import org.openstreetmap.josm.plugins.Plugin; 7 5 import org.openstreetmap.josm.plugins.PluginInformation; -
applications/editors/josm/plugins/imagery_cachexport/src/org/openstreetmap/josm/plugins/imagery_cachexport/ImageryTileExportDialog.java
r33748 r34645 16 16 17 17 import org.apache.commons.jcs.access.CacheAccess; 18 import org.openstreetmap.josm.Main;19 18 import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; 20 19 import org.openstreetmap.josm.gui.ExtendedDialog; 20 import org.openstreetmap.josm.gui.MainApplication; 21 21 import org.openstreetmap.josm.gui.widgets.JosmTextField; 22 22 import org.openstreetmap.josm.spi.preferences.Config; … … 39 39 final String cacheName, 40 40 final String cacheKeyPrefix) { 41 super(Main .parent, tr("Export Tiles"), new String[] {tr("Ok"), tr("Cancel")});41 super(MainApplication.getMainFrame(), tr("Export Tiles"), new String[] {tr("Ok"), tr("Cancel")}); 42 42 this.cacheName = cacheName; 43 43
Note:
See TracChangeset
for help on using the changeset viewer.