@Override public void setVisible(boolean visible) { super.setVisible(visible); // hide or show the arcs for this node for (GraphArc arc : arcs) { // this method handles whether or not to show the arc // checks if the src and dest nodes are visible arc.setVisible(visible); } }
private void applyArcFilters(GraphModel model) { Collection<GraphArc> arcs = model.getAllArcs(); for (GraphArc arc : arcs) { boolean oldVisibility = arc.isVisible(); boolean newVisibility = true; // visible by default for (GraphFilter filter : filters) { // only apply this filter if it is an arc filter if (filter.isArcFilter()) { newVisibility = filter.isVisible(arc); // we stop once one filter says this arc should be hidden if (!newVisibility) { break; } } } if (oldVisibility != newVisibility) { arc.setVisible(newVisibility); } } }