Ignore:
Timestamp:
2017-08-24T22:53:50+02:00 (21 months ago)
Author:
Don-vip
Message:

see #15182 - deprecate Main.getLayerManager(). Replacement: gui.MainApplication.getLayerManager()

Location:
trunk/src/org/openstreetmap/josm/gui/history
Files:
4 edited

Legend:

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

    r12634 r12636  
    6666    protected HistoryBrowserDialogManager() {
    6767        dialogs = new HashMap<>();
    68         Main.getLayerManager().addLayerChangeListener(this);
     68        MainApplication.getLayerManager().addLayerChangeListener(this);
    6969    }
    7070
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r12620 r12636  
    3636import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    3737import org.openstreetmap.josm.gui.JosmUserIdentityManager;
     38import org.openstreetmap.josm.gui.MainApplication;
    3839import org.openstreetmap.josm.gui.layer.Layer;
    3940import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
     
    101102
    102103        if (Main.main != null) {
    103             OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
     104            OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer();
    104105            if (editLayer != null) {
    105106                editLayer.data.addDataSetListener(this);
    106107            }
    107108        }
    108         Main.getLayerManager().addActiveLayerChangeListener(this);
     109        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
    109110    }
    110111
     
    170171        if (history.getNumVersions() > 0) {
    171172            HistoryOsmPrimitive newLatest = null;
    172             OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
     173            OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer();
    173174            if (editLayer != null) {
    174175                OsmPrimitive p = editLayer.data.getPrimitiveById(history.getId(), history.getType());
     
    531532     */
    532533    public void unlinkAsListener() {
    533         OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
     534        OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer();
    534535        if (editLayer != null) {
    535536            editLayer.data.removeDataSetListener(this);
    536537        }
    537         Main.getLayerManager().removeActiveLayerChangeListener(this);
     538        MainApplication.getLayerManager().removeActiveLayerChangeListener(this);
    538539    }
    539540
  • trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java

    r12634 r12636  
    2121import javax.swing.event.TableModelListener;
    2222
    23 import org.openstreetmap.josm.Main;
    2423import org.openstreetmap.josm.actions.AutoScaleAction;
    2524import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    250249            OsmPrimitive p = getPrimitiveToZoom();
    251250            if (p != null) {
    252                 OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
     251                OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer();
    253252                if (editLayer != null) {
    254253                    editLayer.data.setSelected(p.getPrimitiveId());
     
    266265            if (primitiveId == null)
    267266                return null;
    268             OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
     267            OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer();
    269268            if (editLayer == null)
    270269                return null;
     
    273272
    274273        public void updateEnabledState() {
    275             setEnabled(Main.getLayerManager().getEditLayer() != null && getPrimitiveToZoom() != null);
     274            setEnabled(MainApplication.getLayerManager().getEditLayer() != null && getPrimitiveToZoom() != null);
    276275        }
    277276    }
  • trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java

    r12043 r12636  
    3030import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
    3131import org.openstreetmap.josm.gui.JosmUserIdentityManager;
     32import org.openstreetmap.josm.gui.MainApplication;
    3233import org.openstreetmap.josm.gui.dialogs.ChangesetDialog;
    3334import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager;
     
    155156        String text;
    156157        if (isLatest) {
    157             OsmDataLayer editLayer = Main.getLayerManager().getEditLayer();
     158            OsmDataLayer editLayer = MainApplication.getLayerManager().getEditLayer();
    158159            text = tr("<html>Version <strong>{0}</strong> currently edited in layer ''{1}''</html>",
    159160                    Long.toString(version),
Note: See TracChangeset for help on using the changeset viewer.