Search in sources :

Example 6 with DynamicTaskFactoryProvisioner

use of org.cytoscape.task.DynamicTaskFactoryProvisioner in project cytoscape-impl by cytoscape.

the class CytoscapeMenuPopulator method addNetworkCollectionTaskFactory.

public void addNetworkCollectionTaskFactory(NetworkCollectionTaskFactory factory, Map<String, String> props) {
    final DynamicTaskFactoryProvisioner factoryProvisioner = serviceRegistrar.getService(DynamicTaskFactoryProvisioner.class);
    final TaskFactory provisioner = factoryProvisioner.createFor(factory);
    provisionerMap.put(factory, provisioner);
    addFactory(provisioner, props);
}
Also used : NetworkViewCollectionTaskFactory(org.cytoscape.task.NetworkViewCollectionTaskFactory) TaskFactory(org.cytoscape.work.TaskFactory) NetworkViewTaskFactory(org.cytoscape.task.NetworkViewTaskFactory) NetworkTaskFactory(org.cytoscape.task.NetworkTaskFactory) TableTaskFactory(org.cytoscape.task.TableTaskFactory) NetworkCollectionTaskFactory(org.cytoscape.task.NetworkCollectionTaskFactory) DynamicTaskFactoryProvisioner(org.cytoscape.task.DynamicTaskFactoryProvisioner)

Example 7 with DynamicTaskFactoryProvisioner

use of org.cytoscape.task.DynamicTaskFactoryProvisioner in project cytoscape-impl by cytoscape.

the class CytoscapeMenuPopulator method addNetworkViewCollectionTaskFactory.

public void addNetworkViewCollectionTaskFactory(NetworkViewCollectionTaskFactory factory, Map<String, String> props) {
    final DynamicTaskFactoryProvisioner factoryProvisioner = serviceRegistrar.getService(DynamicTaskFactoryProvisioner.class);
    final TaskFactory provisioner = factoryProvisioner.createFor(factory);
    provisionerMap.put(factory, provisioner);
    addFactory(provisioner, props);
}
Also used : NetworkViewCollectionTaskFactory(org.cytoscape.task.NetworkViewCollectionTaskFactory) TaskFactory(org.cytoscape.work.TaskFactory) NetworkViewTaskFactory(org.cytoscape.task.NetworkViewTaskFactory) NetworkTaskFactory(org.cytoscape.task.NetworkTaskFactory) TableTaskFactory(org.cytoscape.task.TableTaskFactory) NetworkCollectionTaskFactory(org.cytoscape.task.NetworkCollectionTaskFactory) DynamicTaskFactoryProvisioner(org.cytoscape.task.DynamicTaskFactoryProvisioner)

Example 8 with DynamicTaskFactoryProvisioner

use of org.cytoscape.task.DynamicTaskFactoryProvisioner in project cytoscape-impl by cytoscape.

the class CytoscapeMenuPopulator method addNetworkTaskFactory.

public void addNetworkTaskFactory(NetworkTaskFactory factory, Map<String, String> props) {
    final DynamicTaskFactoryProvisioner factoryProvisioner = serviceRegistrar.getService(DynamicTaskFactoryProvisioner.class);
    final TaskFactory provisioner = factoryProvisioner.createFor(factory);
    provisionerMap.put(factory, provisioner);
    addFactory(provisioner, props);
}
Also used : NetworkViewCollectionTaskFactory(org.cytoscape.task.NetworkViewCollectionTaskFactory) TaskFactory(org.cytoscape.work.TaskFactory) NetworkViewTaskFactory(org.cytoscape.task.NetworkViewTaskFactory) NetworkTaskFactory(org.cytoscape.task.NetworkTaskFactory) TableTaskFactory(org.cytoscape.task.TableTaskFactory) NetworkCollectionTaskFactory(org.cytoscape.task.NetworkCollectionTaskFactory) DynamicTaskFactoryProvisioner(org.cytoscape.task.DynamicTaskFactoryProvisioner)

Example 9 with DynamicTaskFactoryProvisioner

use of org.cytoscape.task.DynamicTaskFactoryProvisioner in project cytoscape-impl by cytoscape.

the class LayoutSettingsDialog method getAlgorithmCmb.

private JComboBox<CyLayoutAlgorithm> getAlgorithmCmb() {
    if (algorithmCmb == null) {
        algorithmCmb = new JComboBox<CyLayoutAlgorithm>();
        algorithmCmb.setRenderer(new LayoutAlgorithmListCellRenderer("-- Select algorithm to view settings --"));
        algorithmCmb.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (initializing)
                    return;
                final Object o = algorithmCmb.getSelectedItem();
                if (o instanceof CyLayoutAlgorithm) {
                    currentLayout = (CyLayoutAlgorithm) o;
                    final PanelTaskManager taskMgr = serviceRegistrar.getService(PanelTaskManager.class);
                    final CyApplicationManager appMgr = serviceRegistrar.getService(CyApplicationManager.class);
                    // Checking if the context has already been charged, if so there is no need to do it again
                    final Object context = currentLayout.getDefaultLayoutContext();
                    tunablesToSave.add(currentLayout);
                    final DynamicTaskFactoryProvisioner factoryProvisioner = serviceRegistrar.getService(DynamicTaskFactoryProvisioner.class);
                    final TaskFactory provisioner = factoryProvisioner.createFor(wrapWithContext(currentLayout, context));
                    final JPanel tunablePnl = taskMgr.getConfiguration(provisioner, context);
                    layoutAttrPnl = new JPanel();
                    layoutAttrPnl.setLayout(new BoxLayout(layoutAttrPnl, BoxLayout.PAGE_AXIS));
                    // Transparent if Aqua
                    layoutAttrPnl.setOpaque(!LookAndFeelUtil.isAquaLAF());
                    final CyNetworkView view = appMgr.getCurrentNetworkView();
                    setNetworkView(view);
                    getAlgorithmPnl().removeAll();
                    getAlgorithmPnl().add(layoutAttrPnl);
                    if (tunablePnl != null) {
                        tunablePnl.setAlignmentX(Component.CENTER_ALIGNMENT);
                        setPanelsTransparent(tunablePnl);
                        getAlgorithmPnl().add(tunablePnl);
                    }
                    if (currentLayout.getSupportsSelectedOnly() && hasSelectedNodes(view)) {
                        selectedTunable.selectedNodesOnly = true;
                        final JPanel panel = taskMgr.getConfiguration(null, selectedTunable);
                        setPanelsTransparent(panel);
                        getAlgorithmPnl().add(panel);
                    }
                    currentAction = provisioner;
                    LayoutSettingsDialog.this.pack();
                }
            }
        });
    }
    return algorithmCmb;
}
Also used : PanelTaskManager(org.cytoscape.work.swing.PanelTaskManager) JPanel(javax.swing.JPanel) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) DynamicTaskFactoryProvisioner(org.cytoscape.task.DynamicTaskFactoryProvisioner) CyApplicationManager(org.cytoscape.application.CyApplicationManager) ActionListener(java.awt.event.ActionListener) CyLayoutAlgorithm(org.cytoscape.view.layout.CyLayoutAlgorithm) NetworkViewTaskFactory(org.cytoscape.task.NetworkViewTaskFactory) TaskFactory(org.cytoscape.work.TaskFactory) CyNetworkView(org.cytoscape.view.model.CyNetworkView)

Example 10 with DynamicTaskFactoryProvisioner

use of org.cytoscape.task.DynamicTaskFactoryProvisioner in project cytoscape-impl by cytoscape.

the class CytoscapeMenuPopulator method addNetworkViewTaskFactory.

public void addNetworkViewTaskFactory(NetworkViewTaskFactory factory, Map<String, String> props) {
    // Check to make sure this is supposed to be in the menus
    if (props.containsKey(IN_MENU_BAR) && !Boolean.parseBoolean(props.get(IN_MENU_BAR).toString()))
        return;
    final DynamicTaskFactoryProvisioner factoryProvisioner = serviceRegistrar.getService(DynamicTaskFactoryProvisioner.class);
    final TaskFactory provisioner = factoryProvisioner.createFor(factory);
    provisionerMap.put(factory, provisioner);
    addFactory(provisioner, props);
}
Also used : NetworkViewCollectionTaskFactory(org.cytoscape.task.NetworkViewCollectionTaskFactory) TaskFactory(org.cytoscape.work.TaskFactory) NetworkViewTaskFactory(org.cytoscape.task.NetworkViewTaskFactory) NetworkTaskFactory(org.cytoscape.task.NetworkTaskFactory) TableTaskFactory(org.cytoscape.task.TableTaskFactory) NetworkCollectionTaskFactory(org.cytoscape.task.NetworkCollectionTaskFactory) DynamicTaskFactoryProvisioner(org.cytoscape.task.DynamicTaskFactoryProvisioner)

Aggregations

DynamicTaskFactoryProvisioner (org.cytoscape.task.DynamicTaskFactoryProvisioner)14 NetworkViewTaskFactory (org.cytoscape.task.NetworkViewTaskFactory)10 TaskFactory (org.cytoscape.work.TaskFactory)10 NetworkCollectionTaskFactory (org.cytoscape.task.NetworkCollectionTaskFactory)9 NetworkTaskFactory (org.cytoscape.task.NetworkTaskFactory)9 NetworkViewCollectionTaskFactory (org.cytoscape.task.NetworkViewCollectionTaskFactory)9 TableTaskFactory (org.cytoscape.task.TableTaskFactory)5 EditNetworkTitleTaskFactory (org.cytoscape.task.edit.EditNetworkTitleTaskFactory)4 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 BoxLayout (javax.swing.BoxLayout)1 JPanel (javax.swing.JPanel)1 CyApplicationManager (org.cytoscape.application.CyApplicationManager)1 CyLayoutAlgorithm (org.cytoscape.view.layout.CyLayoutAlgorithm)1 CyNetworkView (org.cytoscape.view.model.CyNetworkView)1 PanelTaskManager (org.cytoscape.work.swing.PanelTaskManager)1