use of de.cau.cs.kieler.klighd.krendering.KInvisibility in project lingua-franca by lf-lang.
the class InterfaceDependenciesVisualization method updateInterfaceDependencyVisibility.
/**
* Updates the visibility of interface dependencies edges based on the expansion state.
*/
public static void updateInterfaceDependencyVisibility(KNode node, boolean expanded) {
Iterable<KEdge> edges = IterableExtensions.filter(node.getOutgoingEdges(), it -> {
return it.getProperty(INTERFACE_DEPENDENCY);
});
Iterable<Iterable<KRendering>> renders = IterableExtensions.map(edges, (KEdge it) -> {
return Iterables.<KRendering>filter(it.getData(), KRendering.class);
});
Iterables.concat(renders).forEach(it -> {
KInvisibility inv = IterableExtensions.last(Iterables.filter(it.getStyles(), KInvisibility.class));
if (inv == null) {
inv = KRenderingFactory.eINSTANCE.createKInvisibility();
it.getStyles().add(inv);
}
inv.setInvisible(expanded);
});
}
Aggregations