Changeset 12642 in josm for trunk/src/org/openstreetmap/josm/gui/MainApplication.java
- Timestamp:
- 2017-08-25T03:29:37+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12641 r12642 136 136 137 137 /** 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. 139 139 */ 140 140 static MainPanel mainPanel; … … 165 165 166 166 /** 167 * Provides access to the layers displayed in the main view. 168 */ 169 private static final MainLayerManager layerManager = new MainLayerManager(); 170 171 /** 167 172 * The commands undo/redo handler. 168 173 * @since 12641 (as a replacement to {@code Main.main.undoRedo}) 169 174 */ 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 176 176 177 177 /** … … 271 271 272 272 @Override 273 @SuppressWarnings("deprecation") 273 274 protected void initializeMainWindow() { 274 275 if (mainFrame != null) { 275 panel = mainFrame.getPanel(); 276 mainPanel = mainFrame.getPanel(); 277 panel = mainPanel; 276 278 mainFrame.initialize(); 277 279 menu = mainFrame.getMenu(); 278 280 } else { 279 281 // required for running some tests. 280 panel = new MainPanel(layerManager); 282 mainPanel = new MainPanel(layerManager); 283 panel = mainPanel; 281 284 menu = new MainMenu(); 282 285 } 283 panel.addMapFrameListener((o, n) -> redoUndoListener.commandChanged(0, 0));284 panel.reAddListeners();286 mainPanel.addMapFrameListener((o, n) -> redoUndoListener.commandChanged(0, 0)); 287 mainPanel.reAddListeners(); 285 288 } 286 289 … … 365 368 public static MapFrame getMap() { 366 369 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; 367 379 } 368 380
Note:
See TracChangeset
for help on using the changeset viewer.