Changeset 12072 in josm


Ignore:
Timestamp:
2017-05-06T15:19:59+02:00 (7 months ago)
Author:
bastiK
Message:

remove property change events in NavigatableComponent (can use ZoomChangeListener instead)

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r11880 r12072  
    104104    public static final BooleanProperty PROP_ZOOM_INTERMEDIATE_STEPS = new BooleanProperty("zoom.intermediate-steps", true);
    105105
    106     /** Property name for center change events */
    107     public static final String PROPNAME_CENTER = "center";
    108     /** Property name for scale change events */
    109     public static final String PROPNAME_SCALE = "scale";
    110 
    111106    /**
    112107     * The layer which scale is set to.
     
    664659    private void zoomNoUndoTo(EastNorth newCenter, double newScale, boolean initial) {
    665660        if (!Utils.equalsEpsilon(getScale(), newScale)) {
    666             double oldScale = getScale();
    667661            state = state.usingScale(newScale);
    668             if (!initial) {
    669                 firePropertyChange(PROPNAME_SCALE, oldScale, newScale);
    670             }
    671662        }
    672663        if (!newCenter.equals(getCenter())) {
    673             EastNorth oldCenter = getCenter();
    674664            state = state.movedTo(state.getCenter(), newCenter);
    675             if (!initial) {
    676                 firePropertyChange(PROPNAME_CENTER, oldCenter, newCenter);
    677             }
    678         }
    679 
     665        }
    680666        if (!initial) {
    681667            repaint();
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r11848 r12072  
    1919import java.awt.event.MouseMotionAdapter;
    2020import java.awt.image.BufferedImage;
    21 import java.beans.PropertyChangeEvent;
    22 import java.beans.PropertyChangeListener;
    2321import java.io.File;
    2422import java.io.IOException;
     
    7573 * Layer displaying geottaged pictures.
    7674 */
    77 public class GeoImageLayer extends AbstractModifiableLayer implements PropertyChangeListener, JumpToMarkerLayer {
     75public class GeoImageLayer extends AbstractModifiableLayer implements
     76        JumpToMarkerLayer, NavigatableComponent.ZoomChangeListener {
    7877
    7978    private static List<Action> menuAdditions = new LinkedList<>();
     
    10261025        });
    10271026
    1028         Main.map.mapView.addPropertyChangeListener(this);
    10291027        if (Main.map.getToggleDialog(ImageViewerDialog.class) == null) {
    10301028            ImageViewerDialog.newInstance();
     
    10341032
    10351033    @Override
    1036     public void propertyChange(PropertyChangeEvent evt) {
    1037         if (NavigatableComponent.PROPNAME_CENTER.equals(evt.getPropertyName()) ||
    1038                 NavigatableComponent.PROPNAME_SCALE.equals(evt.getPropertyName())) {
    1039             updateOffscreenBuffer = true;
    1040         }
     1034    public LayerPainter attachToMapView(MapViewEvent event) {
     1035        MapView.addZoomChangeListener(this);
     1036        return super.attachToMapView(event);
     1037    }
     1038
     1039    @Override
     1040    public void zoomChanged() {
     1041        updateOffscreenBuffer = true;
    10411042    }
    10421043
Note: See TracChangeset for help on using the changeset viewer.