3636
3737public abstract class LayerElementProcessor <T extends LayerElement > extends LinkTargetProcessor <T > {
3838
39- protected Map <ModelElement , ProcessorInfo <WidgetFactory >> childInfos = new ConcurrentHashMap <>();
39+ protected Map <ModelElement , ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory >> childInfos = new ConcurrentHashMap <>();
4040
41- protected Map <Connection , CompletableFuture <ConnectionProcessor >> outgoingEndpoints = new ConcurrentHashMap <>();
41+ protected Map <org . nasdanika . graph . Connection , CompletableFuture <WidgetFactory >> outgoingEndpoints = new ConcurrentHashMap <>();
4242
43- @ SuppressWarnings ({ "unchecked" , "rawtypes" })
4443 @ Override
4544 public void addReferrer (ModelElement referrer ) {
4645 super .addReferrer (referrer );
4746 for (Element child : referrer .getChildren ()) {
4847 if (child instanceof ModelElement ) {
49- ProcessorInfo <WidgetFactory > ci = registry .get (child );
48+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > ci = registry .get (child );
5049 if (ci != null /* && ci.getProcessor() != null */ ) {
5150 childInfos .put ((ModelElement ) child , ci );
5251 }
5352 }
5453 }
5554
56- ProcessorInfo <WidgetFactory > referrerInfo = registry .get (referrer );
55+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > referrerInfo = registry .get (referrer );
5756 if (referrerInfo instanceof NodeProcessorInfo ) {
5857 NodeProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > npi = (NodeProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory >) referrerInfo ;
59- outgoingEndpoints . putAll (( Map ) npi . getOutgoingEndpoints ());
58+ npi . getOutgoingSynapses (). forEach (( k , v ) -> outgoingEndpoints . put ( k , v . getEndpoint (). toCompletableFuture ()));
6059 }
6160 }
6261
@@ -71,7 +70,7 @@ public LayerElementProcessor(DrawioProcessorFactory factory) {
7170 public URI getActionURI (ProgressMonitor progressMonitor ) {
7271 LinkTarget linkTarget = element .getLinkTarget ();
7372 if (linkTarget instanceof Page ) {
74- ProcessorInfo <WidgetFactory > ppi = registry .get (linkTarget );
73+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > ppi = registry .get (linkTarget );
7574 if (ppi != null ) {
7675 PageProcessor pageProcessor = (PageProcessor ) ppi .getProcessor ();
7776 if (pageProcessor != null ) {
@@ -98,18 +97,18 @@ public URI getActionURI(ProgressMonitor progressMonitor) {
9897 @ Override
9998 public void resolve (URI base , ProgressMonitor progressMonitor ) {
10099 super .resolve (base , progressMonitor );
101- for (Entry <ModelElement , ProcessorInfo <WidgetFactory >> cpe : childInfos .entrySet ()) {
100+ for (Entry <ModelElement , ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory >> cpe : childInfos .entrySet ()) {
102101 if (cpe .getKey () instanceof Node || isLogicalChildConnection (cpe .getKey ())) {
103102 cpe .getValue ().getProcessor ().resolve (uri , progressMonitor );
104103 }
105104 }
106- for (Entry <Connection , CompletableFuture <ConnectionProcessor >> oe : outgoingEndpoints .entrySet ()) {
105+ for (Entry <org . nasdanika . graph . Connection , CompletableFuture <WidgetFactory >> oe : outgoingEndpoints .entrySet ()) {
107106 oe .getValue ().thenAccept (cp -> cp .resolve (uri , progressMonitor ));
108107 }
109108 if (element .isTargetLink ()) {
110109 LinkTarget linkTarget = element .getLinkTarget ();
111110 if (linkTarget instanceof Page ) {
112- ProcessorInfo <WidgetFactory > ppi = registry .get (linkTarget );
111+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > ppi = registry .get (linkTarget );
113112 if (ppi != null ) {
114113 ppi .getProcessor ().resolve (uri , progressMonitor );
115114 }
@@ -122,7 +121,7 @@ protected Collection<EObject> getDocumentation(ProgressMonitor progressMonitor)
122121 List <EObject > ret = new ArrayList <>();
123122 LinkTarget linkTarget = element .getLinkTarget ();
124123 if (linkTarget instanceof Page ) {
125- ProcessorInfo <WidgetFactory > ppi = registry .get (linkTarget );
124+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > ppi = registry .get (linkTarget );
126125 if (ppi != null ) {
127126 PageProcessor pageProcessor = (PageProcessor ) ppi .getProcessor ();
128127 Text representationText = ContentFactory .eINSTANCE .createText (); // Interpolate with element properties?
@@ -142,7 +141,7 @@ protected Collection<EObject> getDocumentation(ProgressMonitor progressMonitor)
142141 // linked documentation (root)
143142 if (linkTarget instanceof Page ) {
144143 Root root = ((Page ) linkTarget ).getModel ().getRoot ();
145- ProcessorInfo <WidgetFactory > rpi = registry .get (root );
144+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > rpi = registry .get (root );
146145 RootProcessor rootProcessor = (RootProcessor ) rpi .getProcessor ();
147146 ret .addAll (rootProcessor .getDocumentation (progressMonitor ));
148147 }
@@ -160,7 +159,7 @@ public Supplier<Collection<Label>> createLabelsSupplier() {
160159 String sourceKey = configuration .getSourceKey ();
161160
162161 // Own child nodes not linked to other nodes
163- C : for (Entry <ModelElement , ProcessorInfo <WidgetFactory >> ce : childInfos .entrySet ()) {
162+ C : for (Entry <ModelElement , ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory >> ce : childInfos .entrySet ()) {
164163 ModelElement child = ce .getKey ();
165164 if (configuration .test (child )) {
166165 if (child instanceof Connection && ((Connection ) child ).getSource () != null ) {
@@ -193,13 +192,13 @@ public Supplier<Collection<Label>> createLabelsSupplier() {
193192 }
194193
195194 // Connections without parent property
196- for (Entry <Connection , CompletableFuture <ConnectionProcessor >> ce : outgoingEndpoints .entrySet ()) {
197- Connection conn = ce .getKey ();
195+ for (Entry <org . nasdanika . graph . Connection , CompletableFuture <WidgetFactory >> ce : outgoingEndpoints .entrySet ()) {
196+ Connection conn = ( Connection ) ce .getKey ();
198197 if (!Util .isBlank (parentProperty ) && !Util .isBlank (conn .getProperty (parentProperty ))) {
199198 continue ;
200199 }
201200 if (isLogicalChildConnection (conn )) {
202- childLabelsSupplier .put (ce . getKey () , ce .getValue ().join ().createLabelsSupplier ());
201+ childLabelsSupplier .put (conn , ce .getValue ().join ().createLabelsSupplier ());
203202 }
204203 }
205204
@@ -210,7 +209,7 @@ public Supplier<Collection<Label>> createLabelsSupplier() {
210209 for (Connection oc : node .getOutgoingConnections ()) {
211210 Node target = oc .getTarget ();
212211 if (sourceKey .equals (oc .getProperty (parentProperty )) && target != null ) {
213- ProcessorInfo <WidgetFactory > childInfo = registry .get (target );
212+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > childInfo = registry .get (target );
214213 if (childInfo != null ) {
215214 WidgetFactory processor = childInfo .getProcessor ();
216215 if (processor != null ) {
@@ -224,7 +223,7 @@ public Supplier<Collection<Label>> createLabelsSupplier() {
224223 for (Connection ic : node .getIncomingConnections ()) {
225224 Node source = ic .getSource ();
226225 if (targetKey .equals (ic .getProperty (parentProperty )) && source != null ) {
227- ProcessorInfo <WidgetFactory > childInfo = registry .get (source );
226+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > childInfo = registry .get (source );
228227 if (childInfo != null ) {
229228 WidgetFactory processor = childInfo .getProcessor ();
230229 if (processor != null ) {
@@ -240,7 +239,7 @@ public Supplier<Collection<Label>> createLabelsSupplier() {
240239 if (element .isTargetLink ()) {
241240 LinkTarget linkTarget = element .getLinkTarget ();
242241 if (linkTarget instanceof Page ) {
243- ProcessorInfo <WidgetFactory > ppi = registry .get (linkTarget );
242+ ProcessorInfo <WidgetFactory , WidgetFactory , WidgetFactory > ppi = registry .get (linkTarget );
244243 pageLabelSupplier = ppi .getProcessor ().createLabelsSupplier ();
245244 }
246245 }
0 commit comments