Changeset 33260 in osm for applications


Ignore:
Timestamp:
2017-04-17T02:44:22+02:00 (8 years ago)
Author:
donvip
Message:

fix #josm13725 - Listener was not registered before: LayerChangeAdapter / PrintableMapView

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintableMapView.java

    r33237 r33260  
    2727import org.openstreetmap.josm.gui.MapView;
    2828import org.openstreetmap.josm.gui.layer.Layer;
     29import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     30import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     31import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    2932
    3033/**
     
    4144
    4245    /**
    43      * The factor for scaling the printing graphics to the desired
    44      * resolution
     46     * The factor for scaling the printing graphics to the desired resolution
    4547     */
    4648    protected double g2dFactor;
     
    219221        double dist100px = getDist100Pixel() / g2dFactor;
    220222        double dist = dist100px / som.aValue;
    221         //String unit  = som.aName;
    222223        if (!Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false) && dist > som.bValue / som.aValue) {
    223224            dist = dist100px / som.bValue;
    224             //unit  = som.bName;
    225225        }
    226226        long distExponent = (long) Math.floor(Math.log(dist) / Math.log(10));
    227227        double distMantissa = dist / Math.pow(10, distExponent);
    228         double distScale = 1.0;
     228        double distScale;
    229229        if (distMantissa <= 2.5) {
    230230            distScale = 2.5 / distMantissa;
     
    346346        g2d.setTransform(ax);
    347347    }
     348
     349    @Override
     350    public void layerAdded(LayerAddEvent e) {
     351        // Don't mess with global stuff done by MapView
     352    }
     353
     354    @Override
     355    public void layerRemoving(LayerRemoveEvent e) {
     356        // Don't mess with global stuff done by MapView
     357    }
     358
     359    @Override
     360    public void layerOrderChanged(LayerOrderChangeEvent e) {
     361        // Don't mess with global stuff done by MapView
     362    }
    348363}
Note: See TracChangeset for help on using the changeset viewer.