Changeset 13214 in josm
- Timestamp:
- 2017-12-17T21:50:59+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r13206 r13214 73 73 import org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource; 74 74 import org.openstreetmap.josm.Main; 75 import org.openstreetmap.josm.actions.ExpertToggleAction; 75 76 import org.openstreetmap.josm.actions.ImageryAdjustAction; 76 77 import org.openstreetmap.josm.actions.RenameLayerAction; … … 93 94 import org.openstreetmap.josm.gui.MapView; 94 95 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener; 96 import org.openstreetmap.josm.gui.Notification; 95 97 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 96 98 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; … … 117 119 import org.openstreetmap.josm.gui.util.GuiHelper; 118 120 import org.openstreetmap.josm.tools.GBC; 121 import org.openstreetmap.josm.tools.HttpClient; 119 122 import org.openstreetmap.josm.tools.Logging; 120 123 import org.openstreetmap.josm.tools.MemoryManager; … … 499 502 } 500 503 504 private void sendOsmTileRequest(String request) { 505 Tile clickedTile = clickedTileHolder.getTile(); 506 if (clickedTile != null) { 507 try { 508 new Notification(HttpClient.create(new URL(clickedTile.getUrl() + '/' + request)) 509 .connect().fetchContent()).show(); 510 } catch (IOException ex) { 511 Logging.error(ex); 512 } 513 } 514 } 515 516 private final class GetOsmTileStatusAction extends AbstractAction { 517 private GetOsmTileStatusAction() { 518 super(tr("Get tile status")); 519 setEnabled(clickedTileHolder.getTile() != null); 520 } 521 522 @Override 523 public void actionPerformed(ActionEvent e) { 524 sendOsmTileRequest("status"); 525 } 526 } 527 528 private final class MarkOsmTileDirtyAction extends AbstractAction { 529 private MarkOsmTileDirtyAction() { 530 super(tr("Force tile rendering")); 531 setEnabled(clickedTileHolder.getTile() != null); 532 } 533 534 @Override 535 public void actionPerformed(ActionEvent e) { 536 sendOsmTileRequest("dirty"); 537 } 538 } 539 501 540 /** 502 541 * Simple class to keep clickedTile within hookUpMapView … … 577 616 add(new JMenuItem(new LoadTileAction())); 578 617 add(new JMenuItem(new ShowTileInfoAction())); 618 if (ExpertToggleAction.isExpert() && tileSource.getBaseUrl().contains(".tile.openstreetmap.org/")) { 619 add(new JMenuItem(new GetOsmTileStatusAction())); 620 add(new JMenuItem(new MarkOsmTileDirtyAction())); 621 } 579 622 } 580 623 } -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r12782 r13214 40 40 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings; 41 41 import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings; 42 import org.openstreetmap.josm.gui.widgets.UrlLabel; 42 43 import org.openstreetmap.josm.tools.GBC; 43 44 import org.openstreetmap.josm.tools.ImageProcessor; … … 176 177 } 177 178 178 protected JTextField createTextField(String text) { 179 protected JComponent createTextField(String text) { 180 if (text != null && text.matches("https?://.*")) { 181 return new UrlLabel(text); 182 } 179 183 JTextField ret = new JTextField(text); 180 184 ret.setEditable(false);
Note:
See TracChangeset
for help on using the changeset viewer.