Changeset 30426 in osm for applications/viewer/jmapviewer/src/org
- Timestamp:
- 2014-04-29T00:12:00+02:00 (11 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/AbstractLayer.java
r30240 r30426 72 72 public static <E> List<E> add(List<E> list, E element) { 73 73 if(element!=null){ 74 if(list==null) list = new ArrayList< E>();74 if(list==null) list = new ArrayList<>(); 75 75 if(!list.contains(element)) list.add(element); 76 76 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/AttributionSupport.java
r30223 r30426 32 32 33 33 static { 34 HashMap<TextAttribute, Integer> aUnderline = new HashMap< TextAttribute, Integer>();34 HashMap<TextAttribute, Integer> aUnderline = new HashMap<>(); 35 35 aUnderline.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON); 36 36 ATTR_LINK_FONT = ATTR_FONT.deriveFont(aUnderline); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Demo.java
r30244 r30426 94 94 } 95 95 }); 96 JComboBox tileSourceSelector = new JComboBox(new TileSource[] { new OsmTileSource.Mapnik(),96 JComboBox<TileSource> tileSourceSelector = new JComboBox<>(new TileSource[] { new OsmTileSource.Mapnik(), 97 97 new OsmTileSource.CycleMap(), new BingAerialTileSource(), new MapQuestOsmTileSource(), new MapQuestOpenAerialTileSource() }); 98 98 tileSourceSelector.addItemListener(new ItemListener() { … … 101 101 } 102 102 }); 103 JComboBox tileLoaderSelector;103 JComboBox<TileLoader> tileLoaderSelector; 104 104 try { 105 tileLoaderSelector = new JComboBox(new TileLoader[] { new OsmFileCacheTileLoader(map()), 106 new OsmTileLoader(map()) }); 105 tileLoaderSelector = new JComboBox<>(new TileLoader[] { new OsmFileCacheTileLoader(map()), new OsmTileLoader(map()) }); 107 106 } catch (IOException e) { 108 tileLoaderSelector = new JComboBox (new TileLoader[] { new OsmTileLoader(map()) });107 tileLoaderSelector = new JComboBox<>(new TileLoader[] { new OsmTileLoader(map()) }); 109 108 } 110 109 tileLoaderSelector.addItemListener(new ItemListener() { -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
r30403 r30426 110 110 tileSource = new OsmTileSource.Mapnik(); 111 111 tileController = new TileController(tileSource, tileCache, this); 112 mapMarkerList = new LinkedList< MapMarker>();113 mapPolygonList = new LinkedList< MapPolygon>();114 mapRectangleList = new LinkedList< MapRectangle>();112 mapMarkerList = new LinkedList<>(); 113 mapPolygonList = new LinkedList<>(); 114 mapRectangleList = new LinkedList<>(); 115 115 mapMarkersVisible = true; 116 116 mapRectanglesVisible = true; … … 712 712 List<? extends ICoordinate> coords = polygon.getPoints(); 713 713 if (coords != null && coords.size() >= 3) { 714 List<Point> points = new LinkedList< Point>();714 List<Point> points = new LinkedList<>(); 715 715 for (ICoordinate c : coords) { 716 716 Point p = getMapPosition(c, false); … … 724 724 int tilesize = tileSource.getTileSize(); 725 725 int mapSize = tilesize << zoom; 726 List<Point> pointsWrapped = new LinkedList< Point>(points);726 List<Point> pointsWrapped = new LinkedList<>(points); 727 727 boolean keepWrapping = true; 728 728 while (keepWrapping) { … … 735 735 polygon.paint(g, pointsWrapped); 736 736 } 737 pointsWrapped = new LinkedList< Point>(points);737 pointsWrapped = new LinkedList<>(points); 738 738 keepWrapping = true; 739 739 while (keepWrapping) { -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java
r30223 r30426 32 32 } 33 33 34 protected BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque< TileJob>();34 protected BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>(); 35 35 36 36 protected static int workerThreadMaxCount = 8; -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java
r30223 r30426 33 33 34 34 public MemoryTileCache() { 35 hash = new HashMap< String, CacheEntry>(cacheSize);35 hash = new HashMap<>(cacheSize); 36 36 lruTiles = new CacheLinkedListElement(); 37 37 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java
r30270 r30426 100 100 log.finest("Tile cache directory: " + cacheDir); 101 101 cacheDirBase = cacheDir.getAbsolutePath(); 102 sourceCacheDirMap = new HashMap< TileSource, File>();102 sourceCacheDirMap = new HashMap<>(); 103 103 } 104 104 -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
r30223 r30426 25 25 * Holds the HTTP headers. Insert e.g. User-Agent here when default should not be used. 26 26 */ 27 public Map<String, String> headers = new HashMap< String, String>();27 public Map<String, String> headers = new HashMap<>(); 28 28 29 29 public int timeoutConnect = 0; -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
r30223 r30426 297 297 } 298 298 if (metadata == null) { 299 metadata = new HashMap< String,String>();299 metadata = new HashMap<>(); 300 300 } 301 301 metadata.put(key, value); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
r30223 r30426 108 108 109 109 NodeList imageryProviderNodes = (NodeList) xpath.compile("//ImageryMetadata/ImageryProvider").evaluate(document, XPathConstants.NODESET); 110 List<Attribution> attributions = new ArrayList< Attribution>(imageryProviderNodes.getLength());110 List<Attribution> attributions = new ArrayList<>(imageryProviderNodes.getLength()); 111 111 for (int i = 0; i < imageryProviderNodes.getLength(); i++) { 112 112 Node providerNode = imageryProviderNodes.item(i); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java
r30377 r30426 12 12 private Random rand = null; 13 13 private String[] randomParts = null; 14 private Map<String, String> headers = new HashMap< String, String>();14 private Map<String, String> headers = new HashMap<>(); 15 15 16 16 public static final String PATTERN_ZOOM = "\\{(?:(\\d+)-)?z(?:oom)?([+-]\\d+)?\\}";
Note:
See TracChangeset
for help on using the changeset viewer.