Changeset 13126 in josm


Ignore:
Timestamp:
2017-11-18T23:51:23+01:00 (7 years ago)
Author:
Don-vip
Message:

see #11217 - forward note tooltips mouse wheel scroll events to map frame

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

Legend:

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

    r12881 r13126  
    4141import org.openstreetmap.josm.actions.mapmode.MapMode;
    4242import org.openstreetmap.josm.data.Bounds;
    43 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
    44 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    4543import org.openstreetmap.josm.data.ProjectionBounds;
    4644import org.openstreetmap.josm.data.ViewportData;
     
    7775import org.openstreetmap.josm.io.audio.AudioPlayer;
    7876import org.openstreetmap.josm.spi.preferences.Config;
     77import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     78import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    7979import org.openstreetmap.josm.tools.JosmRuntimeException;
    8080import org.openstreetmap.josm.tools.Logging;
     
    928928        initialViewport = viewportData;
    929929    }
     930
     931    /**
     932     * Returns the internal {@link MapMover}.
     933     * @return the internal {@code MapMover}
     934     * @since 13126
     935     */
     936    public final MapMover getMapMover() {
     937        return mapMover;
     938    }
    930939}
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r13122 r13126  
    1111import java.awt.event.MouseEvent;
    1212import java.awt.event.MouseListener;
     13import java.awt.event.MouseWheelEvent;
     14import java.awt.event.MouseWheelListener;
    1315import java.io.File;
    1416import java.text.DateFormat;
     
    173175        if (displayedWindow != null) {
    174176            displayedWindow.setVisible(false);
     177            for (MouseWheelListener listener : displayedWindow.getMouseWheelListeners()) {
     178                displayedWindow.removeMouseWheelListener(listener);
     179            }
    175180            displayedWindow.dispose();
    176181            displayedWindow = null;
     
    207212            displayedWindow.setAutoRequestFocus(false);
    208213            displayedWindow.add(displayedPanel);
     214            // Forward mouse wheel scroll event to MapMover
     215            displayedWindow.addMouseWheelListener(e -> mv.getMapMover().mouseWheelMoved(
     216                    (MouseWheelEvent) SwingUtilities.convertMouseEvent(displayedWindow, e, mv)));
    209217        } else {
    210218            displayedPanel.setText(text);
Note: See TracChangeset for help on using the changeset viewer.