Changeset 1825 in josm


Ignore:
Timestamp:
2009-07-24T08:03:25+02:00 (15 years ago)
Author:
Gubaer
Message:

Changed the way we get an "active data layer" and a "current data set". Now, the "active data layer" is the first OsmDataLayer in the list of layers, or null, if there are no OsmDataLayers. The "current data set" is the dataset of the "active data layer", or nul, if there is no "active data layer".

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

Legend:

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

    r1814 r1825  
    220220
    221221    /**
    222      * Replies true if there is an edit layer which is currently
    223      * active
     222     * Replies true if there is an edit layer
    224223     *
    225      * @return true if there is an edit layer which is currently
    226      * active
    227      */
    228     public boolean hasActiveEditLayer() {
     224     * @return true if there is an edit layer
     225     */
     226    public boolean hasEditLayer() {
    229227        if (map == null) return false;
    230228        if (map.mapView == null) return false;
     
    250248     */
    251249    public DataSet getCurrentDataSet() {
    252         if (!hasActiveEditLayer()) return null;
     250        if (!hasEditLayer()) return null;
    253251        return getEditLayer().data;
    254252    }
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r1823 r1825  
    417417        if (activeLayer instanceof OsmDataLayer)
    418418            return (OsmDataLayer)activeLayer;
     419
     420        // the first OsmDataLayer is the edit layer
     421        //
     422        for (Layer layer : layers) {
     423            if (layer instanceof OsmDataLayer)
     424                return (OsmDataLayer)layer;
     425        }
    419426        return null;
    420427    }
Note: See TracChangeset for help on using the changeset viewer.