Search in sources :

Example 1 with JPanelTunableMutator

use of org.cytoscape.work.internal.tunables.JPanelTunableMutator 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);
}
Also used : PanelTaskManager(org.cytoscape.work.swing.PanelTaskManager) JPanelTaskManager(org.cytoscape.work.internal.task.JPanelTaskManager) JDialogTaskManager(org.cytoscape.work.internal.task.JDialogTaskManager) SwingUndoSupport(org.cytoscape.work.swing.undo.SwingUndoSupport) PropertyChangeListener(java.beans.PropertyChangeListener) SimpleGUITunableHandlerFactory(org.cytoscape.work.swing.SimpleGUITunableHandlerFactory) TaskHistoryWindow(org.cytoscape.work.internal.task.TaskHistoryWindow) Properties(java.util.Properties) CyServiceRegistrar(org.cytoscape.service.util.CyServiceRegistrar) BooleanHandler(org.cytoscape.work.internal.tunables.BooleanHandler) FloatHandler(org.cytoscape.work.internal.tunables.FloatHandler) LongHandler(org.cytoscape.work.internal.tunables.LongHandler) JPanelTaskManager(org.cytoscape.work.internal.task.JPanelTaskManager) BoundedHandler(org.cytoscape.work.internal.tunables.BoundedHandler) TaskStatusBar(org.cytoscape.work.internal.task.TaskStatusBar) IntegerHandler(org.cytoscape.work.internal.tunables.IntegerHandler) URLHandlerFactory(org.cytoscape.work.internal.tunables.URLHandlerFactory) CyUserLogAppender(org.cytoscape.work.internal.task.CyUserLogAppender) SupportedFileTypesManager(org.cytoscape.work.internal.tunables.utils.SupportedFileTypesManager) FileHandlerFactory(org.cytoscape.work.internal.tunables.FileHandlerFactory) TaskHistory(org.cytoscape.work.internal.task.TaskHistory) ListMultipleHandler(org.cytoscape.work.internal.tunables.ListMultipleHandler) JPanelTunableMutator(org.cytoscape.work.internal.tunables.JPanelTunableMutator) PropertyChangeEvent(java.beans.PropertyChangeEvent) UserActionHandler(org.cytoscape.work.internal.tunables.UserActionHandler) StatusBarPanelFactory(org.cytoscape.work.swing.StatusBarPanelFactory) DoubleHandler(org.cytoscape.work.internal.tunables.DoubleHandler) StringHandler(org.cytoscape.work.internal.tunables.StringHandler) SwingUndoSupport(org.cytoscape.work.swing.undo.SwingUndoSupport) UndoSupport(org.cytoscape.work.undo.UndoSupport) ListSingleHandler(org.cytoscape.work.internal.tunables.ListSingleHandler) JDialogTunableMutator(org.cytoscape.work.internal.tunables.JDialogTunableMutator)

Aggregations

PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 Properties (java.util.Properties)1 CyServiceRegistrar (org.cytoscape.service.util.CyServiceRegistrar)1 CyUserLogAppender (org.cytoscape.work.internal.task.CyUserLogAppender)1 JDialogTaskManager (org.cytoscape.work.internal.task.JDialogTaskManager)1 JPanelTaskManager (org.cytoscape.work.internal.task.JPanelTaskManager)1 TaskHistory (org.cytoscape.work.internal.task.TaskHistory)1 TaskHistoryWindow (org.cytoscape.work.internal.task.TaskHistoryWindow)1 TaskStatusBar (org.cytoscape.work.internal.task.TaskStatusBar)1 BooleanHandler (org.cytoscape.work.internal.tunables.BooleanHandler)1 BoundedHandler (org.cytoscape.work.internal.tunables.BoundedHandler)1 DoubleHandler (org.cytoscape.work.internal.tunables.DoubleHandler)1 FileHandlerFactory (org.cytoscape.work.internal.tunables.FileHandlerFactory)1 FloatHandler (org.cytoscape.work.internal.tunables.FloatHandler)1 IntegerHandler (org.cytoscape.work.internal.tunables.IntegerHandler)1 JDialogTunableMutator (org.cytoscape.work.internal.tunables.JDialogTunableMutator)1 JPanelTunableMutator (org.cytoscape.work.internal.tunables.JPanelTunableMutator)1 ListMultipleHandler (org.cytoscape.work.internal.tunables.ListMultipleHandler)1 ListSingleHandler (org.cytoscape.work.internal.tunables.ListSingleHandler)1