- Timestamp:
- 2018-05-24T23:53:37+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r13827 r13828 140 140 if (!GraphicsEnvironment.isHeadless()) { 141 141 JOptionPane.showMessageDialog(Main.parent, tr("Could not parse WMTS layer list."), 142 tr("WM S Error"), JOptionPane.ERROR_MESSAGE);142 tr("WMTS Error"), JOptionPane.ERROR_MESSAGE); 143 143 } 144 144 Logging.log(Logging.LEVEL_ERROR, "Could not parse WMTS layer list.", e); -
trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java
r13824 r13828 75 75 76 76 /** 77 * Returns reader with properties set for parsing WM(T)S documents 78 * 77 79 * @param in InputStream with pointing to GetCapabilities XML stream 78 80 * @return safe XMLStreamReader, that is not validating external entities, nor loads DTD's … … 235 237 236 238 /** 239 * Normalize url 240 * 237 241 * @param url URL 238 242 * @return normalized URL -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r13824 r13828 24 24 import javax.json.Json; 25 25 import javax.json.JsonObject; 26 import javax.json.JsonReader; 26 27 import javax.json.stream.JsonCollectors; 27 28 import javax.swing.ImageIcon; … … 556 557 modTileFeatures = e.modTileFeatures; 557 558 if (e.default_layers != null) { 558 defaultLayers = Json.createReader(new StringReader(e.default_layers)). 559 readArray(). 560 stream(). 561 map(x -> DefaultLayer.fromJson((JsonObject) x, imageryType)). 562 collect(Collectors.toList()); 559 try (JsonReader jsonReader = Json.createReader(new StringReader(e.default_layers))) { 560 defaultLayers = jsonReader. 561 readArray(). 562 stream(). 563 map(x -> DefaultLayer.fromJson((JsonObject) x, imageryType)). 564 collect(Collectors.toList()); 565 } 563 566 } 564 567 customHttpHeaders = e.customHttpHeaders; -
trunk/src/org/openstreetmap/josm/data/imagery/TileLoaderFactory.java
r13733 r13828 17 17 18 18 /** 19 * Creates TileLoaderFactory - factory that creates tile loaders with all options already set 20 * 19 21 * @param listener that will be notified, when tile has finished loading 20 22 * @param headers that will be sent with requests to TileSource. <code>null</code> indicates none -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r13824 r13828 14 14 import java.util.Collection; 15 15 import java.util.Collections; 16 import java.util.Deque; 16 17 import java.util.LinkedHashSet; 18 import java.util.LinkedList; 17 19 import java.util.List; 18 20 import java.util.Map; … … 21 23 import java.util.Optional; 22 24 import java.util.SortedSet; 23 import java.util.Stack;24 25 import java.util.TreeSet; 25 26 import java.util.concurrent.ConcurrentHashMap; … … 252 253 253 254 /** 254 * Exception thrown when p raser doesn't find expected information in GetCapabilities document255 * Exception thrown when parser doesn't find expected information in GetCapabilities document 255 256 * 256 257 */ … … 258 259 259 260 /** 261 * Create WMTS exception 260 262 * @param cause description of cause 261 263 */ … … 265 267 266 268 /** 269 * Create WMTS exception 267 270 * @param cause description of cause 268 271 * @param t nested exception … … 373 376 374 377 /** 378 * Call remote server and parse response to WMTSCapabilities object 379 * 375 380 * @param url of the getCapabilities document 376 381 * @param headers HTTP headers to set when calling getCapabilities url … … 479 484 private static Layer parseLayer(XMLStreamReader reader) throws XMLStreamException { 480 485 Layer layer = new Layer(); 481 Stack<QName> tagStack = new Stack<>();486 Deque<QName> tagStack = new LinkedList<>(); 482 487 List<String> supportedMimeTypes = new ArrayList<>(Arrays.asList(ImageIO.getReaderMIMETypes())); 483 488 supportedMimeTypes.add("image/jpgpng"); // used by ESRI -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
r13824 r13828 42 42 private final transient WMSLayerTree tree = new WMSLayerTree(); 43 43 private final JComboBox<String> formats = new JComboBox<>(); 44 private final JLabel wmsInstruction;45 44 private final JosmTextArea wmsUrl = new JosmTextArea(3, 40).transferFocusOnTab(); 46 45 private final JButton showBounds = new JButton(tr("Show bounds")); … … 73 72 addCommonSettings(); 74 73 75 wmsInstruction = new JLabel(tr("{0} Edit generated {1} URL (optional)", "6.", "WMS"));74 JLabel wmsInstruction = new JLabel(tr("{0} Edit generated {1} URL (optional)", "6.", "WMS")); 76 75 add(wmsInstruction, GBC.eol()); 77 76 wmsInstruction.setLabelFor(wmsUrl); -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java
r13824 r13828 46 46 JButton getLayers = new JButton(tr("{0} Get layers", "3.")); 47 47 getLayers.setEnabled(setDefaultLayer.isSelected()); 48 setDefaultLayer.addActionListener(e -> { 49 getLayers.setEnabled(setDefaultLayer.isSelected()); 50 }); 48 setDefaultLayer.addActionListener(e -> getLayers.setEnabled(setDefaultLayer.isSelected())); 51 49 add(setDefaultLayer, GBC.eop()); 52 50 add(getLayers, GBC.eop().fill(GBC.HORIZONTAL)); … … 76 74 layerPanel.revalidate(); 77 75 } catch (IOException | WMTSGetCapabilitiesException ex) { 76 Logging.trace(ex); 78 77 JOptionPane.showMessageDialog( 79 78 getParent(), -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/HeadersTable.java
r13742 r13828 81 81 } 82 82 83 private final JTable table;84 83 private List<String[]> headers; 85 84 … … 98 97 super(new GridBagLayout()); 99 98 this.headers = getHeadersAsVector(headers); 100 table = new JTable(new HeaderTableModel());99 JTable table = new JTable(new HeaderTableModel()); 101 100 table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 102 101 table.setAutoCreateRowSorter(true); -
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r13827 r13828 177 177 capabilitiesUrl = new URL(workingAddress); 178 178 } catch (MalformedURLException e) { 179 if (savedExc != null) {179 if (savedExc == null) { 180 180 savedExc = e; 181 181 }
Note:
See TracChangeset
for help on using the changeset viewer.