Changeset 13388 in josm for trunk/src/org
- Timestamp:
- 2018-02-07T00:16:59+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r13252 r13388 40 40 import org.openstreetmap.josm.tools.ImageProvider; 41 41 import org.openstreetmap.josm.tools.Logging; 42 import org.openstreetmap.josm.tools.bugreport.ReportedException; 42 43 43 44 /** … … 136 137 public void actionPerformed(ActionEvent e) { 137 138 if (!isEnabled()) return; 139 ImageryLayer layer = null; 138 140 try { 139 141 final ImageryInfo infoToAdd = convertImagery(info); 140 142 if (infoToAdd != null) { 141 getLayerManager().addLayer(ImageryLayer.create(infoToAdd)); 143 layer = ImageryLayer.create(infoToAdd); 144 getLayerManager().addLayer(layer); 142 145 AlignImageryPanel.addNagPanelIfNeeded(infoToAdd); 143 146 } 144 } catch (IllegalArgumentException ex) {147 } catch (IllegalArgumentException | ReportedException ex) { 145 148 if (ex.getMessage() == null || ex.getMessage().isEmpty() || GraphicsEnvironment.isHeadless()) { 146 149 throw ex; 147 150 } else { 148 JOptionPane.showMessageDialog(Main.parent, 149 ex.getMessage(), tr("Error"), 150 JOptionPane.ERROR_MESSAGE); 151 Logging.error(ex); 152 JOptionPane.showMessageDialog(Main.parent, ex.getMessage(), tr("Error"), JOptionPane.ERROR_MESSAGE); 153 if (layer != null) { 154 getLayerManager().removeLayer(layer); 155 } 151 156 } 152 157 } -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r13387 r13388 147 147 identifier = builder.identifier; 148 148 } 149 150 @Override 151 public String toString() { 152 return "TileMatrixSet [crs=" + crs + ", identifier=" + identifier + ']'; 153 } 149 154 } 150 155 … … 188 193 public String getUserTitle() { 189 194 return title != null ? title : identifier; 195 } 196 197 @Override 198 public String toString() { 199 return "Layer [identifier=" + identifier + ", title=" + title + ", tileMatrixSet=" 200 + tileMatrixSet + ", baseUrl=" + baseUrl + ", style=" + style + ']'; 190 201 } 191 202 } … … 683 694 } 684 695 if (this.currentLayer == null) 685 return; 696 throw new IllegalArgumentException( 697 layers.stream().map(l -> l.tileMatrixSet).collect(Collectors.toList()).toString()); 686 698 } // else: keep currentLayer and tileProjection as is 687 699 }
Note:
See TracChangeset
for help on using the changeset viewer.