Changeset 32046 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-02-03T00:44:44+01:00 (9 years ago)
Author:
donvip
Message:

[josm_iodb] update to JOSM 9168 - use HttpClient

Location:
applications/editors/josm/plugins/imagery_offset_db
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery_offset_db/build.xml

    r31923 r32046  
    55    <property name="commit.message" value="Imagery Offset Database"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="7687"/>
     7    <property name="plugin.main.version" value="9168"/>
    88        <property name="plugin.canloadatruntime" value="true"/>
    99
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/OffsetDialog.java

    r30738 r32046  
    1515import java.awt.event.KeyEvent;
    1616import java.io.IOException;
    17 import java.net.HttpURLConnection;
    1817import java.net.URL;
    1918import java.util.ArrayList;
     
    4140import org.openstreetmap.josm.gui.layer.ImageryLayer;
    4241import org.openstreetmap.josm.gui.layer.MapViewPaintable;
     42import org.openstreetmap.josm.tools.HttpClient;
    4343import org.openstreetmap.josm.tools.ImageProvider;
    4444import org.openstreetmap.josm.tools.LanguageInfo;
    4545import org.openstreetmap.josm.tools.OpenBrowser;
    46 import org.openstreetmap.josm.tools.Utils;
    4746
    4847/**
     
    9493        calibrationBox.addActionListener(new ActionListener() {
    9594            @Override
    96                         public void actionPerformed( ActionEvent e ) {
     95            public void actionPerformed( ActionEvent e ) {
    9796                Main.pref.put(PREF_CALIBRATION, calibrationBox.isSelected());
    9897                updateButtonPanel();
     
    103102        deprecatedBox.addActionListener(new ActionListener() {
    104103            @Override
    105                         public void actionPerformed( ActionEvent e ) {
     104            public void actionPerformed( ActionEvent e ) {
    106105                Main.pref.put(PREF_DEPRECATED, deprecatedBox.isSelected());
    107106                updateButtonPanel();
     
    181180     */
    182181    @Override
    183         public void zoomChanged() {
     182    public void zoomChanged() {
    184183        for( Component c : buttonPanel.getComponents() ) {
    185184            if( c instanceof OffsetDialogButton ) {
     
    194193     */
    195194    @Override
    196         public void paint( Graphics2D g, MapView mv, Bounds bbox ) {
     195    public void paint( Graphics2D g, MapView mv, Bounds bbox ) {
    197196        if( offsets == null )
    198197            return;
     
    237236     */
    238237    @Override
    239         public void actionPerformed( ActionEvent e ) {
     238    public void actionPerformed( ActionEvent e ) {
    240239        if( e.getSource() instanceof OffsetDialogButton ) {
    241240            selectedOffset = ((OffsetDialogButton)e.getSource()).getOffset();
     
    313312         */
    314313        @Override
    315                 public void queryPassed() {
     314        public void queryPassed() {
    316315            offset.setDeprecated(new Date(), JosmUserIdentityManager.getInstance().getUserName(), "");
    317316            updateButtonPanel();
     
    330329
    331330        @Override
    332                 public void actionPerformed( ActionEvent e ) {
     331        public void actionPerformed( ActionEvent e ) {
    333332            String base = Main.pref.get("url.openstreetmap-wiki", "http://wiki.openstreetmap.org/wiki/");
    334333            String lang = LanguageInfo.getWikiLanguagePrefix();
     
    336335            try {
    337336                // 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) {
    341339                    conn.disconnect();
    342340                    lang = "";
Note: See TracChangeset for help on using the changeset viewer.