Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » MrTreeOptions class not exported?
MrTreeOptions class not exported? [message #1751220] Thu, 05 January 2017 18:59 Go to next message
Iain Whiteside is currently offline Iain WhitesideFriend
Messages: 17
Registered: June 2016
Junior Member
Hi,

I was trying to use the MrTreeOptions class (0,1.0, and nightly) to set options programatically, but it doesn't seem to be exposed?
Re: MrTreeOptions class not exported? [message #1751223 is a reply to message #1751220] Thu, 05 January 2017 19:27 Go to previous messageGo to next message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 67
Registered: September 2015
Member
Hi Iain,

thanks or making us aware... I just fixed it and triggered a new build, so the problem should be fixed once you download the nightly again. Smile

Cheers,
Christoph Daniel
Re: MrTreeOptions class not exported? [message #1751231 is a reply to message #1751223] Thu, 05 January 2017 21:58 Go to previous messageGo to next message
Iain Whiteside is currently offline Iain WhitesideFriend
Messages: 17
Registered: June 2016
Junior Member
Thanks for the quick fix. On a related note, my refactoring of KNode to ElkNode for the nightly build seems to not be enough to get the MrTree algorithm running in my custom DiagramLayoutEngine (which I have assumed is where the code mentioned in the documentation should live, it isn't clear Smile ).

public LayoutMapping layout(IWorkbenchPart workbenchPart, Object diagramPart, IElkCancelIndicator cancelIndicator,
Parameters params) {
LayoutConfigurator configurator = new LayoutConfigurator();

configurator.configure(ElkNode.class)
.setProperty(CoreOptions.ALGORITHM, "org.eclipse.elk.mrtree.mrTree");
params.addLayoutRun(configurator);
...
return super.layout(workbenchPart, diagramPart, cancelIndicator, params);
}

Is there something else obvious that I've missed? In the breakpoints I have set, a null algorithm id is being passed around...
Re: MrTreeOptions class not exported? [message #1751233 is a reply to message #1751231] Thu, 05 January 2017 22:48 Go to previous messageGo to next message
Iain Whiteside is currently offline Iain WhitesideFriend
Messages: 17
Registered: June 2016
Junior Member
Also, I see that it's not API, so there are access restrictions. It should be accessible, though, right?
Re: MrTreeOptions class not exported? [message #1751253 is a reply to message #1751233] Fri, 06 January 2017 10:45 Go to previous messageGo to next message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 67
Registered: September 2015
Member
Iain,

the algorithm's ID has in fact changed from what you're using. To be on the safe side, always use MrTreeOptions.ALGORITHM_ID.

Also, there should not be any need to touch the DiagramLayoutEngine. The documentation mentions that class to explain the big picture of what's going on. What you need to do to customize layout for your editor is to implement an appropriate DiagramLayoutConnector (or extend one of the existing ones). That's what ELK invokes to turn an editor's content into an ELK graph that it knows how to deal with, and to apply the layout information back to the editor. Everything else is done by ELK. I'll take a look at the documentation sometime and try to make that clearer, thanks for the hint. Smile

Cheers,
Christoph Daniel
Re: MrTreeOptions class not exported? [message #1751270 is a reply to message #1751253] Fri, 06 January 2017 17:25 Go to previous messageGo to next message
Iain Whiteside is currently offline Iain WhitesideFriend
Messages: 17
Registered: June 2016
Junior Member
Thanks, Christoph. I was confused by where to place the code mentioned here:

https://github.com/eclipse/elk/wiki/Advanced-Configuration

I am tentatively planning to have several layout runs, and couldn't figure out how to do this without touching the DiagramLayoutEngine.

Also - did you see the message about the MrTreeOptions not being API? I cannot get access to anything from those classes.
Re: MrTreeOptions class not exported? [message #1751305 is a reply to message #1751270] Sat, 07 January 2017 13:03 Go to previous message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 67
Registered: September 2015
Member
Iain Whiteside wrote on Fri, 06 January 2017 17:25
Thanks, Christoph. I was confused by where to place the code mentioned here:

https://github.com/eclipse/elk/wiki/Advanced-Configuration

I am tentatively planning to have several layout runs, and couldn't figure out how to do this without touching the DiagramLayoutEngine.


You will need to implement your own layout button for your editor. That layout button will then call one of the DiagramLayoutEngine's invokeLayout(...) methods. You can base your implementation on our implementation of the default layout button provided by ELK's UI components, to be found in the LayoutHandler class in the org.eclipse.elk.core.ui package.

I do see how the documentation is lacking there. I'll try to improve that at some point. Smile

Iain Whiteside wrote on Fri, 06 January 2017 17:25
Also - did you see the message about the MrTreeOptions not being API? I cannot get access to anything from those classes.


See my first reply. Wink Did you try with the current nightly?
Previous Topic:KIELER Siguyama layout algorithm equivalence in ELK
Next Topic:Overlapping "Edge Label" with "Edge Labels"/Nodes
Goto Forum:
  


Current Time: Wed Aug 15 12:43:17 GMT 2018

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

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

Back to the top