Ignore:
Timestamp:
2017-08-25T03:29:37+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate Main.main.panel. Replacement: gui.MainApplication.getMainPanel()

File:
1 edited

Legend:

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

    r12641 r12642  
    136136
    137137    /**
    138      * The same panel as {@link Main#panel}, required to be static for {@link MapFrameListener} handling.
     138     * The main panel, required to be static for {@link MapFrameListener} handling.
    139139     */
    140140    static MainPanel mainPanel;
     
    165165
    166166    /**
     167     * Provides access to the layers displayed in the main view.
     168     */
     169    private static final MainLayerManager layerManager = new MainLayerManager();
     170
     171    /**
    167172     * The commands undo/redo handler.
    168173     * @since 12641 (as a replacement to {@code Main.main.undoRedo})
    169174     */
    170     public static final UndoRedoHandler undoRedo = new UndoRedoHandler();
    171 
    172     /**
    173      * Provides access to the layers displayed in the main view.
    174      */
    175     private static final MainLayerManager layerManager = new MainLayerManager();
     175    public static final UndoRedoHandler undoRedo = new UndoRedoHandler(); // Must be declared after layerManager
    176176
    177177    /**
     
    271271
    272272    @Override
     273    @SuppressWarnings("deprecation")
    273274    protected void initializeMainWindow() {
    274275        if (mainFrame != null) {
    275             panel = mainFrame.getPanel();
     276            mainPanel = mainFrame.getPanel();
     277            panel = mainPanel;
    276278            mainFrame.initialize();
    277279            menu = mainFrame.getMenu();
    278280        } else {
    279281            // required for running some tests.
    280             panel = new MainPanel(layerManager);
     282            mainPanel = new MainPanel(layerManager);
     283            panel = mainPanel;
    281284            menu = new MainMenu();
    282285        }
    283         panel.addMapFrameListener((o, n) -> redoUndoListener.commandChanged(0, 0));
    284         panel.reAddListeners();
     286        mainPanel.addMapFrameListener((o, n) -> redoUndoListener.commandChanged(0, 0));
     287        mainPanel.reAddListeners();
    285288    }
    286289
     
    365368    public static MapFrame getMap() {
    366369        return map;
     370    }
     371
     372    /**
     373     * Returns the main panel.
     374     * @return the main panel
     375     * @since 12642 (as a replacement to {@code Main.main.panel})
     376     */
     377    public static MainPanel getMainPanel() {
     378        return mainPanel;
    367379    }
    368380
Note: See TracChangeset for help on using the changeset viewer.