From: Tuukka Lehtonen Date: Mon, 15 Jun 2020 10:49:10 +0000 (+0300) Subject: Amendment to 165a995bf446be802c4623b46706a257a5367c69 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e18075e5fda3ef81c260e4dd9f1211f468344a3c;p=simantics%2Fdistrict.git Amendment to 165a995bf446be802c4623b46706a257a5367c69 gitlab #91 (cherry picked from commit 752dc5d524bc31567892121e3a37d14523109cc3) --- diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkEdgeNode.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkEdgeNode.java index 27032028..0e5f3022 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkEdgeNode.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkEdgeNode.java @@ -276,7 +276,6 @@ public class DistrictNetworkEdgeNode extends G2DParentNode implements ISelection this.eventColor = color; } - @PropertySetter(value = "arrowLength") public void setArrowLength(Double length) { // find if there is a child deferred arrow node diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkVertexNode.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkVertexNode.java index 8742fa92..feb217b0 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkVertexNode.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkVertexNode.java @@ -245,10 +245,10 @@ public class DistrictNetworkVertexNode extends G2DParentNode implements ISelecti } @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; diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/participants/DistrictFinderVisualisationParticipant.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/participants/DistrictFinderVisualisationParticipant.java index a88d7ba9..5eb30444 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/participants/DistrictFinderVisualisationParticipant.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/participants/DistrictFinderVisualisationParticipant.java @@ -59,9 +59,9 @@ public class DistrictFinderVisualisationParticipant extends AbstractDiagramParti } }); 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) { diff --git a/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTrigger.java b/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTrigger.java index 7a9614e5..f0953d19 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTrigger.java +++ b/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTrigger.java @@ -27,11 +27,11 @@ public class VisualisationTrigger { public double getThreshold() { return threshold; } - + public Color getColor() { - return color; - } - + return color; + } + /** * * @param colorStr e.g. "#FFFFFF" diff --git a/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggerComponent.java b/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggerComponent.java index b18fede4..6502fe9f 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggerComponent.java +++ b/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggerComponent.java @@ -16,8 +16,8 @@ public class VisualisationTriggerComponent { } public Resource getElement() { - return element; - } + return element; + } public ComponentBase getComponent() { return component; diff --git a/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggersContributions.java b/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggersContributions.java index 8120a973..1cab0bf9 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggersContributions.java +++ b/org.simantics.district.network/src/org/simantics/district/network/visualisations/triggers/VisualisationTriggersContributions.java @@ -27,20 +27,20 @@ public class VisualisationTriggersContributions { 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> visualisationTriggers(ReadGraph graph) throws DatabaseException { List sharedOntologies = Simantics.applySCL("Simantics/SharedOntologies", "getSharedOntologies", graph, Tuple0.INSTANCE); - + Map> 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 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 visualisationTriggerContributions = visualisationTriggerContribution(graph, moduleType); @@ -53,7 +53,7 @@ public class VisualisationTriggersContributions { } return results; } - + private static List visualisationTriggerContribution(ReadGraph graph, NamedResource moduleType) throws DatabaseException { Layer0 L0 = Layer0.getInstance(graph); Resource sclModule = Layer0Utils.getPossibleChild(graph, moduleType.getResource(), L0.SCLModule, VISUALISATIONS_TRIGGERS_MODULE);