Search in sources :

Example 1 with Layout

use of org.gephi.layout.spi.Layout in project gephi by gephi.

the class LayoutModelImpl method setSelectedLayout.

protected void setSelectedLayout(Layout selectedLayout) {
    Layout oldValue = this.selectedLayout;
    this.selectedLayout = selectedLayout;
    this.selectedBuilder = selectedLayout != null ? selectedLayout.getBuilder() : null;
    if (oldValue != null) {
        saveProperties(oldValue);
    }
    injectGraph();
    if (selectedLayout != null) {
        loadProperties(selectedLayout);
    }
    firePropertyChangeEvent(SELECTED_LAYOUT, oldValue, selectedLayout);
}
Also used : Layout(org.gephi.layout.spi.Layout)

Example 2 with Layout

use of org.gephi.layout.spi.Layout in project gephi by gephi.

the class LayoutModelImpl method getLayout.

@Override
public Layout getLayout(LayoutBuilder layoutBuilder) {
    Layout layout = layoutBuilder.buildLayout();
    GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
    GraphModel graphModel = graphController.getGraphModel(workspace);
    layout.setGraphModel(graphModel);
    selectedBuilder = layoutBuilder;
    layout.resetPropertiesValues();
    return layout;
}
Also used : Layout(org.gephi.layout.spi.Layout) GraphModel(org.gephi.graph.api.GraphModel) GraphController(org.gephi.graph.api.GraphController)

Aggregations

Layout (org.gephi.layout.spi.Layout)2 GraphController (org.gephi.graph.api.GraphController)1 GraphModel (org.gephi.graph.api.GraphModel)1