Changeset 10395 in josm


Ignore:
Timestamp:
2016-06-16T12:37:18+02:00 (5 years ago)
Author:
Don-vip
Message:

gsoc-core - remove more deprecation warnings

Location:
trunk/src/org/openstreetmap/josm
Files:
7 edited

Legend:

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

    r10394 r10395  
    819819     *
    820820     * @param layer the layer
    821      * @param viewport the viewport to zoom to; can be null, then the viewport
    822      * isn't changed
     821     * @param viewport the viewport to zoom to; can be null, then the viewport isn't changed
    823822     */
    824823    public final synchronized void addLayer(final Layer layer, ViewportData viewport) {
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r10378 r10395  
    423423     */
    424424    public boolean selectMapMode(MapMode newMapMode) {
    425         return selectMapMode(newMapMode, mapView.getActiveLayer());
     425        return selectMapMode(newMapMode, mapView.getLayerManager().getActiveLayer());
    426426    }
    427427
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r10394 r10395  
    596596    /**
    597597     * Returns current data set. To be removed: end of 2016.
    598      * @deprecated Use {@link Main#getLayerManager()} instead.
     598     * @deprecated Use {@link #getLayerManager()}.getEditDataSet() instead.
    599599     */
    600600    @Override
     
    12951295     * Schedule a zoom to the given position on the next redraw.
    12961296     * Temporary, may be removed without warning.
    1297      * @param viewportData
    1298      * @since xxx
     1297     * @param viewportData the viewport to zoom to
     1298     * @since 10394
    12991299     */
    13001300    public void scheduleZoomTo(ViewportData viewportData) {
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r10378 r10395  
    304304    }
    305305
     306    /**
     307     * Returns current data set. To be removed: end of 2016.
     308     * @return current data set
     309     * @deprecated Use {@link Main#getLayerManager()}.getEditDataSet() instead.
     310     */
     311    @Deprecated
    306312    protected DataSet getCurrentDataSet() {
    307313        return Main.main.getCurrentDataSet();
     
    794800    private Map<Double, List<Node>> getNearestNodesImpl(Point p, Predicate<OsmPrimitive> predicate) {
    795801        Map<Double, List<Node>> nearestMap = new TreeMap<>();
    796         DataSet ds = getCurrentDataSet();
     802        DataSet ds = Main.getLayerManager().getEditDataSet();
    797803
    798804        if (ds != null) {
     
    10031009    private Map<Double, List<WaySegment>> getNearestWaySegmentsImpl(Point p, Predicate<OsmPrimitive> predicate) {
    10041010        Map<Double, List<WaySegment>> nearestMap = new TreeMap<>();
    1005         DataSet ds = getCurrentDataSet();
     1011        DataSet ds = Main.getLayerManager().getEditDataSet();
    10061012
    10071013        if (ds != null) {
     
    13641370    public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean useSelected) {
    13651371        Collection<OsmPrimitive> sel;
    1366         DataSet ds = getCurrentDataSet();
     1372        DataSet ds = Main.getLayerManager().getEditDataSet();
    13671373        if (useSelected && ds != null) {
    13681374            sel = ds.getSelected();
  • trunk/src/org/openstreetmap/josm/gui/SelectionManager.java

    r10244 r10395  
    398398        } else {
    399399            // nodes
    400             for (Node n : nc.getCurrentDataSet().getNodes()) {
     400            for (Node n : Main.getLayerManager().getEditDataSet().getNodes()) {
    401401                if (n.isSelectable() && selectionResult.contains(nc.getPoint2D(n))) {
    402402                    selection.add(n);
     
    405405
    406406            // ways
    407             for (Way w : nc.getCurrentDataSet().getWays()) {
     407            for (Way w : Main.getLayerManager().getEditDataSet().getWays()) {
    408408                if (!w.isSelectable() || w.getNodesCount() == 0) {
    409409                    continue;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r10345 r10395  
    376376        public void actionPerformed(ActionEvent e) {
    377377            if (noteData == null) { //there is no notes layer. Create one first
    378                 Main.map.mapView.addLayer(new NoteLayer());
     378                Main.getLayerManager().addLayer(new NoteLayer());
    379379            }
    380380            Main.map.selectMapMode(new AddNoteAction(Main.map, noteData));
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r10371 r10395  
    387387        highlightUpdateCount = data.getHighlightUpdateCount();
    388388
    389         boolean active = mv.getActiveLayer() == this;
     389        boolean active = mv.getLayerManager().getActiveLayer() == this;
    390390        boolean inactive = !active && Main.pref.getBoolean("draw.data.inactive_color", true);
    391391        boolean virtual = !inactive && mv.isVirtualNodesEnabled();
Note: See TracChangeset for help on using the changeset viewer.