Page tree

Versions Compared

Key

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

...

  1. Click File > New > Other... > Plug-in Development > Plug-in Project.
  2. Enter de.cau.cs.kieler.simplelayout as the project name. Click Next.
  3. Set the execution environment to J2SEJavaSE-1.58. (do this for all plug-ins that you create!)
  4. Uncheck all checkboxes in the Options group and click Finish.
  5. If Eclipse asks you whether the Plug-in Development perspective should be opened, choose either Yes or No. It doesn't make much of a difference anyway.

...

  1. Rickt-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. Right-click the new layoutAlgorithm and click New > knownOption. Set option to de.cau.cs.kieler.spacing.
  10. Add another knownOption for de.cau.cs.kieler.borderSpacing.
  11. Save the editor
  12. Your workspace should look similar to this

...

  1. Click Run > Debug Configurations...
  2. Right-click Eclipse Application and click New. Set the configuration's name to Layout Test.
  3. In the Arguments tab, make sure the the program arguments include -debug and -consoleLog.
  4. On the Plug-ins tab, set Launch with to plug-ins selected below only.
    1. Click Deselect All.
    2. Check the Workspace item in the tree.
    3. Check the following plugins under Target Platform are checked:
      • de.cau.cs.kieler.kgraph.text.ui
      ,
      • de.cau.cs.kieler.klighd.xtext
      and
      • org.eclipse.ui.ide.application
      plugins under Target Platform
      • org.eclipse.platform
    4. Click Add Required Plug-ins. Press it twice (just to be sure!).
  5. Click Apply to save your changes and then Debug to start an Eclipse instance to test with.

Test the layouter in your new Eclipse instance:

  1. Click the green button with the yellow thunderbold and check the Enable view management and all other checkboxes.Click New > Project... > General > Project and set the project name to something like Test.
  2. Right-click the new project and click New > Other > KGraph > Random KGraph. Enter a meaningful name and click Finish.
  3. Open the diagram. Another view with graphical representations of the nodes should pop up..kgt file. To show up the Diagram vie, seöect Window > Show View > Other... > Other > Diagram
  4. Open the Layout view through Window > Show View > Other... > KIELER Eclipse Diagram Layout > Layout. Move the view somewhere such that you can see the view and the diagram simultaneously. 
  5. Chose your Simple Test Layouter in the Layout Algorithm section of the Layout View. (If the Layout View shows no properties, click the white background in the Diagram View once.)
  6. You should see something similar to this

...