Author: kono
Date: 2011-12-14 13:35:33 -0800 (Wed, 14 Dec 2011)
New Revision: 27796

Modified:
   
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/CyActivator.java
   
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/WelcomeScreenAction.java
Log:
Welcome screen will be set to visible by an CyStart event.

Modified: 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/CyActivator.java
===================================================================
--- 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/CyActivator.java
       2011-12-14 21:24:28 UTC (rev 27795)
+++ 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/CyActivator.java
       2011-12-14 21:35:33 UTC (rev 27796)
@@ -137,11 +137,7 @@
                super();
        }
 
-       /**
-        *  DOCUMENT ME!
-        *
-        * @param bc DOCUMENT ME!
-        */
+       @Override
        public void start(BundleContext bc) {
                
                ImportNetworksTaskFactory importNetworkTF = getService(bc, 
ImportNetworksTaskFactory.class, "(id=loadNetworkURLTaskFactory)");
@@ -282,8 +278,8 @@
                
                // Show Welcome Screen
                final WelcomeScreenAction welcomeScreenAction = new 
WelcomeScreenAction(cytoscapeDesktop, openBrowserServiceRef, 
recentlyOpenedTrackerServiceRef, openSessionTaskFactory, 
submenuTaskManagerServiceRef, importNetworkFileTF, importNetworkTF, 
createNetworkViewTaskFactory, cyApplicationConfigurationServiceRef, 
dsManagerServiceRef, cytoscapePropertiesServiceRef);
-               
-               registerService(bc, welcomeScreenAction, CyAction.class, new 
Properties());
+               registerAllServices(bc, welcomeScreenAction, new Properties());
+
                registerService(bc, undoAction, CyAction.class, new 
Properties());
                registerService(bc, redoAction, CyAction.class, new 
Properties());
                registerService(bc, printAction, CyAction.class, new 
Properties());
@@ -400,16 +396,5 @@
                                        CyProperty.class);
                registerServiceListener(bc, layoutMenuPopulator, "addLayout", 
"removeLayout",
                                        CyLayoutAlgorithm.class);
-               
-               // Show Welcome screen
-               SwingUtilities.invokeLater(new Runnable() {
-                       
-                       @Override
-                       public void run() {
-                               // TODO Auto-generated method stub
-                               welcomeScreenAction.actionPerformed(null);
-                       }
-               });
-               
        }
 }

Modified: 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/WelcomeScreenAction.java
===================================================================
--- 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/WelcomeScreenAction.java
       2011-12-14 21:24:28 UTC (rev 27795)
+++ 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/WelcomeScreenAction.java
       2011-12-14 21:35:33 UTC (rev 27796)
@@ -6,7 +6,8 @@
 import javax.swing.JDialog;
 
 import org.cytoscape.application.CyApplicationConfiguration;
-import org.cytoscape.application.CyApplicationManager;
+import org.cytoscape.application.events.CyStartEvent;
+import org.cytoscape.application.events.CyStartListener;
 import org.cytoscape.application.swing.AbstractCyAction;
 import org.cytoscape.application.swing.CySwingApplication;
 import org.cytoscape.datasource.DataSourceManager;
@@ -19,7 +20,7 @@
 import org.cytoscape.work.TaskFactory;
 import org.cytoscape.work.TaskManager;
 
-public class WelcomeScreenAction extends AbstractCyAction {
+public class WelcomeScreenAction extends AbstractCyAction implements 
CyStartListener {
 
        private static final long serialVersionUID = 2584201062371825221L;
 
@@ -68,5 +69,11 @@
                welcomeScreen.setLocationRelativeTo(app.getJFrame());
                welcomeScreen.setVisible(true);
        }
+       
+       @Override
+       public void handleEvent(CyStartEvent e) {
+               // Simply displays the dialog after startup.
+               actionPerformed(null);
+       }
 
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to