Page tree

Versions Compared

Key

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

...

Before you can test your layout code, you will have to register your new layout provider with KIML.

  1. RicktRight-click the de.cau.cs.kieler.simplelayout package and select New > File.
  2. Create a file simple.elkm and double click it to open it.
  3. When asked whether you want to add the Xtext nature, select yes.
  4. The file is used to specify meta information for your layout algorithm. For this, copy the following code snippet into your editor:

    Code Block
    languagejava
    package de.cau.cs.kieler.simplelayout
    
    bundle {
        label "Simple Layout Algoritms"
        class SimpleOptions
    }
    
    algorithm simple(SimpleLayoutProvider) {
        label "Simple Test Layouter"
        
        supports org.eclipse.elk.spacing.border
        supports org.eclipse.elk.spacing.node
    }
  5. You still have to register the file with Eclipse. Open the META-INF/MANIFEST.MF file again and switch to the Extensions tab.
  6. Add an extension for org.eclipse.elk.core.layoutProviders.
  7. Right-click the extension and click New > provider.
  8. Set the class to your layout provider class name (use the browse button and enter SimpleOptions). Note that SimpleOptions is automatically generated from the .elkm file you created. Its name is specified by the class keyword in the bundle section.
  9. Save the editor
  10. Your workspace should look similar to this

...