Ignore:
Timestamp:
2017-08-24T00:15:51+02:00 (8 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate Main.map and Main.isDisplayingMapView(). Replacements: gui.MainApplication.getMap() / gui.MainApplication.isDisplayingMapView()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/NoteData.java

    r12620 r12630  
    1010import java.util.Map;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.data.coor.LatLon;
    1413import org.openstreetmap.josm.data.notes.Note;
     
    1615import org.openstreetmap.josm.data.notes.NoteComment;
    1716import org.openstreetmap.josm.gui.JosmUserIdentityManager;
     17import org.openstreetmap.josm.gui.MainApplication;
     18import org.openstreetmap.josm.gui.MapFrame;
    1819import org.openstreetmap.josm.tools.ListenerList;
    1920import org.openstreetmap.josm.tools.Logging;
     
    8586    }
    8687
    87     /** Returns the currently selected note
     88    /**
     89     * Returns the currently selected note
    8890     * @return currently selected note
    8991     */
     
    9294    }
    9395
    94     /** Set a selected note. Causes the dialog to select the note and
     96    /**
     97     * Set a selected note. Causes the dialog to select the note and
    9598     * the note layer to draw the selected note's comments.
    9699     * @param note Selected note. Null indicates no selection
     
    98101    public void setSelectedNote(Note note) {
    99102        selectedNote = note;
    100         if (Main.map != null) {
    101             Main.map.noteDialog.selectionChanged();
     103        MapFrame map = MainApplication.getMap();
     104        if (map != null) {
     105            map.noteDialog.selectionChanged();
    102106        }
    103107        listeners.fireEvent(l -> l.selectedNoteChanged(this));
     
    232236
    233237    private void dataUpdated() {
    234         if (Main.isDisplayingMapView()) {
    235             Main.map.noteDialog.setNotes(getSortedNotes());
     238        if (MainApplication.isDisplayingMapView()) {
     239            MainApplication.getMap().noteDialog.setNotes(getSortedNotes());
    236240        }
    237241        listeners.fireEvent(l -> l.noteDataUpdated(this));
Note: See TracChangeset for help on using the changeset viewer.