Changeset 9478 in josm
- Timestamp:
- 2016-01-16T01:24:40+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r9464 r9478 22 22 import java.io.File; 23 23 import java.io.IOException; 24 import java.lang.reflect.Field;25 24 import java.net.MalformedURLException; 26 25 import java.net.URL; 27 26 import java.text.SimpleDateFormat; 27 import java.util.ArrayList; 28 28 import java.util.Arrays; 29 import java.util.ArrayList;30 29 import java.util.Collections; 31 30 import java.util.Comparator; … … 42 41 import javax.swing.Action; 43 42 import javax.swing.BorderFactory; 44 import javax.swing.DefaultButtonModel;45 43 import javax.swing.JCheckBoxMenuItem; 46 44 import javax.swing.JLabel; … … 88 86 import org.openstreetmap.josm.io.WMSLayerImporter; 89 87 import org.openstreetmap.josm.tools.GBC; 90 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;91 88 92 89 /** … … 377 374 } 378 375 379 private class LoadTileAction extends AbstractAction {376 private final class LoadTileAction extends AbstractAction { 380 377 381 378 private LoadTileAction() { … … 431 428 } 432 429 430 @Override 433 431 public Component createMenuComponent() { 434 432 JCheckBoxMenuItem item = new JCheckBoxMenuItem(this); … … 454 452 } 455 453 454 @Override 456 455 public Component createMenuComponent() { 457 456 JCheckBoxMenuItem item = new JCheckBoxMenuItem(this); … … 582 581 this.t = t; 583 582 } 584 }585 586 private class BooleanButtonModel extends DefaultButtonModel {587 private final Field field;588 589 BooleanButtonModel(Field field) {590 this.field = field;591 }592 593 @Override594 public boolean isSelected() {595 try {596 return field.getBoolean(AbstractTileSourceLayer.this);597 } catch (IllegalArgumentException | IllegalAccessException e) {598 throw new RuntimeException(e);599 }600 }601 602 583 } 603 584 … … 662 643 } 663 644 645 /** 646 * Tile source layer popup menu. 647 */ 664 648 public class TileSourceLayerPopup extends JPopupMenu { 649 /** 650 * Constructs a new {@code TileSourceLayerPopup}. 651 */ 665 652 public TileSourceLayerPopup() { 666 667 653 for (Action a : getCommonEntries()) { 668 654 if (a instanceof LayerAction) { … … 1650 1636 } 1651 1637 1638 /** 1639 * Returns the common menu entries. 1640 * @return the common menu entries 1641 */ 1652 1642 public Action[] getCommonEntries() { 1653 1643 return new Action[] { … … 1759 1749 public void downloadAreaToCache(final PrecacheTask precacheTask, List<LatLon> points, double bufferX, double bufferY) { 1760 1750 final Set<Tile> requestedTiles = new ConcurrentSkipListSet<>(new Comparator<Tile>() { 1751 @Override 1761 1752 public int compare(Tile o1, Tile o2) { 1762 1753 return String.CASE_INSENSITIVE_ORDER.compare(o1.getKey(), o2.getKey());
Note:
See TracChangeset
for help on using the changeset viewer.