private void updateEntityTypeVisibility(NodeCursor parentNodes, boolean hide) {
for (NodeCursor nc = parentNodes; nc.ok(); nc.next()) {
Node parentNode = nc.node();
AbstractFamixEntity entity = fPanel.getGraph().getFamixEntity(parentNode);
if (!hide && fPanel.getViewConfigModel().getEntityTypeVisibility().get(entity.getClass()).booleanValue()) {
NodeRealizer parentRealizer = fPanel.getGraph().getRealizer(parentNode);
parentRealizer.setVisible(true);
updateEntityTypeVisibility(fPanel.getHierarchyManager().getChildren(parentNode), false);
} else {
// hide all descendant nodes and edges
NodeRealizer parentRealizer = fPanel.getGraph().getRealizer(parentNode);
if (parentRealizer.isVisible()) {
parentRealizer.setVisible(false);
updateEntityTypeVisibility(fPanel.getHierarchyManager().getChildren(parentNode), true);
}
}
}
}