Index: trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 3299)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 3300)
@@ -36,4 +36,5 @@
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Property;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -104,9 +105,4 @@
         return ret;
     }
-
-
-
-
-
 
     private static SearchSetting lastSearch = null;
@@ -274,9 +270,4 @@
         try {
             String searchText = s.text;
-            if(s instanceof Filter){
-                searchText = "(" + s.text + ")" + (((Filter)s).applyForChildren ? ("| child (" + s.text + ")"): "");
-                searchText = (((Filter)s).inverted ? "-" : "") + "(" +  searchText + ")";
-            }
-            /*System.out.println(searchText);*/
             SearchCompiler.Match matcher = SearchCompiler.compile(searchText, s.caseSensitive, s.regexSearch);
 
@@ -314,4 +305,46 @@
     }
 
+    /**
+     * Version of getSelection that is customized for filter, but should
+     * also work in other context.
+     *
+     * @param s the search settings
+     * @param all the collection of all the primitives that should be considered
+     * @param p the property that should be set/unset if something is found
+     */
+    public static void getSelection(SearchSetting s, Collection<OsmPrimitive> all, Property<OsmPrimitive, Boolean> p) {
+        try {
+            String searchText = s.text;
+            if (s instanceof Filter && ((Filter)s).inverted) {
+                searchText = String.format("-(%s)", searchText);
+            }
+            SearchCompiler.Match matcher = SearchCompiler.compile(searchText, s.caseSensitive, s.regexSearch);
+
+            for (OsmPrimitive osm : all) {
+                if (s.mode == SearchMode.replace) {
+                    if (matcher.match(osm)) {
+                        p.set(osm, true);
+                    } else {
+                        p.set(osm, false);
+                    }
+                } else if (s.mode == SearchMode.add && !p.get(osm) && matcher.match(osm)) {
+                    p.set(osm, true);
+                } else if (s.mode == SearchMode.remove && p.get(osm) && matcher.match(osm)) {
+                    p.set(osm, false);
+                } else if (s.mode == SearchMode.in_selection && p.get(osm) && !matcher.match(osm)) {
+                    p.set(osm, false);
+                }
+            }
+        } catch (SearchCompiler.ParseError e) {
+            JOptionPane.showMessageDialog(
+                    Main.parent,
+                    e.getMessage(),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE
+
+            );
+        }
+    }
+
     public static void search(String search, SearchMode mode, boolean caseSensitive, boolean regexSearch) {
         search(new SearchSetting(search, mode, caseSensitive, regexSearch));
Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 3299)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 3300)
@@ -485,70 +485,78 @@
      *-----------------------------------------------------*/
 
-    public void setDisabled(OsmPrimitive... osm) {
-        if (osm.length == 1 && osm[0] == null) {
-            setDisabled();
-            return;
-        }
-        clearDisabled(allPrimitives());
-        for (OsmPrimitive o : osm)
-            if (o != null) {
-                o.setDisabled(true);
-            }
-    }
-
-    public void setDisabled(Collection<? extends OsmPrimitive> selection) {
-        clearDisabled(nodes);
-        clearDisabled(ways);
-        clearDisabled(relations);
-        for (OsmPrimitive osm : selection) {
-            osm.setDisabled(true);
-        }
-    }
-
-    /**
-     * Remove the disabled parameter from every value in the collection.
-     * @param list The collection to remove the disabled parameter from.
-     */
-    private void clearDisabled(Collection<? extends OsmPrimitive> list) {
-        for (OsmPrimitive osm : list) {
-            osm.setDisabled(false);
-        }
-    }
-
-
-    public void setFiltered(Collection<? extends OsmPrimitive> selection) {
-        clearFiltered(nodes);
-        clearFiltered(ways);
-        clearFiltered(relations);
-        for (OsmPrimitive osm : selection) {
-            osm.setFiltered(true);
-        }
-    }
-
-    public void setFiltered(OsmPrimitive... osm) {
-        if (osm.length == 1 && osm[0] == null) {
-            setFiltered();
-            return;
-        }
-        clearFiltered(nodes);
-        clearFiltered(ways);
-        clearFiltered(relations);
-        for (OsmPrimitive o : osm)
-            if (o != null) {
-                o.setFiltered(true);
-            }
-    }
-
-    /**
-     * Remove the filtered parameter from every value in the collection.
-     * @param list The collection to remove the filtered parameter from.
-     */
-    private void clearFiltered(Collection<? extends OsmPrimitive> list) {
-        if (list == null)
-            return;
-        for (OsmPrimitive osm : list) {
-            osm.setFiltered(false);
-        }
-    }
+    /**
+     * TODO: can be removed if no longer needed
+     *
+     * Currently, the filter flags are updated directly for the primitives.
+     * On the long run there might be listeners for filter changes,
+     * so the control needs to be moved to this place again.
+     */
+
+//    public void setDisabled(OsmPrimitive... osm) {
+//        if (osm.length == 1 && osm[0] == null) {
+//            setDisabled();
+//            return;
+//        }
+//        clearDisabled(allPrimitives());
+//        for (OsmPrimitive o : osm)
+//            if (o != null) {
+//                o.setDisabled(true);
+//            }
+//    }
+//
+//    public void setDisabled(Collection<? extends OsmPrimitive> selection) {
+//        clearDisabled(nodes);
+//        clearDisabled(ways);
+//        clearDisabled(relations);
+//        for (OsmPrimitive osm : selection) {
+//            osm.setDisabled(true);
+//        }
+//    }
+//
+//    /**
+//     * Remove the disabled parameter from every value in the collection.
+//     * @param list The collection to remove the disabled parameter from.
+//     */
+//    private void clearDisabled(Collection<? extends OsmPrimitive> list) {
+//        for (OsmPrimitive osm : list) {
+//            osm.setDisabled(false);
+//        }
+//    }
+//
+//
+//    public void setFiltered(Collection<? extends OsmPrimitive> selection) {
+//        clearFiltered(nodes);
+//        clearFiltered(ways);
+//        clearFiltered(relations);
+//        for (OsmPrimitive osm : selection) {
+//            osm.setFiltered(true);
+//        }
+//    }
+//
+//    public void setFiltered(OsmPrimitive... osm) {
+//        if (osm.length == 1 && osm[0] == null) {
+//            setFiltered();
+//            return;
+//        }
+//        clearFiltered(nodes);
+//        clearFiltered(ways);
+//        clearFiltered(relations);
+//        for (OsmPrimitive o : osm)
+//            if (o != null) {
+//                o.setFiltered(true);
+//            }
+//    }
+//
+//    /**
+//     * Remove the filtered parameter from every value in the collection.
+//     * @param list The collection to remove the filtered parameter from.
+//     */
+//    private void clearFiltered(Collection<? extends OsmPrimitive> list) {
+//        if (list == null)
+//            return;
+//        for (OsmPrimitive osm : list) {
+//            osm.setFiltered(false);
+//        }
+//    }
 
     @Override public DataSet clone() {
Index: trunk/src/org/openstreetmap/josm/data/osm/Filter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Filter.java	(revision 3299)
+++ trunk/src/org/openstreetmap/josm/data/osm/Filter.java	(revision 3300)
@@ -12,7 +12,6 @@
 
     public Boolean enable = true;
-    public Boolean hide = false;
+    public Boolean hiding = false;
     public Boolean inverted = false;
-    public Boolean applyForChildren = true;
     public Filter() {
         super("", SearchMode.add, false, false);
@@ -43,15 +42,14 @@
         regexSearch = Boolean.parseBoolean(prfs[4]);
         enable = Boolean.parseBoolean(prfs[6]);
-        hide = Boolean.parseBoolean(prfs[7]);
+        hiding = Boolean.parseBoolean(prfs[7]);
         inverted = Boolean.parseBoolean(prfs[8]);
-        applyForChildren = Boolean.parseBoolean(prfs[9]);
-
     }
 
     public String getPrefString(){
         return version + ";" +
-        text + ";" + mode + ";" + caseSensitive + ";" + regexSearch + ";" +
-        "legacy" + ";" + enable + ";" + hide + ";" +
-        inverted + ";" + applyForChildren;
+            text + ";" + mode + ";" + caseSensitive + ";" + regexSearch + ";" +
+            "legacy" + ";" + enable + ";" + hiding + ";" +
+            inverted + ";" +
+            "false"; // last parameter is not used any more (was: applyForChildren)
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/Filters.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Filters.java	(revision 3299)
+++ trunk/src/org/openstreetmap/josm/data/osm/Filters.java	(revision 3300)
@@ -10,4 +10,5 @@
 
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
@@ -20,5 +21,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.search.SearchAction;
-import org.openstreetmap.josm.actions.search.SearchAction.Function;
+import org.openstreetmap.josm.tools.Property;
 
 /**
@@ -26,9 +27,12 @@
  * @author Petr_Dlouhý
  */
-public class Filters extends AbstractTableModel{
-
-    public int disabledCount, hiddenCount;
-
-    public Filters(){
+public class Filters extends AbstractTableModel {
+
+    // number of primitives that are disabled but not hidden
+    public int disabledCount;
+    // number of primitives that are disabled and hidden
+    public int disabledAndHiddenCount;
+
+    public Filters() {
         loadPrefs();
     }
@@ -36,33 +40,210 @@
     private List<Filter> filters = new LinkedList<Filter>();
 
+    /**
+     * Apply the filters to the primitives of the data set.
+     *
+     * There are certain rules to ensure that a way is not displayed "naked"
+     * without its nodes (1) and on the other hand to avoid hiding a way but
+     * leaving its nodes visible as a cloud of points (2).
+     *
+     * In normal (non-inverted) mode only problem (2) is relevant.
+     * Untagged child nodes of filtered ways that are not used by other
+     * unfiltered ways are filtered as well.
+     *
+     * If a filter applies explicitly to a node, (2) is ignored and it
+     * is filtered in any case.
+     *
+     * In inverted mode usually only problem (1) is relevant.
+     * If the inverted filter applies explicitly to a node, this no longer
+     * means it is filtered in any case:
+     * E.g. the filter [searchtext="highway=footway", inverted=true] displays
+     * the footways only. But that does not mean, the nodes of the footway
+     * (which do not have the highway tag) should be filtered as well.
+     *
+     * So first the Filter is applied for ways and relations. Then to nodes
+     * (but hides them only if they are not used by any unfiltered way).
+     */
     public void executeFilters(){
-        Collection<OsmPrimitive> seld = new LinkedList<OsmPrimitive> ();
-        Collection<OsmPrimitive> self = new LinkedList<OsmPrimitive> ();
         DataSet ds = Main.main.getCurrentDataSet();
-        if(ds == null)return;
-        ds.setFiltered();
-        ds.setDisabled();
+        if (ds == null)
+            return;
+
+        final Collection<OsmPrimitive> all = ds.allNonDeletedCompletePrimitives();
+        // temporary set to collect the primitives returned by the search engine
+        final Collection<OsmPrimitive> collect = new HashSet<OsmPrimitive>();
+
+        // an auxiliary property to collect the results of the search engine
+        class CollectProperty implements Property<OsmPrimitive,Boolean> {
+            boolean collectValue;
+            boolean hidden;
+
+            /**
+             * Depending on the parameters, there are 4 different instances
+             * of this class.
+             *
+             * @param collectValue
+             *          If true: collect only those primitives that are added
+             *              by the search engine.
+             *          If false: Collect only those primitives that are removed
+             *              by the search engine.
+             * @param hidden Whether the property refers to primitives that
+             *          are disabled and hidden or to primitives
+             *          that are disabled only.
+             */
+            public CollectProperty(boolean collectValue, boolean hidden) {
+                this.collectValue = collectValue;
+                this.hidden = hidden;
+            }
+
+            public Boolean get(OsmPrimitive osm) {
+                if (hidden)
+                    return osm.isDisabledAndHidden();
+                else
+                    return osm.isDisabled();
+            }
+
+            public void set(OsmPrimitive osm, Boolean value) {
+                if (collectValue == value.booleanValue()) {
+                    collect.add(osm);
+                }
+            }
+        }
+
+        clearFilterFlags();
+
         for (Filter flt : filters){
-            if(flt.enable){
-                SearchAction.getSelection(flt, seld, new Function(){
-                    public Boolean isSomething(OsmPrimitive o){
-                        return o.isDisabled();
-                    }
-                });
-                if(flt.hide) {
-                    SearchAction.getSelection(flt, self, new Function(){
-                        public Boolean isSomething(OsmPrimitive o){
-                            return o.isFiltered();
+            if (flt.enable) {
+                collect.clear();
+                // Decide, whether primitives are collected that are added to the current
+                // selection or those that are removed from the current selection
+                boolean collectValue = flt.mode == SearchAction.SearchMode.replace || flt.mode == SearchAction.SearchMode.add;
+                Property<OsmPrimitive,Boolean> collectProp = new CollectProperty(collectValue, flt.hiding);
+
+                SearchAction.getSelection(flt, all, collectProp);
+
+                switch (flt.mode) {
+                    case replace:
+                        for (OsmPrimitive osm : all) {
+                            osm.unsetDisabledState();
                         }
-                    });
+                    case add:
+                        if (!flt.inverted) {
+                            for (OsmPrimitive osm : collect) {
+                                osm.setDisabledState(flt.hiding);
+                            }
+
+                            // Find child nodes of hidden ways and add them to the hidden nodes
+                            for (OsmPrimitive osm : collect) {
+                                if (osm instanceof Way) {
+                                    nodes:
+                                    for (Node n : ((Way)osm).getNodes()) {
+                                        // if node is already disabled, there is nothing to do
+                                        if (n.isDisabledAndHidden() || (!flt.hiding && n.isDisabled()))
+                                            continue;
+
+                                        // if the node is tagged, don't disable it
+                                        if (n.isTagged())
+                                            continue;
+
+                                        // if the node has undisabled parent ways, don't disable it
+                                        for (OsmPrimitive ref : n.getReferrers()) {
+                                            if (ref instanceof Way) {
+                                                if (!ref.isDisabled())
+                                                    continue nodes;
+                                                if (flt.hiding && !ref.isDisabledAndHidden())
+                                                    continue nodes;
+                                            }
+                                        }
+                                        n.setDisabledState(flt.hiding);
+                                    }
+                                }
+                            }
+                        } else { // inverted filter in add mode
+                            // update flags, except for nodes
+                            for (OsmPrimitive osm : collect) {
+                                if (!(osm instanceof Node)) {
+                                    osm.setDisabledState(flt.hiding);
+                                }
+                            }
+
+                            // update flags for nodes
+                            nodes:
+                            for (OsmPrimitive osm : collect) {
+                                if (osm instanceof Node) {
+                                    // if node is already disabled, there is nothing to do
+                                    if (osm.isDisabledAndHidden() || (!flt.hiding && osm.isDisabled()))
+                                        continue;
+
+                                    // if the node has undisabled parent ways, don't disable it
+                                    for (OsmPrimitive ref : osm.getReferrers()) {
+                                        if (ref instanceof Way) {
+                                            if (!ref.isDisabled())
+                                                continue nodes;
+                                            if (flt.hiding && !ref.isDisabledAndHidden())
+                                                continue nodes;
+                                        }
+                                    }
+                                    osm.setDisabledState(flt.hiding);
+                                }
+                            }
+                        }
+                        break;
+                    case remove:
+                    case in_selection:
+                        if (!flt.inverted) {
+                            // make the described primitive undisabled again
+                            for (OsmPrimitive osm : collect) {
+                                osm.unsetDisabledState();
+                            }
+
+                            // Undisable the child nodes of undisabled ways
+                            for (OsmPrimitive osm : collect) {
+                                if (osm instanceof Way) {
+                                    for (Node n : ((Way) osm).getNodes()) {
+                                        n.unsetDisabledState();
+                                    }
+                                }
+                            }
+                        } else { // inverted filter in remove mode
+                            // make the described primitive undisabled again
+                            for (OsmPrimitive osm : collect) {
+                                osm.unsetDisabledState();
+                            }
+
+                            // Undisable the child nodes of undisabled ways
+                            for (OsmPrimitive osm : collect) {
+                                if (osm instanceof Way) {
+                                    for (Node n : ((Way) osm).getNodes()) {
+                                        n.unsetDisabledState();
+                                    }
+                                }
+                            }
+                        }
+                        break;
+                    default:
+                        throw new IllegalStateException();
                 }
             }
         }
-        disabledCount = seld.size() - self.size();
-        hiddenCount = self.size();
-        ds.setFiltered(self);
-        ds.setDisabled(seld);
-
-        ds.clearSelection(seld);
+
+        disabledCount = 0;
+        disabledAndHiddenCount = 0;
+        // collect disabled and selected the primitives
+        final Collection<OsmPrimitive> deselect = new HashSet<OsmPrimitive>();
+        for (OsmPrimitive osm : all) {
+            if (osm.isDisabled()) {
+                disabledCount++;
+                if (osm.isSelected()) {
+                    deselect.add(osm);
+                }
+                if (osm.isDisabledAndHidden()) {
+                    disabledAndHiddenCount++;
+                }
+            }
+        }
+        disabledCount -= disabledAndHiddenCount;
+        if (!deselect.isEmpty()) {
+            ds.clearSelection(deselect);
+        }
 
         Main.map.mapView.repaint();
@@ -72,12 +253,11 @@
         DataSet ds = Main.main.getCurrentDataSet();
         if (ds != null) {
-            ds.setFiltered();
-            ds.setDisabled();
+            for (OsmPrimitive osm : ds.allPrimitives()) {
+                osm.unsetDisabledState();
+            }
         }
         disabledCount = 0;
-        hiddenCount = 0;
-        Main.map.mapView.repaint();
-    }
-
+        disabledAndHiddenCount = 0;
+    }
 
     private void loadPrefs() {
@@ -158,5 +338,5 @@
 
     public int getColumnCount(){
-        return 6;
+        return 5;
     }
 
@@ -167,5 +347,4 @@
                 /* column header: hide filter */               trc("filter", "H"),
                 /* column header: filter text */               trc("filter", "Text"),
-                /* column header: apply filter for children */ trc("filter", "C"),
                 /* column header: inverted filter */           trc("filter", "I"),
                 /* column header: filter mode */               trc("filter", "M")
@@ -176,5 +355,5 @@
     @Override
     public Class<?> getColumnClass(int column){
-        Class<?>[] classes = { Boolean.class, Boolean.class, String.class, Boolean.class, Boolean.class, String.class };
+        Class<?>[] classes = { Boolean.class, Boolean.class, String.class, Boolean.class, String.class };
         return classes[column];
     }
@@ -188,5 +367,5 @@
     public boolean isCellEditable(int row, int column){
         if(!filters.get(row).enable && column!=0) return false;
-        if(column < 5)return true;
+        if(column < 4)return true;
         return false;
     }
@@ -203,5 +382,5 @@
             break;
         case 1:
-            f.hide = (Boolean)aValue;
+            f.hiding = (Boolean)aValue;
             savePref(row);
             executeFilters();
@@ -212,9 +391,4 @@
             break;
         case 3:
-            f.applyForChildren = (Boolean)aValue;
-            savePref(row);
-            executeFilters();
-            break;
-        case 4:
             f.inverted = (Boolean)aValue;
             savePref(row);
@@ -231,9 +405,8 @@
         switch(column){
         case 0: return f.enable;
-        case 1: return f.hide;
+        case 1: return f.hiding;
         case 2: return f.text;
-        case 3: return f.applyForChildren;
-        case 4: return f.inverted;
-        case 5:
+        case 3: return f.inverted;
+        case 4:
             switch(f.mode){ /* translators notes must be in front */
             case replace:      /* filter mode: replace */      return trc("filter", "R");
@@ -246,4 +419,7 @@
     }
 
+    /**
+     * On screen display label
+     */
     private static class OSDLabel extends JLabel {
         public OSDLabel(String text) {
@@ -269,12 +445,12 @@
         String message = "<html>"+tr("<h2>Filter active</h2>");
 
-        if (disabledCount == 0 && hiddenCount == 0)
+        if (disabledCount == 0 && disabledAndHiddenCount == 0)
             return;
 
-        if (hiddenCount != 0) {
-            message += tr("<p><b>{0}</b> objects hidden", hiddenCount);
-        }
-
-        if (hiddenCount != 0 && disabledCount != 0) {
+        if (disabledAndHiddenCount != 0) {
+            message += tr("<p><b>{0}</b> objects hidden", disabledAndHiddenCount);
+        }
+
+        if (disabledAndHiddenCount != 0 && disabledCount != 0) {
             message += "<br>";
         }
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 3299)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 3300)
@@ -62,5 +62,6 @@
     /**
      * An object can be disabled by the filter mechanism.
-     * Then it will show in a shade of grey on the map.
+     * Then it will show in a shade of gray on the map or it is completely
+     * hidden from the view.
      * Disabled objects usually cannot be selected or modified
      * while the filter is active.
@@ -78,9 +79,13 @@
 
     /**
-     * An object can be filtered by the filter mechanism.
-     * Then it will be hidden on the map and usually
-     * cannot be selected or modified while the filter is active.
-     */
-    private static final int FLAG_FILTERED = 1 << 4;
+     * This flag is only relevant if an object is disabled by the
+     * filter mechanism (i.e. FLAG_DISABLED is set).
+     * Then it indicates, whether it is completely hidden or
+     * just shown in gray color.
+     *
+     * When the primitive is not disabled, this flag should be
+     * unset as well (for efficient access).
+     */
+    private static final int FLAG_HIDE_IF_DISABLED = 1 << 4;
 
     /**
@@ -302,45 +307,49 @@
     /* accessors                                                                            */
     /* ------------------------------------------------------------------------------------ */
-    /**
-     * Sets whether this primitive is disabled or not.
-     *
-     * @param disabled true, if this primitive is disabled; false, otherwise
-     */
-    public void setDisabled(boolean disabled) {
-        if (disabled) {
-            flags |= FLAG_DISABLED;
+
+    /**
+     * Make the primitive disabled (e.g. if a filter applies).
+     * To enable the primitive again, use unsetDisabledState.
+     * @param hide if the primitive should be completely hidden from view or
+     *             just shown in gray color.
+     */
+    public void setDisabledState(boolean hide) {
+        flags |= FLAG_DISABLED;
+        if (hide) {
+            flags |= FLAG_HIDE_IF_DISABLED;
         } else {
-            flags &= ~FLAG_DISABLED;
-        }
-
-    }
-
-    /**
-     * Replies true, if this primitive is disabled.
-     *
-     * @return true, if this primitive is disabled
+            flags &= ~FLAG_HIDE_IF_DISABLED;
+        }
+    }
+
+    /**
+     * Remove the disabled flag from the primitive.
+     * Afterwards, the primitive is displayed normally and can be selected
+     * again.
+     */
+    public void unsetDisabledState() {
+        flags &= ~FLAG_DISABLED;
+        flags &= ~FLAG_HIDE_IF_DISABLED;
+    }
+
+    /**
+     * Replies true, if this primitive is disabled. (E.g. a filter
+     * applies)
      */
     public boolean isDisabled() {
         return (flags & FLAG_DISABLED) != 0;
     }
-    /**
-     * Sets whether this primitive is filtered out or not.
-     *
-     * @param filtered true, if this primitive is filtered out; false, otherwise
-     */
-    public void setFiltered(boolean filtered) {
-        if (filtered) {
-            flags |= FLAG_FILTERED;
-        } else {
-            flags &= ~FLAG_FILTERED;
-        }
-    }
-    /**
-     * Replies true, if this primitive is filtered out.
-     *
-     * @return true, if this primitive is filtered out
-     */
+
+    /**
+     * Replies true, if this primitive is disabled and marked as
+     * completely hidden on the map.
+     */
+    public boolean isDisabledAndHidden() {
+        return (((flags & FLAG_DISABLED) != 0) && ((flags & FLAG_HIDE_IF_DISABLED) != 0));
+    }
+
+    @Deprecated
     public boolean isFiltered() {
-        return (flags & FLAG_FILTERED) != 0;
+        return isDisabledAndHidden();
     }
 
@@ -394,9 +403,9 @@
 
     public boolean isSelectable() {
-        return (flags & (FLAG_DELETED + FLAG_INCOMPLETE + FLAG_DISABLED + FLAG_FILTERED)) == 0;
+        return (flags & (FLAG_DELETED + FLAG_INCOMPLETE + FLAG_DISABLED + FLAG_HIDE_IF_DISABLED)) == 0;
     }
 
     public boolean isDrawable() {
-        return (flags & (FLAG_DELETED + FLAG_INCOMPLETE + FLAG_FILTERED)) == 0;
+        return (flags & (FLAG_DELETED + FLAG_INCOMPLETE + FLAG_HIDE_IF_DISABLED)) == 0;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java	(revision 3299)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java	(revision 3300)
@@ -24,4 +24,5 @@
 import javax.swing.table.TableCellRenderer;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.search.SearchAction;
 import org.openstreetmap.josm.data.osm.Filter;
@@ -40,5 +41,5 @@
  * @author Petr_Dlouhý
  */
-public class FilterDialog extends ToggleDialog implements Listener , TableModelListener {
+public class FilterDialog extends ToggleDialog implements Listener, TableModelListener {
 
     private JTable userTable;
@@ -68,4 +69,5 @@
         DatasetEventManager.getInstance().removeDatasetListener(listenerAdapter);
         filters.clearFilterFlags();
+        Main.map.mapView.repaint();
     }
 
@@ -138,5 +140,4 @@
             tr("Hide elements"),
             null,
-            tr("Apply also for children"),
             tr("Inverse filter"),
             tr("Filter mode")
@@ -169,5 +170,4 @@
         userTable.getColumnModel().getColumn(3).setMaxWidth(1);
         userTable.getColumnModel().getColumn(4).setMaxWidth(1);
-        userTable.getColumnModel().getColumn(5).setMaxWidth(1);
 
         userTable.getColumnModel().getColumn(0).setResizable(false);
@@ -175,5 +175,4 @@
         userTable.getColumnModel().getColumn(3).setResizable(false);
         userTable.getColumnModel().getColumn(4).setResizable(false);
-        userTable.getColumnModel().getColumn(5).setResizable(false);
 
         userTable.setDefaultRenderer(Boolean.class, new BooleanRenderer());
@@ -215,5 +214,5 @@
 
     public void tableChanged(TableModelEvent e){
-        setTitle(tr("Filter Hidden:{0} Disabled:{1}", filters.hiddenCount, filters.disabledCount));
+        setTitle(tr("Filter Hidden:{0} Disabled:{1}", filters.disabledAndHiddenCount, filters.disabledCount));
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/Property.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Property.java	(revision 3300)
+++ trunk/src/org/openstreetmap/josm/tools/Property.java	(revision 3300)
@@ -0,0 +1,20 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools;
+
+/**
+ * Small interface to define a property with both read and write access.
+ */
+public interface Property<ObjectType, PropertyType> {
+    /**
+     * Get the value of the property.
+     * @param obj the object, from that the property is derived
+     * @return the value of the property for the object obj
+     */
+    public PropertyType get(ObjectType obj);
+    /**
+     * Set the value of the property for the object.
+     * @param obj the object for that the property should be set
+     * @param value the value the property is set to
+     */
+    public void set(ObjectType obj, PropertyType value);
+}
