Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » [ELK] NPE exception in ELK 0.4.0
[ELK] NPE exception in ELK 0.4.0 [message #1790993] Thu, 21 June 2018 07:17 Go to next message
lee lucky is currently offline lee luckyFriend
Messages: 26
Registered: October 2017
Junior Member
Hi,
I use ELK 0.4.0 with the following properties to layout my diagram, I met an exception:
Properties:
.setProperty(CoreOptions.ALGORITHM, "org.eclipse.elk.alg.layered")
.setProperty(CoreOptions.DIRECTION, Direction.RIGHT)
.setProperty(CoreOptions.PORT_LABELS_PLACEMENT, PortLabelPlacement.INSIDE)
.setProperty(LayeredOptions.PORT_CONSTRAINTS, PortConstraints.FIXED_SIDE)
.setProperty(CoreOptions.NODE_SIZE_OPTIONS, EnumSet.of(SizeOptions.MINIMUM_SIZE_ACCOUNTS_FOR_PADDING))
.setProperty(CoreOptions.NODE_SIZE_CONSTRAINTS, EnumSet.allOf(SizeConstraint.class))
.setProperty(CoreOptions.NODE_LABELS_PLACEMENT, NodeLabelPlacement.insideTopCenter())
.setProperty(LayeredOptions.MERGE_EDGES, true).setProperty(LayeredOptions.MERGE_HIERARCHY_EDGES, true)
.setProperty(CoreOptions.HIERARCHY_HANDLING, HierarchyHandling.INCLUDE_CHILDREN);

Exception:
java.lang.NullPointerException
	at org.eclipse.elk.alg.layered.p3order.AbstractBarycenterPortDistributor.updateNodePositions(AbstractBarycenterPortDistributor.java:325)
	at org.eclipse.elk.alg.layered.p3order.AbstractBarycenterPortDistributor.distributePortsWhileSweeping(AbstractBarycenterPortDistributor.java:85)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.sweepReducingCrossings(LayerSweepCrossingMinimizer.java:248)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.sweepInHierarchicalNode(LayerSweepCrossingMinimizer.java:287)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.sweepInHierarchicalNodes(LayerSweepCrossingMinimizer.java:266)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.sweepReducingCrossings(LayerSweepCrossingMinimizer.java:250)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.minimizeCrossingsWithCounter(LayerSweepCrossingMinimizer.java:200)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.compareDifferentRandomizedLayouts(LayerSweepCrossingMinimizer.java:185)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.lambda$1(LayerSweepCrossingMinimizer.java:131)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.minimizeCrossings(LayerSweepCrossingMinimizer.java:143)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.process(LayerSweepCrossingMinimizer.java:121)
	at org.eclipse.elk.alg.layered.p3order.LayerSweepCrossingMinimizer.process(LayerSweepCrossingMinimizer.java:1)
	at org.eclipse.elk.alg.layered.ElkLayered.hierarchicalLayout(ElkLayered.java:241)
	at org.eclipse.elk.alg.layered.ElkLayered.doCompoundLayout(ElkLayered.java:182)
	at org.eclipse.elk.alg.layered.LayeredLayoutProvider.layout(LayeredLayoutProvider.java:58)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.executeAlgorithm(RecursiveGraphLayoutEngine.java:222)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layoutRecursively(RecursiveGraphLayoutEngine.java:197)
	at org.eclipse.elk.core.RecursiveGraphLayoutEngine.layout(RecursiveGraphLayoutEngine.java:76)
	at org.eclipse.elk.core.service.DiagramLayoutEngine.layout(DiagramLayoutEngine.java:718)
	at org.eclipse.elk.core.service.DiagramLayoutEngine.layout(DiagramLayoutEngine.java:650)
	at org.eclipse.elk.core.service.DiagramLayoutEngine$1.execute(DiagramLayoutEngine.java:400)
	at org.eclipse.elk.core.service.util.MonitoredOperation$1.run(MonitoredOperation.java:236)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)


In my source codes, I just customized my port side according to my semantic model information, and I did not changed the source codes of ELK 0.4.0.
I have found that if "LayeredOptions.PORT_CONSTRAINTS, PortConstraints.FIXED_SIDE" and "CoreOptions.HIERARCHY_HANDLING, HierarchyHandling.INCLUDE_CHILDREN" both exist, the exception will occur, Do you met this kind of problem? Did I have something wrong with my configuration or it is a bug? Please give me some suggestions.
Thanks and hope for your reply.
Re: [ELK] NPE exception in ELK 0.4.0 [message #1792453 is a reply to message #1790993] Wed, 18 July 2018 08:31 Go to previous message
Miro Spönemann is currently offline Miro SpönemannFriend
Messages: 50
Registered: March 2015
Location: Kiel, Germany
Member

Please report this on GitHub. Might be that something is wrong with your configuration, but a NullPointerException is definitely not helpful.
Previous Topic:[ELK] SOUTH ports and NORTH ports are overlapped
Next Topic:Issue with Sirius Custom Layout and ELK Layout
Goto Forum:
  


Current Time: Sat Nov 17 04:58:52 GMT 2018

Powered by FUDForum. Page generated in 0.02272 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top