results.put(colorMap.getLabel(), colorMap);
}
} catch (ValueNotFound e) {
- e.printStackTrace();
+ // ignore
+ LOGGER.debug("Dynamic color maps not found for {}", sclModule, e);
} finally {
SCLContext.getCurrent().put("graph", oldGraph);
}
results.put(sizeMap.getLabel(), sizeMap);
}
} catch (ValueNotFound e) {
- e.printStackTrace();
+ // ignore
+ LOGGER.debug("Dynamic size maps not found for {}", sclModule, e);
} finally {
SCLContext.getCurrent().put("graph", oldGraph);
}
Resource sclModule = Layer0Utils.getPossibleChild(graph, moduleType.getResource(), L0.SCLModule, DYNAMIC_VISUALISATIONS_CONTRIBUTION_MODULE);
if (sclModule != null) {
String moduleURI = graph.getURI(sclModule);
- return new DynamicColoringObject(moduleType, getDynamicColorContributionSupplier(moduleURI, COLOR_CONTRIBUTION));
+ return new DynamicColoringObject(moduleType, getContributionSupplier(moduleURI, COLOR_CONTRIBUTION));
}
return null;
}
-
-// private static DynamicColoringMap dynamicColoringMap(ReadGraph graph, NamedResource moduleType) throws DatabaseException {
-// Layer0 L0 = Layer0.getInstance(graph);
-// Resource sclModule = Layer0Utils.getPossibleChild(graph, moduleType.getResource(), L0.SCLModule, DYNAMIC_VISUALISATIONS_CONTRIBUTION_MODULE);
-// if (sclModule != null) {
-// String moduleURI = graph.getURI(sclModule);
-// return new DynamicColoringMap(moduleType, getDynamicColoringMapSupplier(moduleURI, COLOR_CONTRIBUTION));
-// }
-// return null;
-// }
-
+
private static DynamicSizingObject dynamicSizingObject(ReadGraph graph, NamedResource moduleType) throws DatabaseException {
Layer0 L0 = Layer0.getInstance(graph);
Resource sclModule = Layer0Utils.getPossibleChild(graph, moduleType.getResource(), L0.SCLModule, DYNAMIC_VISUALISATIONS_CONTRIBUTION_MODULE);
if (sclModule != null) {
String moduleURI = graph.getURI(sclModule);
- return new DynamicSizingObject(moduleType, getDynamicSizeContributionSupplier(moduleURI, SIZE_CONTRIBUTION));
+ return new DynamicSizingObject(moduleType, getContributionSupplier(moduleURI, SIZE_CONTRIBUTION));
}
return null;
}
Resource sclModule = Layer0Utils.getPossibleChild(graph, moduleType.getResource(), L0.SCLModule, DYNAMIC_VISUALISATIONS_CONTRIBUTION_MODULE);
if (sclModule != null) {
String moduleURI = graph.getURI(sclModule);
- return new DynamicArrowObject(moduleType, getDynamicEdgeArrowContributionSupplier(moduleURI, ARROW_CONTRIBUTION));
+ return new DynamicArrowObject(moduleType, getContributionSupplier(moduleURI, ARROW_CONTRIBUTION));
}
return null;
}
-
- 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();
- }
- };
- }
-
- private static Supplier<Stream<DynamicColorContribution>> getDynamicColorContributionSupplier(String uri, String expressionText) {
- return () -> {
- try {
- @SuppressWarnings("unchecked")
- List<DynamicColorContribution> result = (List<DynamicColorContribution>) 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();
- }
- };
- }
- private static Supplier<Stream<DynamicArrowContribution>> getDynamicEdgeArrowContributionSupplier(String uri, String expressionText) {
+ private static <T> Supplier<Stream<T>> getContributionSupplier(String uri, String expressionText) {
return () -> {
try {
@SuppressWarnings("unchecked")
- List<DynamicArrowContribution> result = (List<DynamicArrowContribution>) SCLOsgi.MODULE_REPOSITORY.getValue(uri, expressionText);
+ List<T> result = (List<T>) SCLOsgi.MODULE_REPOSITORY.getValue(uri, expressionText);
return result.stream();//result.stream().map(DynamicColorContribution::fromTuple9);
} catch (ValueNotFound e) {
- LOGGER.error("Could not find contributions", e);
+ LOGGER.trace("Could not find contributions for module {} and expression {}", uri, expressionText, e);
//throw new RuntimeException(e);
return Stream.empty();
}
};
}
- private static Supplier<Stream<DynamicSizeContribution>> getDynamicSizeContributionSupplier(String uri, String expressionText) {
- return () -> {
- try {
- @SuppressWarnings("unchecked")
- List<DynamicSizeContribution> result = (List<DynamicSizeContribution>) 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 class DynamicArrowObject {
private final NamedResource arrowObject;