Changeset 4465 in josm for trunk/src/org
- Timestamp:
- 2011-09-25T19:48:57+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r4336 r4465 3 3 4 4 import java.awt.Color; 5 import java.awt.Desktop;6 5 import java.awt.Dimension; 7 6 import java.awt.Graphics; … … 12 11 import java.io.File; 13 12 import java.io.IOException; 14 import java.net.URI;15 import java.net.URISyntaxException;16 13 import java.util.ArrayList; 17 14 import java.util.Arrays; … … 40 37 import org.openstreetmap.josm.data.preferences.StringProperty; 41 38 import org.openstreetmap.josm.gui.layer.TMSLayer; 39 import org.openstreetmap.josm.tools.OpenBrowser; 42 40 43 41 public class SlippyMapBBoxChooser extends JMapViewer implements BBoxChooser{ … … 223 221 /* TODO: Somehow indicate the link is clickable state to user */ 224 222 225 try { 226 if((attrImageBounds != null && attrImageBounds.contains(p)) 227 || (attrTextBounds != null && attrTextBounds.contains(p))) { 228 if(click) 229 Desktop.getDesktop().browse(new URI(ts.getAttributionLinkURL())); 230 /*else 231 Main.warn(ts.getAttributionLinkURL());*/ 232 return true; 233 } else if(attrToUBounds != null && attrToUBounds.contains(p)) { 234 if(click) 235 Desktop.getDesktop().browse(new URI(ts.getTermsOfUseURL())); 236 /*else 237 Main.warn(ts.getTermsOfUseURL());*/ 238 return true; 239 } 240 } catch (IOException e1) { 241 e1.printStackTrace(); 242 } catch (URISyntaxException e1) { 243 e1.printStackTrace(); 223 if ((attrImageBounds != null && attrImageBounds.contains(p)) 224 || (attrTextBounds != null && attrTextBounds.contains(p))) { 225 if (click) 226 OpenBrowser.displayUrl(ts.getAttributionLinkURL()); 227 /*else 228 Main.warn(ts.getAttributionLinkURL());*/ 229 return true; 230 } else if (attrToUBounds != null && attrToUBounds.contains(p)) { 231 if (click) 232 OpenBrowser.displayUrl(ts.getTermsOfUseURL()); 233 /*else 234 Main.warn(ts.getTermsOfUseURL());*/ 235 return true; 244 236 } 245 237 return false; -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r4432 r4465 20 20 import java.io.File; 21 21 import java.io.IOException; 22 import java.net.URI;23 import java.net.URISyntaxException;24 22 import java.util.ArrayList; 25 23 import java.util.Collections; … … 70 68 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 71 69 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; 70 import org.openstreetmap.josm.tools.OpenBrowser; 72 71 73 72 /** … … 478 477 tileOptionMenu.show(e.getComponent(), e.getX(), e.getY()); 479 478 } else if (e.getButton() == MouseEvent.BUTTON1) { 480 if(!tileSource.requiresAttribution()) 479 if (!tileSource.requiresAttribution()) 481 480 return; 482 481 483 if((attrImageBounds != null && attrImageBounds.contains(e.getPoint())) 484 || (attrTextBounds != null && attrTextBounds.contains(e.getPoint()))) { 485 try { 486 java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); 487 desktop.browse(new URI(tileSource.getAttributionLinkURL())); 488 } catch (IOException e1) { 489 e1.printStackTrace(); 490 } catch (URISyntaxException e1) { 491 e1.printStackTrace(); 492 } 493 } else if(attrToUBounds != null && attrToUBounds.contains(e.getPoint())) { 494 try { 495 java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); 496 desktop.browse(new URI(tileSource.getTermsOfUseURL())); 497 } catch (IOException e1) { 498 e1.printStackTrace(); 499 } catch (URISyntaxException e1) { 500 e1.printStackTrace(); 501 } 482 if ((attrImageBounds != null && attrImageBounds.contains(e.getPoint())) 483 || (attrTextBounds != null && attrTextBounds.contains(e.getPoint()))) { 484 OpenBrowser.displayUrl(tileSource.getAttributionLinkURL()); 485 } else if (attrToUBounds != null && attrToUBounds.contains(e.getPoint())) { 486 OpenBrowser.displayUrl(tileSource.getTermsOfUseURL()); 502 487 } 503 488 }
Note:
See TracChangeset
for help on using the changeset viewer.