Ignore:
Timestamp:
2009-12-12T17:34:12+01:00 (15 years ago)
Author:
jttt
Message:

Fix compilation problems

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

Legend:

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

    r18593 r19050  
    2626                <attribute name="Plugin-Description" value="Displays a slippy map grid in JOSM. Can load tiles from slippy map as background and request updates."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/SlippyMap"/>
    28                 <attribute name="Plugin-Mainversion" value="2450"/>
     28                <attribute name="Plugin-Mainversion" value="2620"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java

    r18784 r19050  
    3939import org.openstreetmap.josm.actions.RenameLayerAction;
    4040import org.openstreetmap.josm.data.Bounds;
     41import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    4142import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    4243import org.openstreetmap.josm.data.coor.LatLon;
     
    212213
    213214        // FIXME: currently ran in errors
    214                
     215
    215216                tileOptionMenu.add(new JMenuItem(
    216217                new AbstractAction(tr("Snap to tile size")) {
     
    251252                });
    252253
    253                 listeners.add(new LayerChangeListener() {
     254                addLayerChangeListener(new LayerChangeListener() {
    254255                    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
     256                        //
    255257                    }
    256258
    257259                    public void layerAdded(Layer newLayer) {
     260                        //
    258261                    }
    259262
    260263                    public void layerRemoved(Layer oldLayer) {
    261                         Main.pref.listener.remove(SlippyMapLayer.this);
     264                        Main.pref.addPreferenceChangeListener(SlippyMapLayer.this);
    262265                    }
    263266                });
     
    265268        });
    266269
    267         Main.pref.listener.add(this);
     270        Main.pref.addPreferenceChangeListener(this);
    268271    }
    269272
     
    795798                    out("queued to load: " + nr_queued + "/" + tiles.size() + " tiles at zoom: " + zoom);
    796799        }
    797         boolean topTile(Tile t) {
    798             if (t.getYtile() == z12y0 )
    799                 return true;
    800             return false;
    801         }
    802 
    803         boolean leftTile(Tile t) {
    804             if (t.getXtile() == z12x0 )
    805                 return true;
    806             return false;
    807         }
    808800    }
    809801
     
    10321024    }
    10331025
    1034     private static int nr_loaded = 0;
    1035     private static int at_zoom = -1;
    1036 
    10371026    /*
    10381027     * (non-Javadoc)
     
    10411030     * preferenceChanged(java.lang.String, java.lang.String)
    10421031     */
    1043     public void preferenceChanged(String key, String newValue) {
    1044         if (key.startsWith(SlippyMapPreferences.PREFERENCE_PREFIX)) {
     1032    public void preferenceChanged(PreferenceChangeEvent event) {
     1033        if (event.getKey().startsWith(SlippyMapPreferences.PREFERENCE_PREFIX)) {
    10451034            // System.err.println(this + ".preferenceChanged('" + key + "', '"
    10461035            // + newValue + "') called");
    10471036            // when fade background changed, no need to clear tile storage
    10481037            // TODO move this code to SlippyMapPreferences class.
    1049             if (!key.equals(SlippyMapPreferences.PREFERENCE_FADE_BACKGROUND)) {
     1038            if (!event.getKey().equals(SlippyMapPreferences.PREFERENCE_FADE_BACKGROUND)) {
    10501039                autoZoomPopup.setSelected(SlippyMapPreferences.getAutozoom());
    10511040            }
    1052             if (key.equals(SlippyMapPreferences.PREFERENCE_TILE_SOURCE)) {
     1041            if (event.getKey().equals(SlippyMapPreferences.PREFERENCE_TILE_SOURCE)) {
    10531042                newTileStorage();
    10541043            }
     
    10591048    @Override
    10601049    public void destroy() {
    1061         Main.pref.listener.remove(SlippyMapLayer.this);
     1050        Main.pref.removePreferenceChangeListener(SlippyMapLayer.this);
    10621051    }
    10631052}
Note: See TracChangeset for help on using the changeset viewer.