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

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

Location:
trunk/src/org/openstreetmap/josm/data
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java

    r12620 r12630  
    1919import org.openstreetmap.josm.data.projection.Projection;
    2020import org.openstreetmap.josm.data.projection.Projections;
     21import org.openstreetmap.josm.gui.MainApplication;
    2122import org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer;
    2223import org.openstreetmap.josm.gui.layer.ImageryLayer;
     
    246247    public static void bookmarkOffset(String name, AbstractTileSourceLayer layer) {
    247248        LatLon center;
    248         if (Main.isDisplayingMapView()) {
    249             center = Main.getProjection().eastNorth2latlon(Main.map.mapView.getCenter());
     249        if (MainApplication.isDisplayingMapView()) {
     250            center = Main.getProjection().eastNorth2latlon(MainApplication.getMap().mapView.getCenter());
    250251        } else {
    251252            center = LatLon.ZERO;
  • trunk/src/org/openstreetmap/josm/data/osm/FilterMatcher.java

    r12383 r12630  
    66import java.util.List;
    77
    8 import org.openstreetmap.josm.Main;
    98import org.openstreetmap.josm.actions.search.SearchAction.SearchMode;
    109import org.openstreetmap.josm.actions.search.SearchCompiler;
     
    1211import org.openstreetmap.josm.actions.search.SearchCompiler.Not;
    1312import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;
     13import org.openstreetmap.josm.gui.MainApplication;
     14import org.openstreetmap.josm.gui.MapFrame;
    1415import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    1516
     
    224225
    225226    private static FilterType test(List<FilterInfo> filters, OsmPrimitive primitive, boolean hidden) {
    226 
     227        MapFrame map = MainApplication.getMap();
    227228        if (primitive.isIncomplete() ||
    228                 (Main.map != null && Main.map.mapMode != null && Main.map.mapMode.getPreservedPrimitives().contains(primitive)))
     229                (map != null && map.mapMode != null && map.mapMode.getPreservedPrimitives().contains(primitive)))
    229230            return FilterType.NOT_FILTERED;
    230231
  • trunk/src/org/openstreetmap/josm/data/osm/FilterModel.java

    r12620 r12630  
    1919import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;
    2020import org.openstreetmap.josm.data.osm.Filter.FilterPreferenceEntry;
     21import org.openstreetmap.josm.gui.MainApplication;
    2122import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2223import org.openstreetmap.josm.gui.widgets.OSDLabel;
     
    323324        lblOSD.setSize(lblOSD.getPreferredSize());
    324325
    325         int dx = Main.map.mapView.getWidth() - lblOSD.getPreferredSize().width - 15;
     326        int dx = MainApplication.getMap().mapView.getWidth() - lblOSD.getPreferredSize().width - 15;
    326327        int dy = 15;
    327328        g.translate(dx, dy);
  • 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));
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java

    r12190 r12630  
    1818import org.openstreetmap.josm.data.osm.PrimitiveId;
    1919import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
     20import org.openstreetmap.josm.gui.MainApplication;
    2021import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
    2122import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
     
    226227    @Override
    227228    public void layerRemoving(LayerRemoveEvent e) {
    228         if (!Main.isDisplayingMapView()) return;
     229        if (!MainApplication.isDisplayingMapView()) return;
    229230        if (Main.getLayerManager().getLayers().isEmpty()) {
    230231            data.clear();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java

    r12163 r12630  
    1515import org.openstreetmap.josm.data.osm.RelationMember;
    1616import org.openstreetmap.josm.data.osm.Way;
     17import org.openstreetmap.josm.gui.MainApplication;
     18import org.openstreetmap.josm.gui.MapFrame;
    1719
    1820/**
     
    197199            return;
    198200        // convert size from meters to east/north units
    199         double enSize = size * Main.map.mapView.getScale() / Main.map.mapView.getDist100Pixel() * 100;
     201        MapFrame map = MainApplication.getMap();
     202        double enSize = size * map.mapView.getScale() / map.mapView.getDist100Pixel() * 100;
    200203        visit(bounds.getMin().add(-enSize/2, -enSize/2));
    201204        visit(bounds.getMax().add(+enSize/2, +enSize/2));
Note: See TracChangeset for help on using the changeset viewer.