- private static Supplier<Stream<DynamicColorMap>> getDynamicColorMapSupplier(String uri, String expressionText) {
- return () -> {
- try {
- @SuppressWarnings("unchecked")
- List<DynamicColorMap> result = (List<DynamicColorMap>) SCLOsgi.MODULE_REPOSITORY.getValue(uri, expressionText);
- return result.stream();//result.stream().map(DynamicColorContribution::fromTuple9);
- } catch (ValueNotFound e) {
- LOGGER.error("Could not find contributions", e);
- //throw new RuntimeException(e);
- return Stream.empty();
+ public static Collection<DynamicArrowObject> dynamicEdgeArrowObjects(ReadGraph graph) throws DatabaseException {
+
+ List<Resource> sharedOntologies = Simantics.applySCL("Simantics/SharedOntologies", "getSharedOntologies", graph, Tuple0.INSTANCE);
+
+ List<DynamicArrowObject> results = new ArrayList<>();
+
+ for (Resource sharedOntology : sharedOntologies) {
+ Collection<Resource> findByType = graph.syncRequest(new ObjectsWithSupertype(sharedOntology, Layer0.getInstance(graph).ConsistsOf, StructuralResource2.getInstance(graph).Component));
+ //Collection<Resource> findByType = QueryIndexUtils.searchByType(graph, sharedOntology, );
+ for (Resource find : findByType) {
+ NamedResource moduleType = new NamedResource(NameLabelUtil.modalName(graph, find), find);
+ DynamicArrowObject dynamicarrowObject = dynamicEdgeArrowObject(graph, moduleType);
+ if (dynamicarrowObject != null)
+ results.add(dynamicarrowObject);