use of org.cytoscape.internal.view.help.HelpAboutTaskFactory in project cytoscape-impl by cytoscape.
the class MacCyActivator method start.
@Override
public void start(BundleContext context) throws Exception {
final CyServiceRegistrar serviceRegistrar = getService(context, CyServiceRegistrar.class);
final CyShutdown shutdown = getService(context, CyShutdown.class);
final TaskFactory aboutTaskFactory = new HelpAboutTaskFactory(serviceRegistrar);
final DialogTaskManager taskManager = getService(context, DialogTaskManager.class);
final CyShutdownEvent[] lastShutdownEvent = new CyShutdownEvent[1];
CyShutdownListener listener = (CyShutdownEvent e) -> {
lastShutdownEvent[0] = e;
};
registerService(context, listener, CyShutdownListener.class, new Properties());
Application application = Application.getApplication();
application.setQuitHandler((QuitEvent event, QuitResponse response) -> {
shutdown.exit(0);
if (lastShutdownEvent[0] != null && !lastShutdownEvent[0].actuallyShutdown()) {
response.cancelQuit();
}
});
application.setAboutHandler((AboutEvent event) -> {
taskManager.execute(aboutTaskFactory.createTaskIterator());
});
}
use of org.cytoscape.internal.view.help.HelpAboutTaskFactory in project cytoscape-impl by cytoscape.
the class CyActivator method initComponents.
private void initComponents(final BundleContext bc, final CyServiceRegistrar serviceRegistrar) {
CyApplicationManager applicationManager = getService(bc, CyApplicationManager.class);
CyNetworkViewManager netViewManager = getService(bc, CyNetworkViewManager.class);
final CytoscapeMenuBar cytoscapeMenuBar = new CytoscapeMenuBar(serviceRegistrar);
final CytoscapeToolBar cytoscapeToolBar = new CytoscapeToolBar(serviceRegistrar);
cytoscapeMenus = new CytoscapeMenus(cytoscapeMenuBar, cytoscapeToolBar);
toolBarEnableUpdater = new ToolBarEnableUpdater(cytoscapeToolBar, serviceRegistrar);
netSearchBar = new NetworkSearchBar(serviceRegistrar);
netSearchMediator = new NetworkSearchMediator(netSearchBar, serviceRegistrar);
netMainPanel = new NetworkMainPanel(netSearchBar, serviceRegistrar);
netMediator = new NetworkMediator(netMainPanel, serviceRegistrar);
commandToolPanel = new CommandToolDialog(serviceRegistrar);
viewComparator = new ViewComparator(netMainPanel);
gridViewToggleModel = new GridViewToggleModel(GridViewToggleModel.Mode.VIEW);
netViewMainPanel = new NetworkViewMainPanel(gridViewToggleModel, cytoscapeMenus, viewComparator, serviceRegistrar);
netViewMediator = new NetworkViewMediator(netViewMainPanel, netMediator, gridViewToggleModel, serviceRegistrar);
cytoscapeDesktop = new CytoscapeDesktop(cytoscapeMenus, netViewMediator, serviceRegistrar);
final SessionIO sessionIO = new SessionIO();
sessionHandler = new SessionHandler(cytoscapeDesktop, netViewMediator, sessionIO, netMainPanel, serviceRegistrar);
layoutMenuPopulator = new LayoutMenuPopulator(cytoscapeMenuBar, serviceRegistrar);
cytoscapeMenuPopulator = new CytoscapeMenuPopulator(cytoscapeDesktop, serviceRegistrar);
layoutSettingsManager = new LayoutSettingsManager(serviceRegistrar);
helpUserManualTaskFactory = new HelpUserManualTaskFactory(serviceRegistrar);
helpContactHelpDeskTaskFactory = new HelpContactHelpDeskTaskFactory(serviceRegistrar);
helpReportABugTaskFactory = new HelpReportABugTaskFactory(serviceRegistrar);
helpAboutTaskFactory = new HelpAboutTaskFactory(serviceRegistrar);
cyDesktopManager = new CyDesktopManager(netViewMediator);
arrangeGridTaskFactory = new ArrangeTaskFactory(GRID, cyDesktopManager, netViewMediator);
arrangeCascadeTaskFactory = new ArrangeTaskFactory(CASCADE, cyDesktopManager, netViewMediator);
arrangeHorizontalTaskFactory = new ArrangeTaskFactory(HORIZONTAL, cyDesktopManager, netViewMediator);
arrangeVerticalTaskFactory = new ArrangeTaskFactory(VERTICAL, cyDesktopManager, netViewMediator);
preferencesDialogFactory = new PreferencesDialogFactory(serviceRegistrar);
// cy3preferencesDialogFactory = new Cy3PreferencesDialogFactory(serviceRegistrar);
bookmarkDialogFactory = new BookmarkDialogFactory(serviceRegistrar);
undoMonitor = new UndoMonitor(serviceRegistrar);
rowViewTracker = new RowViewTracker();
selecteEdgeViewUpdater = new SelectEdgeViewUpdater(rowViewTracker);
selecteNodeViewUpdater = new SelectNodeViewUpdater(rowViewTracker);
rowsSetViewUpdater = new RowsSetViewUpdater(rowViewTracker, netViewMediator, serviceRegistrar);
recentSessionManager = new RecentSessionManager(serviceRegistrar);
netSelectionMediator = new NetworkSelectionMediator(netMainPanel, netViewMainPanel, serviceRegistrar);
// /// CyActions ////
undoAction = new UndoAction(serviceRegistrar);
redoAction = new RedoAction(serviceRegistrar);
printAction = new PrintAction(applicationManager, netViewManager, serviceRegistrar);
exitAction = new ExitAction(serviceRegistrar);
// cy3preferenceAction = new Cy3PreferenceAction(cytoscapeDesktop, cy3preferencesDialogFactory);
preferenceAction = new PreferenceAction(cytoscapeDesktop, preferencesDialogFactory);
bookmarkAction = new BookmarkAction(cytoscapeDesktop, bookmarkDialogFactory);
settingsAction = new SettingsAction(layoutSettingsManager, serviceRegistrar);
cytoPanelWestAction = new CytoPanelAction(WEST, true, cytoscapeDesktop, 1.0f);
cytoPanelSouthAction = new CytoPanelAction(SOUTH, true, cytoscapeDesktop, 1.1f);
cytoPanelEastAction = new CytoPanelAction(EAST, false, cytoscapeDesktop, 1.2f);
cytoPanelSouthWestAction = new CytoPanelAction(SOUTH_WEST, false, cytoscapeDesktop, 1.3f);
cytoPanelCommandAction = new CytoPanelAction(BOTTOM, false, cytoscapeDesktop, 1.35f);
starterPanelAction = new StarterPanelAction(1.4f, cytoscapeDesktop);
detachedViewToolBarAction = new DetachedViewToolBarAction(1.5f, netViewMediator);
closeWindowAction = new CloseWindowAction(6.1f, netViewMediator);
createNetworkViewsAction = new CreateNetworkViewsAction(3.0f, serviceRegistrar);
destroyNetworkViewsAction = new DestroyNetworkViewsAction(3.1f, serviceRegistrar);
destroyNetworksAction = new DestroyNetworksAction(3.2f, netMainPanel, serviceRegistrar);
exportNetworkAction = new ExportNetworkAction(1000.1f, serviceRegistrar);
exportImageAction = new ExportImageAction(1000.2f, serviceRegistrar);
}
use of org.cytoscape.internal.view.help.HelpAboutTaskFactory in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(final BundleContext bc) throws Exception {
final CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
invokeOnEDTAndWait(() -> {
setLookAndFeel(bc);
}, logger);
// ////////////
ConfigDirPropertyWriter configDirPropertyWriter = new ConfigDirPropertyWriter(serviceRegistrar);
registerService(bc, configDirPropertyWriter, CyShutdownListener.class);
CyHelpBrokerImpl cyHelpBroker = new CyHelpBrokerImpl();
registerService(bc, cyHelpBroker, CyHelpBroker.class);
registerServiceListener(bc, configDirPropertyWriter::addCyProperty, configDirPropertyWriter::removeCyProperty, CyProperty.class);
SimpleGUITunableHandlerFactory<CyPropertyConfirmationHandler> cyPropConfirmHandlerFactory = new SimpleGUITunableHandlerFactory<>(CyPropertyConfirmationHandler.class, CyPropertyConfirmation.class);
registerService(bc, cyPropConfirmHandlerFactory, GUITunableHandlerFactory.class);
invokeOnEDTAndWait(() -> {
initComponents(bc, serviceRegistrar);
});
registerService(bc, undoAction, CyAction.class);
registerService(bc, redoAction, CyAction.class);
registerService(bc, printAction, CyAction.class);
registerService(bc, preferenceAction, CyAction.class);
// registerService(bc, cy3preferenceAction, CyAction.class);
registerService(bc, bookmarkAction, CyAction.class);
registerService(bc, settingsAction, CyAction.class);
registerService(bc, settingsAction, SetCurrentNetworkViewListener.class);
registerService(bc, cytoPanelWestAction, CyAction.class);
registerService(bc, cytoPanelSouthAction, CyAction.class);
registerService(bc, cytoPanelEastAction, CyAction.class);
registerService(bc, cytoPanelSouthWestAction, CyAction.class);
registerService(bc, cytoPanelCommandAction, CyAction.class);
registerService(bc, starterPanelAction, CyAction.class);
registerService(bc, detachedViewToolBarAction, CyAction.class);
registerService(bc, closeWindowAction, CyAction.class);
registerService(bc, cyDesktopManager, CyNetworkViewDesktopMgr.class);
registerService(bc, bookmarkDialogFactory, SessionLoadedListener.class);
{
Properties props = new Properties();
props.setProperty(PREFERRED_MENU, "Help");
props.setProperty(TITLE, "User Manual");
props.setProperty(MENU_GRAVITY, "1.0");
props.setProperty(TOOLTIP, "Show User Manual");
registerService(bc, helpUserManualTaskFactory, TaskFactory.class, props);
}
{
Properties props = new Properties();
props.setProperty(PREFERRED_MENU, "Help");
props.setProperty(MENU_GRAVITY, "7.0");
props.setProperty(TITLE, "Contact Help Desk...");
registerService(bc, helpContactHelpDeskTaskFactory, TaskFactory.class, props);
}
{
Properties props = new Properties();
props.setProperty(PREFERRED_MENU, "Help");
props.setProperty(TITLE, "Report a Bug...");
props.setProperty(MENU_GRAVITY, "8.0");
registerService(bc, helpReportABugTaskFactory, TaskFactory.class, props);
}
{
Properties props = new Properties();
props.setProperty(ServiceProperties.ENABLE_FOR, ENABLE_FOR_NETWORK_AND_VIEW);
props.setProperty(ACCELERATOR, "cmd g");
props.setProperty(PREFERRED_MENU, "View.Arrange Network Windows[8]");
props.setProperty(TITLE, "Grid");
props.setProperty(MENU_GRAVITY, "1.0");
registerService(bc, arrangeGridTaskFactory, TaskFactory.class, props);
}
{
Properties props = new Properties();
props.setProperty(ServiceProperties.ENABLE_FOR, ENABLE_FOR_NETWORK_AND_VIEW);
props.setProperty(PREFERRED_MENU, "View.Arrange Network Windows[8]");
props.setProperty(TITLE, "Cascade");
props.setProperty(MENU_GRAVITY, "2.0");
registerService(bc, arrangeCascadeTaskFactory, TaskFactory.class, props);
}
{
Properties props = new Properties();
props.setProperty(ServiceProperties.ENABLE_FOR, ENABLE_FOR_NETWORK_AND_VIEW);
props.setProperty(PREFERRED_MENU, "View.Arrange Network Windows[8]");
props.setProperty(TITLE, "Vertical Stack");
props.setProperty(MENU_GRAVITY, "3.0");
registerService(bc, arrangeHorizontalTaskFactory, TaskFactory.class, props);
}
{
Properties props = new Properties();
props.setProperty(ServiceProperties.ENABLE_FOR, ENABLE_FOR_NETWORK_AND_VIEW);
props.setProperty(PREFERRED_MENU, "View.Arrange Network Windows[8]");
props.setProperty(TITLE, "Side by Side");
props.setProperty(MENU_GRAVITY, "4.0");
registerService(bc, arrangeVerticalTaskFactory, TaskFactory.class, props);
}
{
Properties props = new Properties();
props.setProperty(IN_NETWORK_PANEL_CONTEXT_MENU, "true");
registerAllServices(bc, createNetworkViewsAction, props);
}
{
Properties props = new Properties();
props.setProperty(IN_NETWORK_PANEL_CONTEXT_MENU, "true");
registerAllServices(bc, destroyNetworkViewsAction, props);
}
{
Properties props = new Properties();
props.setProperty(IN_NETWORK_PANEL_CONTEXT_MENU, "true");
registerAllServices(bc, destroyNetworksAction, props);
}
{
Properties props = new Properties();
props.setProperty(IN_NETWORK_PANEL_CONTEXT_MENU, "true");
registerAllServices(bc, exportNetworkAction, props);
}
{
Properties props = new Properties();
props.setProperty(IN_NETWORK_PANEL_CONTEXT_MENU, "true");
registerAllServices(bc, exportImageAction, props);
}
{
TaskFactory pauseCommand = new PauseCommandTaskFactory(cytoscapeDesktop);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "command");
props.setProperty(COMMAND_DESCRIPTION, "Display a message and pause until the user continues.");
props.setProperty(COMMAND, "pause");
props.setProperty(COMMAND_LONG_DESCRIPTION, "The **pause** command displays a dialog with the text provided in the *message* argument " + "and waits for the user to click **OK**");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{}");
registerService(bc, pauseCommand, TaskFactory.class, props);
}
registerAllServices(bc, cytoscapeDesktop);
registerAllServices(bc, netMainPanel);
registerAllServices(bc, commandToolPanel);
registerAllServices(bc, netMediator);
registerAllServices(bc, netViewMediator);
registerService(bc, undoMonitor, SetCurrentNetworkViewListener.class);
registerService(bc, undoMonitor, NetworkDestroyedListener.class);
registerService(bc, undoMonitor, NetworkViewDestroyedListener.class);
registerAllServices(bc, rowViewTracker);
registerAllServices(bc, selecteEdgeViewUpdater);
registerAllServices(bc, selecteNodeViewUpdater);
registerAllServices(bc, rowsSetViewUpdater);
registerAllServices(bc, sessionHandler);
registerAllServices(bc, toolBarEnableUpdater);
registerAllServices(bc, recentSessionManager);
registerAllServices(bc, netSelectionMediator);
registerAllServices(bc, netSearchMediator);
registerServiceListener(bc, cytoscapeDesktop::addAction, cytoscapeDesktop::removeAction, CyAction.class);
registerServiceListener(bc, preferenceAction::addCyProperty, preferenceAction::removeCyProperty, CyProperty.class);
// registerServiceListener(bc, cy3preferenceAction::addCyProperty, cy3preferenceAction::removeCyProperty, CyProperty.class);
registerServiceListener(bc, cytoscapeDesktop::addCytoPanelComponent, cytoscapeDesktop::removeCytoPanelComponent, CytoPanelComponent.class);
registerServiceListener(bc, cytoscapeDesktop::addToolBarComponent, cytoscapeDesktop::removeToolBarComponent, ToolBarComponent.class);
registerServiceListener(bc, cytoscapeMenuPopulator::addTaskFactory, cytoscapeMenuPopulator::removeTaskFactory, TaskFactory.class);
registerServiceListener(bc, cytoscapeMenuPopulator::addNetworkTaskFactory, cytoscapeMenuPopulator::removeNetworkTaskFactory, NetworkTaskFactory.class);
registerServiceListener(bc, cytoscapeMenuPopulator::addNetworkViewTaskFactory, cytoscapeMenuPopulator::removeNetworkViewTaskFactory, NetworkViewTaskFactory.class);
registerServiceListener(bc, cytoscapeMenuPopulator::addNetworkCollectionTaskFactory, cytoscapeMenuPopulator::removeNetworkCollectionTaskFactory, NetworkCollectionTaskFactory.class);
registerServiceListener(bc, cytoscapeMenuPopulator::addNetworkViewCollectionTaskFactory, cytoscapeMenuPopulator::removeNetworkViewCollectionTaskFactory, NetworkViewCollectionTaskFactory.class);
registerServiceListener(bc, cytoscapeMenuPopulator::addTableTaskFactory, cytoscapeMenuPopulator::removeTableTaskFactory, TableTaskFactory.class);
registerServiceListener(bc, layoutSettingsManager::addLayout, layoutSettingsManager::removeLayout, CyLayoutAlgorithm.class);
registerServiceListener(bc, settingsAction::addLayout, settingsAction::removeLayout, CyLayoutAlgorithm.class);
// For Network Panel context menu
registerServiceListener(bc, netMediator::addNetworkViewTaskFactory, netMediator::removeNetworkViewTaskFactory, NetworkViewTaskFactory.class, CONTEXT_MENU_FILTER);
registerServiceListener(bc, netMediator::addNetworkTaskFactory, netMediator::removeNetworkTaskFactory, NetworkTaskFactory.class, CONTEXT_MENU_FILTER);
registerServiceListener(bc, netMediator::addNetworkViewCollectionTaskFactory, netMediator::removeNetworkViewCollectionTaskFactory, NetworkViewCollectionTaskFactory.class, CONTEXT_MENU_FILTER);
registerServiceListener(bc, netMediator::addNetworkCollectionTaskFactory, netMediator::removeNetworkCollectionTaskFactory, NetworkCollectionTaskFactory.class, CONTEXT_MENU_FILTER);
registerServiceListener(bc, netMediator::addCyAction, netMediator::removeCyAction, CyAction.class, CONTEXT_MENU_FILTER);
registerServiceListener(bc, netSearchMediator::addNetworkSearchTaskFactory, netSearchMediator::removeNetworkSearchTaskFactory, NetworkSearchTaskFactory.class);
registerServiceListener(bc, layoutMenuPopulator::addLayout, layoutMenuPopulator::removeLayout, CyLayoutAlgorithm.class);
if (LookAndFeelUtil.isMac()) {
try {
new MacCyActivator().start(bc);
} catch (Exception e) {
logger.error("Cannot start MacCyActivator", e);
}
} else {
Properties props = new Properties();
props.setProperty(PREFERRED_MENU, "Help");
props.setProperty(TITLE, "About");
props.setProperty(MENU_GRAVITY, "10.0");
registerService(bc, helpAboutTaskFactory, TaskFactory.class, props);
registerService(bc, exitAction, CyAction.class);
}
// Full screen actions. This is platform dependent
FullScreenAction fullScreenAction = null;
if (LookAndFeelUtil.isMac() && MacFullScreenEnabler.supportsNativeFullScreenMode())
fullScreenAction = new FullScreenMacAction(cytoscapeDesktop);
else
fullScreenAction = new FullScreenAction(cytoscapeDesktop);
registerService(bc, fullScreenAction, CyAction.class);
}
Aggregations