use of org.cytoscape.work.internal.task.JPanelTaskManager in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
{
UndoSupportImpl undoSupport = new UndoSupportImpl();
Properties props = new Properties();
registerService(bc, undoSupport, UndoSupport.class, props);
registerService(bc, undoSupport, SwingUndoSupport.class, props);
}
JDialogTunableMutator jDialogTunableMutator = new JDialogTunableMutator();
JPanelTunableMutator jPanelTunableMutator = new JPanelTunableMutator();
final TaskStatusBar taskStatusBar = new TaskStatusBar(serviceRegistrar);
final TaskHistory taskHistory = new TaskHistory();
taskStatusBar.addPropertyChangeListener(TaskStatusBar.TASK_HISTORY_CLICK, new PropertyChangeListener() {
TaskHistoryWindow window = null;
// don't need to wrap this method in a SwingUtilities.invokeLater -- it will only be called on the EDT anyway
@Override
public void propertyChange(PropertyChangeEvent e) {
if (window == null)
window = new TaskHistoryWindow(taskHistory);
window.open();
}
});
{
Properties props = new Properties();
props.setProperty("type", "TaskStatus");
registerService(bc, taskStatusBar, StatusBarPanelFactory.class, props);
}
registerService(bc, new CyUserLogAppender(taskStatusBar, taskHistory), PaxAppender.class, ezProps("org.ops4j.pax.logging.appender.name", "CyUserLog"));
JDialogTaskManager jDialogTaskManager = new JDialogTaskManager(jDialogTunableMutator, taskStatusBar, taskHistory, serviceRegistrar);
PanelTaskManager jPanelTaskManager = new JPanelTaskManager(jPanelTunableMutator, jDialogTaskManager);
SupportedFileTypesManager supportedFileTypesManager = new SupportedFileTypesManager();
SimpleGUITunableHandlerFactory<BooleanHandler> booleanHandlerFactory = new SimpleGUITunableHandlerFactory<>(BooleanHandler.class, Boolean.class, boolean.class);
SimpleGUITunableHandlerFactory<IntegerHandler> integerHandlerFactory = new SimpleGUITunableHandlerFactory<>(IntegerHandler.class, Integer.class, int.class);
SimpleGUITunableHandlerFactory<FloatHandler> floatHandlerFactory = new SimpleGUITunableHandlerFactory<>(FloatHandler.class, Float.class, float.class);
SimpleGUITunableHandlerFactory<DoubleHandler> doubleHandlerFactory = new SimpleGUITunableHandlerFactory<>(DoubleHandler.class, Double.class, double.class);
SimpleGUITunableHandlerFactory<LongHandler> longHandlerFactory = new SimpleGUITunableHandlerFactory<>(LongHandler.class, Long.class, long.class);
SimpleGUITunableHandlerFactory<StringHandler> stringHandlerFactory = new SimpleGUITunableHandlerFactory<>(StringHandler.class, String.class);
SimpleGUITunableHandlerFactory<BoundedHandler> boundedIntegerHandlerFactory = new SimpleGUITunableHandlerFactory<>(BoundedHandler.class, BoundedInteger.class);
SimpleGUITunableHandlerFactory<BoundedHandler> boundedFloatHandlerFactory = new SimpleGUITunableHandlerFactory<>(BoundedHandler.class, BoundedFloat.class);
SimpleGUITunableHandlerFactory<BoundedHandler> boundedDoubleHandlerFactory = new SimpleGUITunableHandlerFactory<>(BoundedHandler.class, BoundedDouble.class);
SimpleGUITunableHandlerFactory<BoundedHandler> boundedLongHandlerFactory = new SimpleGUITunableHandlerFactory<>(BoundedHandler.class, BoundedLong.class);
SimpleGUITunableHandlerFactory<ListSingleHandler> listSingleSelectionHandlerFactory = new SimpleGUITunableHandlerFactory<>(ListSingleHandler.class, ListSingleSelection.class);
SimpleGUITunableHandlerFactory<ListMultipleHandler> listMultipleSelectionHandlerFactory = new SimpleGUITunableHandlerFactory<>(ListMultipleHandler.class, ListMultipleSelection.class);
SimpleGUITunableHandlerFactory<UserActionHandler> userActionHandlerFactory = new SimpleGUITunableHandlerFactory<>(UserActionHandler.class, UserAction.class);
URLHandlerFactory urlHandlerFactory = new URLHandlerFactory(serviceRegistrar);
registerService(bc, urlHandlerFactory, GUITunableHandlerFactory.class);
FileHandlerFactory fileHandlerFactory = new FileHandlerFactory(supportedFileTypesManager, serviceRegistrar);
registerService(bc, fileHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, jDialogTaskManager, DialogTaskManager.class);
registerService(bc, jDialogTaskManager, TaskManager.class);
registerService(bc, jPanelTaskManager, PanelTaskManager.class);
registerService(bc, integerHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, floatHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, doubleHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, longHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, booleanHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, stringHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, boundedIntegerHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, boundedFloatHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, boundedDoubleHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, boundedLongHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, listSingleSelectionHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, listMultipleSelectionHandlerFactory, GUITunableHandlerFactory.class);
registerService(bc, userActionHandlerFactory, GUITunableHandlerFactory.class);
registerServiceListener(bc, supportedFileTypesManager::addInputStreamTaskFactory, supportedFileTypesManager::removeInputStreamTaskFactory, InputStreamTaskFactory.class);
registerServiceListener(bc, supportedFileTypesManager::addCyWriterTaskFactory, supportedFileTypesManager::removeCyWriterTaskFactory, CyWriterFactory.class);
registerServiceListener(bc, jDialogTaskManager::addTunableRecorder, jDialogTaskManager::removeTunableRecorder, TunableRecorder.class);
registerServiceListener(bc, jPanelTunableMutator::addTunableHandlerFactory, jPanelTunableMutator::removeTunableHandlerFactory, GUITunableHandlerFactory.class);
registerServiceListener(bc, jDialogTunableMutator::addTunableHandlerFactory, jDialogTunableMutator::removeTunableHandlerFactory, GUITunableHandlerFactory.class);
}
Aggregations