Search in sources :

Example 1 with GridNodeLayout

use of org.cytoscape.view.layout.internal.algorithms.GridNodeLayout in project cytoscape-impl by cytoscape.

the class CyActivator method start.

@Override
public void start(BundleContext bc) {
    final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
    final UndoSupport undoSupport = getService(bc, UndoSupport.class);
    GridNodeLayout gridNodeLayout = new GridNodeLayout(undoSupport);
    CyLayoutAlgorithmManagerImpl layoutManager = new CyLayoutAlgorithmManagerImpl(gridNodeLayout, serviceRegistrar);
    registerService(bc, layoutManager, CyLayoutAlgorithmManager.class, new Properties());
    {
        Properties props = new Properties();
        // gridNodeLayoutProps.setProperty(PREFERRED_MENU, "Layout.Cytoscape Layouts");
        props.setProperty("preferredTaskManager", "menu");
        props.setProperty(TITLE, gridNodeLayout.toString());
        props.setProperty(MENU_GRAVITY, "10.0");
        registerService(bc, gridNodeLayout, CyLayoutAlgorithm.class, props);
    }
    registerServiceListener(bc, layoutManager::addLayout, layoutManager::removeLayout, CyLayoutAlgorithm.class);
}
Also used : GridNodeLayout(org.cytoscape.view.layout.internal.algorithms.GridNodeLayout) CyLayoutAlgorithm(org.cytoscape.view.layout.CyLayoutAlgorithm) Properties(java.util.Properties) UndoSupport(org.cytoscape.work.undo.UndoSupport) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar)

Example 2 with GridNodeLayout

use of org.cytoscape.view.layout.internal.algorithms.GridNodeLayout in project cytoscape-impl by cytoscape.

the class PerfTest method getLayouts.

private CyLayoutAlgorithmManager getLayouts() {
    CyLayoutAlgorithm gridNodeLayout = new GridNodeLayout(null);
    CyLayoutAlgorithmManagerImpl cyLayouts = new CyLayoutAlgorithmManagerImpl(gridNodeLayout, serviceRegistrar);
    return cyLayouts;
}
Also used : CyLayoutAlgorithm(org.cytoscape.view.layout.CyLayoutAlgorithm) GridNodeLayout(org.cytoscape.view.layout.internal.algorithms.GridNodeLayout) CyLayoutAlgorithmManagerImpl(org.cytoscape.view.layout.internal.CyLayoutAlgorithmManagerImpl)

Aggregations

CyLayoutAlgorithm (org.cytoscape.view.layout.CyLayoutAlgorithm)2 GridNodeLayout (org.cytoscape.view.layout.internal.algorithms.GridNodeLayout)2 Properties (java.util.Properties)1 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)1 CyLayoutAlgorithmManagerImpl (org.cytoscape.view.layout.internal.CyLayoutAlgorithmManagerImpl)1 UndoSupport (org.cytoscape.work.undo.UndoSupport)1