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

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

File:
1 edited

Legend:

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

    r12629 r12630  
    106106    private static final List<String> COMMAND_LINE_ARGS = new ArrayList<>();
    107107
     108    /**
     109     * The MapFrame.
     110     */
     111    static MapFrame map;
     112
    108113    private final MainFrame mainFrame;
    109114
     
    225230    public static List<String> getCommandLineArgs() {
    226231        return Collections.unmodifiableList(COMMAND_LINE_ARGS);
     232    }
     233
     234    /**
     235     * Returns the MapFrame.
     236     * <p>
     237     * There should be no need to access this to access any map data. Use {@link #layerManager} instead.
     238     * @return the MapFrame
     239     * @see MainPanel
     240     * @since 12630 (as a replacement to {@code Main.map})
     241     */
     242    public static MapFrame getMap() {
     243        return map;
     244    }
     245
     246    /**
     247     * Replies true if JOSM currently displays a map view. False, if it doesn't, i.e. if
     248     * it only shows the MOTD panel.
     249     * <p>
     250     * You do not need this when accessing the layer manager. The layer manager will be empty if no map view is shown.
     251     *
     252     * @return <code>true</code> if JOSM currently displays a map view
     253     * @since 12630 (as a replacement to {@code Main.isDisplayingMapView()})
     254     */
     255    @SuppressWarnings("deprecation")
     256    public static boolean isDisplayingMapView() {
     257        return map != null && map.mapView != null;
    227258    }
    228259
Note: See TracChangeset for help on using the changeset viewer.