}
@PropertySetter(value = "eventColor")
- public void setEventColor(Color colorr) {
- this.eventColor = colorr;
- }
-
+ public void setEventColor(Color colorr) {
+ this.eventColor = colorr;
+ }
+
@PropertySetter(value = "hidden")
public void setHidden(Boolean value) {
this.hidden = value;
}
});
broker.subscribe(TOPIC2, event -> {
- Tuple2 data = (Tuple2) event.getProperty(IEventBroker.DATA);
- Resource resource = (Resource) data.c0;
- Color colorr = (Color) data.c1;
+ Tuple2 data = (Tuple2) event.getProperty(IEventBroker.DATA);
+ Resource resource = (Resource) data.c0;
+ Color colorr = (Color) data.c1;
IElement element = DiagramNodeUtil.findElement(ctx, resource);
final G2DParentNode node = element.getHint(DistrictNetworkEdgeElement.KEY_DN_EDGE_NODE);
if (node != null) {
private static final Logger LOGGER = LoggerFactory.getLogger(VisualisationTriggersContributions.class);
private static final String VISUALISATIONS_TRIGGERS_MODULE = "VisualisationTriggers";
private static final String VISUALISATION_TRIGGER_CONTRIBUTION = "visualisationTriggers";
-
+
public static Map<String, List<VisualisationTrigger>> visualisationTriggers(ReadGraph graph) throws DatabaseException {
List<Resource> sharedOntologies = Simantics.applySCL("Simantics/SharedOntologies", "getSharedOntologies", graph, Tuple0.INSTANCE);
-
+
Map<String, List<VisualisationTrigger>> results = new HashMap<>();
Layer0 L0 = Layer0.getInstance(graph);
-
+
Object oldGraph = SCLContext.getCurrent().get("graph");
try {
SCLContext.getCurrent().put("graph", graph);
for (Resource sharedOntology : sharedOntologies) {
-
+
Collection<Resource> userComponents = graph.syncRequest(new ObjectsWithSupertype(sharedOntology, Layer0.getInstance(graph).ConsistsOf, StructuralResource2.getInstance(graph).Component));
-
+
for (Resource userComponent : userComponents) {
NamedResource moduleType = new NamedResource(NameLabelUtil.modalName(graph, userComponent), userComponent);
List<VisualisationTrigger> visualisationTriggerContributions = visualisationTriggerContribution(graph, moduleType);
}
return results;
}
-
+
private static List<VisualisationTrigger> visualisationTriggerContribution(ReadGraph graph, NamedResource moduleType) throws DatabaseException {
Layer0 L0 = Layer0.getInstance(graph);
Resource sclModule = Layer0Utils.getPossibleChild(graph, moduleType.getResource(), L0.SCLModule, VISUALISATIONS_TRIGGERS_MODULE);