Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is not hard to guess what getPriority() does: it returns the priority a given layout configuration has. If two layout configurations set a layout option to different values on a given graph element, the value set by the configuration with lower higher priority gets overwrittenwins. The other three methods look a bit more obscure, so we have to provide more details on what the options manager does, exactly.

ENRICHING (+ WHAT IS A LAYOUT CONTEXT)

TRANSFERRING

GETVALUE (for the layout view?)The transferValues(...) method is the main workhorse of the interface. This is where a KGraph element, identified by the given layout context, is equipped with the layout option values a layout configuration deems necessary. It thus becomes the most important part of a layout configuration that you absolutely have to implement, no excuses. If for example every KNode should have its port constraints set to FIXED_POS, this is the place to do it.

With all these layout configurations active, it's by no means clear which layout option values KGraph elements will end up with during the layout process. Enter the getValue(...) method. For a given element and layout option, it returns the value it would set on the element if transferValues(...) was called. This method is mainly used by the Layout view to inform the user about the layout option values of whatever graph element he (or she) has clicked on. It is also the method you can safely neglect to implement if your final product won't include the layout view anyway.

Implementing a Layout Configuration

Warning
titleToDo

deciding what options are applicable depending on the context object; setting the options;


Programmatically Setting Layout Options

...