Graph API: set layout questions

1. Where can I set layouter? I placed the code below in the BasicGraphPresentationModel.customizeSettings():

Are there other approaches (override some method)?

2. I got an exception when setting the layouter:

Can't unwrap interface: interface a.f.ec
java.lang.AssertionError: Can't unwrap interface: interface a.f.ec
at com.intellij.openapi.graph.impl.GraphBase.b(GraphBase.java:67)
at com.intellij.openapi.graph.impl.GraphBase.a(GraphBase.java:10)
at com.intellij.openapi.graph.impl.GraphBase.b(GraphBase.java:101)
at com.intellij.openapi.graph.impl.GraphBase.unwrap(GraphBase.java:46)
at com.intellij.openapi.graph.impl.GraphManagerImpl.createBufferedLayouter(GraphManagerImpl.java:2623)
at com.intellij.openapi.graph.impl.builder.GraphBuilderImpl.a(GraphBuilderImpl.java:129)
at com.intellij.openapi.graph.impl.builder.GraphBuilderImpl.a(GraphBuilderImpl.java:113)
at com.intellij.openapi.graph.impl.builder.GraphBuilderImpl.d(GraphBuilderImpl.java:107)
at com.intellij.openapi.graph.impl.builder.GraphBuilderImpl.updateView(GraphBuilderImpl.java:211)
at com.intellij.openapi.graph.impl.builder.GraphBuilderImpl.initialize(GraphBuilderImpl.java:137)
at com.intellij.openapi.graph.builder.components.BasicGraphComponent.]]>(BasicGraphComponent.java:46)

What's the reason? Should I wrap the layouter instance using the special method?
Are there some factories / methods to create layouter instances?

3. What classes must custom layouter extend? I simply implement the Layouter interface.

Please sign in to leave a comment.