Changeset 3071 in josm for trunk


Ignore:
Timestamp:
2010-03-03T06:24:53+01:00 (10 years ago)
Author:
mjulius
Message:

fixes #4648 - User panel not showing data when toggled from hidden to shown

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

Legend:

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

    r2987 r3071  
    245245     */
    246246    public boolean hasEditLayer() {
    247         if (map == null) return false;
    248         if (map.mapView == null) return false;
    249         if (map.mapView.getEditLayer() == null) return false;
     247        if (getEditLayer() == null) return false;
    250248        return true;
    251249    }
     
    270268        if (!hasEditLayer()) return null;
    271269        return getEditLayer().data;
     270    }
     271
     272    /**
     273     * Returns the currently active  layer
     274     *
     275     * @return the currently active layer. null, if currently no active layer exists
     276     */
     277    public Layer getActiveLayer() {
     278        if (map == null) return null;
     279        if (map.mapView == null) return null;
     280        return map.mapView.getActiveLayer();
    272281    }
    273282
  • trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

    r2869 r3071  
    145145    }
    146146
     147    @Override
     148    public void showDialog() {
     149        super.showDialog();
     150        Layer layer = Main.main.getActiveLayer();
     151        if (layer instanceof OsmDataLayer) {
     152            refresh(((OsmDataLayer)layer).data.getSelected());
     153        }
     154
     155    }
     156
    147157    class SelectUsersPrimitivesAction extends AbstractAction implements ListSelectionListener{
    148158        public SelectUsersPrimitivesAction() {
Note: See TracChangeset for help on using the changeset viewer.