* target nodes have to be obtained.
*/
private void updateAssociationTypeVisibility() {
for (Edge edge : fPanel.getGraph().getEdgeArray()) {
Class<? extends FamixAssociation> associationType = fPanel.getGraph().getEdgeType(edge);
EdgeRealizer edgeRealizer = fPanel.getGraph().getRealizer(edge);
if (fPanel.getViewConfigModel().getAssociationTypeVisibility().get(associationType).booleanValue()) {
// check whether from and to node are also visible
// if edge is an aggregated edge then check if the source and target node of the first lower level edge are visible
List<Edge> lowLevelEdges = fPanel.getGraph().getLowLevelEdges(edge);
FamixAssociation association;
if (lowLevelEdges != null && lowLevelEdges.size() > 0) {
association = fPanel.getGraph().getAssociation(lowLevelEdges.get(0));
} else {
association = fPanel.getGraph().getAssociation(edge);
}
NodeRealizer fromRealizer = fPanel.getGraph().getRealizer(fPanel.getGraph().getNode(association.getFrom()));
NodeRealizer toRealizer = fPanel.getGraph().getRealizer(fPanel.getGraph().getNode(association.getTo()));
if (fromRealizer != null && toRealizer != null) {
if (fromRealizer.isVisible() && toRealizer.isVisible()) {
edgeRealizer.setVisible(true);
} else {
edgeRealizer.setVisible(false);
}
} else {
fLogger.error("From or to node of edge not in the graph - error in graph structure");
}
} else {
edgeRealizer.setVisible(false);
}
}
}