Ticket #15182: validator-standalone.patch

File validator-standalone.patch, 9.7 KB (added by Don-vip, 7 years ago)
  • src/org/openstreetmap/josm/Main.java

     
    2626import java.util.concurrent.Executors;
    2727import java.util.concurrent.Future;
    2828
    29 import javax.swing.Action;
    30 
    31 import org.openstreetmap.josm.actions.JosmAction;
    3229import org.openstreetmap.josm.data.Bounds;
    3330import org.openstreetmap.josm.data.Preferences;
    34 import org.openstreetmap.josm.data.UndoRedoHandler;
    3531import org.openstreetmap.josm.data.cache.JCSCacheManager;
    3632import org.openstreetmap.josm.data.coor.CoordinateFormat;
    3733import org.openstreetmap.josm.data.osm.DataSet;
    3834import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3935import org.openstreetmap.josm.data.projection.Projection;
    4036import org.openstreetmap.josm.data.projection.ProjectionChangeListener;
    41 import org.openstreetmap.josm.gui.MainApplication;
    42 import org.openstreetmap.josm.gui.MainMenu;
    43 import org.openstreetmap.josm.gui.MainPanel;
    44 import org.openstreetmap.josm.gui.MapFrame;
    45 import org.openstreetmap.josm.gui.MapFrameListener;
    46 import org.openstreetmap.josm.gui.layer.MainLayerManager;
    47 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences;
    4837import org.openstreetmap.josm.io.FileWatcher;
    4938import org.openstreetmap.josm.io.OnlineResource;
    5039import org.openstreetmap.josm.io.OsmApi;
     
    5645import org.openstreetmap.josm.tools.PlatformHookOsx;
    5746import org.openstreetmap.josm.tools.PlatformHookUnixoid;
    5847import org.openstreetmap.josm.tools.PlatformHookWindows;
    59 import org.openstreetmap.josm.tools.Shortcut;
    6048import org.openstreetmap.josm.tools.Utils;
    6149import org.openstreetmap.josm.tools.bugreport.BugReport;
    6250
     
    7967    private static final String OSM_WEBSITE = "https://www.openstreetmap.org";
    8068
    8169    /**
    82      * Replies true if JOSM currently displays a map view. False, if it doesn't, i.e. if
    83      * it only shows the MOTD panel.
    84      * <p>
    85      * You do not need this when accessing the layer manager. The layer manager will be empty if no map view is shown.
    86      *
    87      * @return <code>true</code> if JOSM currently displays a map view
    88      * @deprecated use {@link org.openstreetmap.josm.gui.MainApplication#isDisplayingMapView()}
    89      */
    90     @Deprecated
    91     public static boolean isDisplayingMapView() {
    92         return MainApplication.isDisplayingMapView();
    93     }
    94 
    95     /**
    9670     * Global parent component for all dialogs and message boxes
    9771     */
    9872    public static Component parent;
     
    10377    public static volatile Main main;
    10478
    10579    /**
    106      * The worker thread slave. This is for executing all long and intensive
    107      * calculations. The executed runnables are guaranteed to be executed separately and sequential.
    108      * @deprecated use {@link MainApplication#worker} instead
    109      */
    110     @Deprecated
    111     public static ExecutorService worker;
    112 
    113     /**
    11480     * Global application preferences
    11581     */
    11682    public static final Preferences pref = new Preferences();
    11783
    11884    /**
    119      * The MapFrame.
    120      * <p>
    121      * There should be no need to access this to access any map data. Use {@link MainApplication#getLayerManager} instead.
    122      *
    123      * @deprecated Use {@link MainApplication#getMap()} instead
    124      * @see MainPanel
    125      */
    126     @Deprecated
    127     public static MapFrame map;
    128 
    129     /**
    130      * The toolbar preference control to register new actions.
    131      * @deprecated Use {@link MainApplication#getToolbar} instead
    132      */
    133     @Deprecated
    134     public static volatile ToolbarPreferences toolbar;
    135 
    136     /**
    137      * The commands undo/redo handler.
    138      * @deprecated Use {@link MainApplication#undoRedo} instead
    139      */
    140     @Deprecated
    141     public final UndoRedoHandler undoRedo = MainApplication.undoRedo;
    142 
    143     /**
    144      * The main menu bar at top of screen.
    145      * @deprecated Use {@link MainApplication#getMenu} instead
    146      */
    147     @Deprecated
    148     public MainMenu menu;
    149 
    150     /**
    151      * The main panel.
    152      * @deprecated Use {@link MainApplication#getMainPanel} instead
    153      * @since 12125
    154      */
    155     @Deprecated
    156     public MainPanel panel;
    157 
    158     /**
    15985     * The file watcher service.
    16086     */
    16187    public static final FileWatcher fileWatcher = new FileWatcher();
     
    610536    }
    611537
    612538    /**
    613      * Returns the main layer manager that is used by the map view.
    614      * @return The layer manager. The value returned will never change.
    615      * @since 10279
    616      * @deprecated use {@link MainApplication#getLayerManager} instead
    617      */
    618     @Deprecated
    619     public static MainLayerManager getLayerManager() {
    620         return MainApplication.getLayerManager();
    621     }
    622 
    623     /**
    624539     * Replies the current selected primitives, from a end-user point of view.
    625540     * It is not always technically the same collection of primitives than {@link DataSet#getSelected()}.
    626541     * @return The current selected primitives, from a end-user point of view. Can be {@code null}.
     
    630545        return Collections.emptyList();
    631546    }
    632547
    633     /**
    634      * Registers a {@code JosmAction} and its shortcut.
    635      * @param action action defining its own shortcut
    636      * @deprecated use {@link MainApplication#registerActionShortcut(JosmAction)} instead
    637      */
    638     @Deprecated
    639     public static void registerActionShortcut(JosmAction action) {
    640         MainApplication.registerActionShortcut(action);
    641     }
    642 
    643     /**
    644      * Registers an action and its shortcut.
    645      * @param action action to register
    646      * @param shortcut shortcut to associate to {@code action}
    647      * @deprecated use {@link MainApplication#registerActionShortcut(Action, Shortcut)} instead
    648      */
    649     @Deprecated
    650     public static void registerActionShortcut(Action action, Shortcut shortcut) {
    651         MainApplication.registerActionShortcut(action, shortcut);
    652     }
    653 
    654     /**
    655      * Unregisters a shortcut.
    656      * @param shortcut shortcut to unregister
    657      * @deprecated use {@link MainApplication#unregisterShortcut(Shortcut)} instead
    658      */
    659     @Deprecated
    660     public static void unregisterShortcut(Shortcut shortcut) {
    661         MainApplication.unregisterShortcut(shortcut);
    662     }
    663 
    664     /**
    665      * Unregisters a {@code JosmAction} and its shortcut.
    666      * @param action action to unregister
    667      * @deprecated use {@link MainApplication#unregisterActionShortcut(JosmAction)} instead
    668      */
    669     @Deprecated
    670     public static void unregisterActionShortcut(JosmAction action) {
    671         MainApplication.unregisterActionShortcut(action);
    672     }
    673 
    674     /**
    675      * Unregisters an action and its shortcut.
    676      * @param action action to unregister
    677      * @param shortcut shortcut to unregister
    678      * @deprecated use {@link MainApplication#unregisterActionShortcut(Action, Shortcut)} instead
    679      */
    680     @Deprecated
    681     public static void unregisterActionShortcut(Action action, Shortcut shortcut) {
    682         MainApplication.unregisterActionShortcut(action, shortcut);
    683     }
    684 
    685     /**
    686      * Replies the registered action for the given shortcut
    687      * @param shortcut The shortcut to look for
    688      * @return the registered action for the given shortcut
    689      * @deprecated use {@link MainApplication#getRegisteredActionShortcut(Shortcut)} instead
    690      * @since 5696
    691      */
    692     @Deprecated
    693     public static Action getRegisteredActionShortcut(Shortcut shortcut) {
    694         return MainApplication.getRegisteredActionShortcut(shortcut);
    695     }
    696 
    697548    ///////////////////////////////////////////////////////////////////////////
    698549    //  Implementation part
    699550    ///////////////////////////////////////////////////////////////////////////
     
    904755    }
    905756
    906757    /**
    907      * Registers a new {@code MapFrameListener} that will be notified of MapFrame changes.
    908      * <p>
    909      * It will fire an initial mapFrameInitialized event when the MapFrame is present.
    910      * Otherwise will only fire when the MapFrame is created or destroyed.
    911      * @param listener The MapFrameListener
    912      * @return {@code true} if the listeners collection changed as a result of the call
    913      * @see #addMapFrameListener
    914      * @deprecated use {@link MainApplication#addAndFireMapFrameListener} instead
    915      * @since 11904
    916      */
    917     @Deprecated
    918     public static boolean addAndFireMapFrameListener(MapFrameListener listener) {
    919         return MainApplication.addAndFireMapFrameListener(listener);
    920     }
    921 
    922     /**
    923      * Registers a new {@code MapFrameListener} that will be notified of MapFrame changes
    924      * @param listener The MapFrameListener
    925      * @return {@code true} if the listeners collection changed as a result of the call
    926      * @see #addAndFireMapFrameListener
    927      * @deprecated use {@link MainApplication#addMapFrameListener} instead
    928      * @since 5957
    929      */
    930     @Deprecated
    931     public static boolean addMapFrameListener(MapFrameListener listener) {
    932         return MainApplication.addMapFrameListener(listener);
    933     }
    934 
    935     /**
    936      * Unregisters the given {@code MapFrameListener} from MapFrame changes
    937      * @param listener The MapFrameListener
    938      * @return {@code true} if the listeners collection changed as a result of the call
    939      * @deprecated use {@link MainApplication#removeMapFrameListener} instead
    940      * @since 5957
    941      */
    942     @Deprecated
    943     public static boolean removeMapFrameListener(MapFrameListener listener) {
    944         return MainApplication.removeMapFrameListener(listener);
    945     }
    946 
    947     /**
    948758     * Adds a new network error that occur to give a hint about broken Internet connection.
    949759     * Do not use this method for errors known for sure thrown because of a bad proxy configuration.
    950760     *