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);
}
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);
}
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);
}
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;
}
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);
}
Aggregations