Changeset 12642 in josm for trunk/src/org
- Timestamp:
- 2017-08-25T03:29:37+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r12641 r12642 150 150 /** 151 151 * The main panel. 152 * @deprecated Use {@link MainApplication#getMainPanel} instead 152 153 * @since 12125 153 154 */ 155 @Deprecated 154 156 public MainPanel panel; 155 157 -
trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
r12637 r12642 198 198 JMenu subMenu = Main.main.menu.imagerySubMenu; 199 199 int heightUnrolled = 30*(getItemCount()+subMenu.getItemCount()); 200 if (heightUnrolled < Main .main.panel.getHeight()) {200 if (heightUnrolled < MainApplication.getMainPanel().getHeight()) { 201 201 // add all items of submenu if they will fit on screen 202 202 int n = subMenu.getItemCount(); -
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 -
trunk/src/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandler.java
r12620 r12642 10 10 import java.util.Collections; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.data.coor.EastNorth; 14 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 import org.openstreetmap.josm.gui.MainApplication; 15 15 import org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster; 16 16 import org.openstreetmap.josm.gui.datatransfer.importers.FilePaster; … … 72 72 */ 73 73 public void pasteOn(OsmDataLayer editLayer, EastNorth mPosition, Transferable transferable) { 74 importData(new TransferSupport(Main .main.panel, transferable), editLayer, mPosition);74 importData(new TransferSupport(MainApplication.getMainPanel(), transferable), editLayer, mPosition); 75 75 } 76 76 … … 81 81 public void pasteTags(Collection<? extends OsmPrimitive> primitives) { 82 82 Transferable transferable = ClipboardUtils.getClipboardContent(); 83 importTags(new TransferSupport(Main .main.panel, transferable), primitives);83 importTags(new TransferSupport(MainApplication.getMainPanel(), transferable), primitives); 84 84 } 85 85
Note:
See TracChangeset
for help on using the changeset viewer.