class MaskEdgeOperator implements Operator {

        private EdgesOptions option = EdgesOptions.ANY;
        private FilterProperty[] filterProperties;

        @Override
        public int getInputCount() {
            return 1;
        }

        @Override
        public String getName() {
            return NbBundle.getMessage(MASKBuilderEdge.class, "MASKBuilderEdge.name");
        }

        @Override
        public FilterProperty[] getProperties() {<FILL_FUNCTION_BODY>}

        @Override
        public Graph filter(Subgraph[] graphs) {
            if (graphs.length > 1) {
                throw new IllegalArgumentException("Filter accepts a single graph in parameter");
            }

            Graph graph = graphs[0];
            Graph mainGraph = graph.getView().getGraphModel().getGraph();

            List<Edge> edgesToKeep = new ArrayList<>();
            for (Edge e : mainGraph.getEdges()) {
                boolean source = graph.contains(e.getSource());
                boolean target = graph.contains(e.getTarget());
                boolean keep = false;
                switch (option) {
                    case SOURCE:
                        keep = source;
                        break;
                    case TARGET:
                        keep = target;
                        break;
                    case BOTH:
                        keep = source && target;
                        break;
                    case ANY:
                        keep = source || target;
                        break;
                }
                if (keep) {
                    edgesToKeep.add(e);
                }
            }

            graph.clearEdges();

            for (Node n : mainGraph.getNodes()) {
                if (!graph.contains(n)) {
                    graph.addNode(n);
                }
            }

            for (Edge e : edgesToKeep) {
                graph.addEdge(e);
            }

            return graph;
        }

        @Override
        public Graph filter(Graph graph, Filter[] filters) {
            if (filters.length > 1) {
                throw new IllegalArgumentException("Filter accepts a single filter in parameter");
            }

            if (filters[0] instanceof NodeFilter && ((NodeFilter) filters[0]).init(graph)) {
                NodeFilter filter = (NodeFilter) filters[0];
                for (Edge e : graph.getEdges()) {
                    Node source = e.getSource();
                    Node target = e.getTarget();
                    boolean remove = false;
                    switch (option) {
                        case SOURCE:
                            remove = !filter.evaluate(graph, source);
                            break;
                        case TARGET:
                            remove = !filter.evaluate(graph, target);
                            break;
                        case BOTH:
                            remove = !filter.evaluate(graph, source) || !filter.evaluate(graph, target);
                            break;
                        case ANY:
                            remove = !filter.evaluate(graph, source) && !filter.evaluate(graph, target);
                            break;
                    }
                    if (remove) {
                        graph.removeEdge(e);
                    }
                }
                filter.finish();
            }
            return graph;
        }

        public String getOption() {
            return option.toString();
        }

        public void setOption(String option) {
            this.option = EdgesOptions.valueOf(option);
        }

        public enum EdgesOptions {

            SOURCE, TARGET, ANY, BOTH
        }
    }

            if (filterProperties == null) {
                filterProperties = new FilterProperty[0];
                try {
                    filterProperties = new FilterProperty[] {
                        FilterProperty.createProperty(this, String.class, "option")
                    };
                } catch (Exception ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
            return filterProperties;
        
<no_super_class>