Changeset 32046 in osm for applications/editors/josm/plugins/imagery_offset_db/src
- Timestamp:
- 2016-02-03T00:44:44+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery_offset_db/src/iodb/OffsetDialog.java
r30738 r32046 15 15 import java.awt.event.KeyEvent; 16 16 import java.io.IOException; 17 import java.net.HttpURLConnection;18 17 import java.net.URL; 19 18 import java.util.ArrayList; … … 41 40 import org.openstreetmap.josm.gui.layer.ImageryLayer; 42 41 import org.openstreetmap.josm.gui.layer.MapViewPaintable; 42 import org.openstreetmap.josm.tools.HttpClient; 43 43 import org.openstreetmap.josm.tools.ImageProvider; 44 44 import org.openstreetmap.josm.tools.LanguageInfo; 45 45 import org.openstreetmap.josm.tools.OpenBrowser; 46 import org.openstreetmap.josm.tools.Utils;47 46 48 47 /** … … 94 93 calibrationBox.addActionListener(new ActionListener() { 95 94 @Override 96 95 public void actionPerformed( ActionEvent e ) { 97 96 Main.pref.put(PREF_CALIBRATION, calibrationBox.isSelected()); 98 97 updateButtonPanel(); … … 103 102 deprecatedBox.addActionListener(new ActionListener() { 104 103 @Override 105 104 public void actionPerformed( ActionEvent e ) { 106 105 Main.pref.put(PREF_DEPRECATED, deprecatedBox.isSelected()); 107 106 updateButtonPanel(); … … 181 180 */ 182 181 @Override 183 182 public void zoomChanged() { 184 183 for( Component c : buttonPanel.getComponents() ) { 185 184 if( c instanceof OffsetDialogButton ) { … … 194 193 */ 195 194 @Override 196 195 public void paint( Graphics2D g, MapView mv, Bounds bbox ) { 197 196 if( offsets == null ) 198 197 return; … … 237 236 */ 238 237 @Override 239 238 public void actionPerformed( ActionEvent e ) { 240 239 if( e.getSource() instanceof OffsetDialogButton ) { 241 240 selectedOffset = ((OffsetDialogButton)e.getSource()).getOffset(); … … 313 312 */ 314 313 @Override 315 314 public void queryPassed() { 316 315 offset.setDeprecated(new Date(), JosmUserIdentityManager.getInstance().getUserName(), ""); 317 316 updateButtonPanel(); … … 330 329 331 330 @Override 332 331 public void actionPerformed( ActionEvent e ) { 333 332 String base = Main.pref.get("url.openstreetmap-wiki", "http://wiki.openstreetmap.org/wiki/"); 334 333 String lang = LanguageInfo.getWikiLanguagePrefix(); … … 336 335 try { 337 336 // this logic was snatched from {@link org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog.HelpAction} 338 HttpURLConnection conn = Utils.openHttpConnection(new URL(base + lang + page)); 339 conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect", 10) * 1000); 340 if( conn.getResponseCode() != 200 ) { 337 HttpClient.Response conn = HttpClient.create(new URL(base + lang + page), "HEAD").connect(); 338 if (conn.getResponseCode() != 200) { 341 339 conn.disconnect(); 342 340 lang = "";
Note:
See TracChangeset
for help on using the changeset viewer.