Author: kono
Date: 2012-02-22 11:50:29 -0800 (Wed, 22 Feb 2012)
New Revision: 28337
Removed:
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/welcomescreen/BackgroundImagePanel.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/CreateNewNetworkPanel.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTask.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTaskFactory.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/HelpPanel.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/LogoPanel.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/OpenPanel.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/WelcomeScreenDialog.java
Modified:
core3/gui-distribution/trunk/features/src/main/resources/features.xml
core3/impl/trunk/pom.xml
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/CyActivator.java
Log:
fixes #597 Welcome Screen had been moved to a new bundle.
Modified: core3/gui-distribution/trunk/features/src/main/resources/features.xml
===================================================================
--- core3/gui-distribution/trunk/features/src/main/resources/features.xml
2012-02-22 19:48:27 UTC (rev 28336)
+++ core3/gui-distribution/trunk/features/src/main/resources/features.xml
2012-02-22 19:50:29 UTC (rev 28337)
@@ -144,6 +144,7 @@
<bundle
start-level="175">mvn:org.cytoscape/app-impl/${cytoscape.impl.version}</bundle>
+ <bundle
start-level="175">mvn:org.cytoscape/welcome-impl/${cytoscape.impl.version}</bundle>
</feature>
</features>
Modified: core3/impl/trunk/pom.xml
===================================================================
--- core3/impl/trunk/pom.xml 2012-02-22 19:48:27 UTC (rev 28336)
+++ core3/impl/trunk/pom.xml 2012-02-22 19:50:29 UTC (rev 28337)
@@ -59,10 +59,11 @@
<!-- <module>work-headless-impl</module> -->
<module>work-swing-impl</module>
<module>application-impl</module>
- <module>webservice-psicquic-client-impl</module>
- <module>datasource-impl</module>
- <module>datasource-biogrid-impl</module>
- </modules>
+ <module>webservice-psicquic-client-impl</module>
+ <module>datasource-impl</module>
+ <module>datasource-biogrid-impl</module>
+ <module>welcome-impl</module>
+ </modules>
<properties>
<cytoscape.api.version>3.0.0-alpha8-SNAPSHOT</cytoscape.api.version>
@@ -339,4 +340,4 @@
</plugins>
</build>
-</project>
+</project>
\ No newline at end of file
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
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/CyActivator.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -63,7 +63,6 @@
import org.cytoscape.internal.actions.PreferenceAction;
import org.cytoscape.internal.actions.PrintAction;
import org.cytoscape.internal.actions.RecentSessionManager;
-import org.cytoscape.internal.actions.WelcomeScreenAction;
import org.cytoscape.internal.dialogs.BookmarkDialogFactoryImpl;
import org.cytoscape.internal.dialogs.PreferencesDialogFactoryImpl;
import org.cytoscape.internal.io.SessionStateIO;
@@ -142,18 +141,9 @@
@Override
public void start(BundleContext bc) throws Exception {
- ImportNetworksTaskFactory importNetworkTF = getService(bc,
ImportNetworksTaskFactory.class, "(id=loadNetworkURLTaskFactory)");
- TaskFactory importNetworkFileTF = getService(bc,
TaskFactory.class, "(id=loadNetworkFileTaskFactory)");
- NetworkTaskFactory createNetworkViewTaskFactory =
getService(bc, NetworkTaskFactory.class, "(id=createNetworkViewTaskFactory)");
- TaskFactory openSessionTaskFactory = getService(bc,
TaskFactory.class, "(id=openSessionTaskFactory)");
-
- DataSourceManager dsManagerServiceRef = getService(bc,
DataSourceManager.class);
-
-
CyShutdown cytoscapeShutdownServiceRef = getService(bc,
CyShutdown.class);
CyApplicationConfiguration cyApplicationConfigurationServiceRef
= getService(bc,
CyApplicationConfiguration.class);
- StreamUtil streamUtilServiceRef = getService(bc,
StreamUtil.class);
RecentlyOpenedTracker recentlyOpenedTrackerServiceRef =
getService(bc,
RecentlyOpenedTracker.class);
CyProperty cytoscapePropertiesServiceRef = getService(bc,
CyProperty.class,
@@ -168,26 +158,20 @@
CyNetworkViewManager cyNetworkViewManagerServiceRef =
getService(bc,
CyNetworkViewManager.class);
CyNetworkManager cyNetworkManagerServiceRef = getService(bc,
CyNetworkManager.class);
- CyNetworkNaming cyNetworkNamingServiceRef = getService(bc,
CyNetworkNaming.class);
DialogTaskManager dialogTaskManagerServiceRef = getService(bc,
DialogTaskManager.class);
PanelTaskManager panelTaskManagerServiceRef = getService(bc,
PanelTaskManager.class);
SubmenuTaskManager submenuTaskManagerServiceRef =
getService(bc, SubmenuTaskManager.class);
- RenderingEngineFactory dingRenderingEngineFactoryServiceRef =
getService(bc,
-
RenderingEngineFactory.class,
-
"(id=ding)");
+
RenderingEngineFactory
dingNavigationPresentationFactoryServiceRef = getService(bc,
RenderingEngineFactory.class,
"(id=dingNavigation)");
CyProperty bookmarkServiceRef = getService(bc, CyProperty.class,
"(cyPropertyName=bookmarks)");
BookmarksUtil bookmarksUtilServiceRef = getService(bc,
BookmarksUtil.class);
- CyNetworkFactory cyNetworkFactoryServiceRef = getService(bc,
CyNetworkFactory.class);
- CyNetworkViewFactory cyNetworkViewFactoryServiceRef =
getService(bc,
-
CyNetworkViewFactory.class);
+
CyLayoutAlgorithmManager cyLayoutsServiceRef = getService(bc,
CyLayoutAlgorithmManager.class);
SwingUndoSupport undoSupportServiceRef = getService(bc,
SwingUndoSupport.class);
CyEventHelper cyEventHelperServiceRef = getService(bc,
CyEventHelper.class);
- CyTableManager cyTableManagerServiceRef = getService(bc,
CyTableManager.class);
CyServiceRegistrar cyServiceRegistrarServiceRef =
getService(bc, CyServiceRegistrar.class);
OpenBrowser openBrowserServiceRef = getService(bc,
OpenBrowser.class);
@@ -286,11 +270,8 @@
cySessionManagerServiceRef,
sessionReaderManagerServiceRef,
cyApplicationManagerServiceRef);
-
- // Show Welcome Screen
- final WelcomeScreenAction welcomeScreenAction = new
WelcomeScreenAction(bc,cytoscapeDesktop, openBrowserServiceRef,
recentlyOpenedTrackerServiceRef, openSessionTaskFactory,
submenuTaskManagerServiceRef, importNetworkFileTF, importNetworkTF,
createNetworkViewTaskFactory, cyApplicationConfigurationServiceRef,
dsManagerServiceRef, cytoscapePropertiesServiceRef);
- 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());
Deleted:
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
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/WelcomeScreenAction.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,102 +0,0 @@
-package org.cytoscape.internal.actions;
-
-import java.awt.event.ActionEvent;
-import java.util.Properties;
-
-import javax.swing.JDialog;
-
-import org.cytoscape.application.CyApplicationConfiguration;
-import org.cytoscape.application.events.CyStartEvent;
-import org.cytoscape.application.events.CyStartListener;
-import org.cytoscape.application.swing.AbstractCyAction;
-import org.cytoscape.application.swing.CyAction;
-import org.cytoscape.application.swing.CySwingApplication;
-import org.cytoscape.datasource.DataSourceManager;
-import org.cytoscape.internal.actions.welcomescreen.WelcomeScreenDialog;
-import org.cytoscape.io.util.RecentlyOpenedTracker;
-import org.cytoscape.property.CyProperty;
-import org.cytoscape.task.NetworkTaskFactory;
-import org.cytoscape.task.creation.ImportNetworksTaskFactory;
-import org.cytoscape.util.swing.OpenBrowser;
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.work.TaskManager;
-import org.osgi.framework.BundleContext;
-
-public class WelcomeScreenAction extends AbstractCyAction implements
CyStartListener {
-
- private static final long serialVersionUID = 2584201062371825221L;
-
- public static final String DO_NOT_DISPLAY_PROP_NAME =
"hideWelcomScreen";
-
- private static final String MENU_NAME = "Welcome Screen...";
- private static final String PARENT_NAME = "Help";
-
- private final OpenBrowser openBrowser;
- private final RecentlyOpenedTracker fileTracker;
- private final TaskManager guiTaskManager;
- private final ImportNetworksTaskFactory importNetworksTaskFactory;
- private final CyApplicationConfiguration config;
- private final DataSourceManager dsManager;
-
- private final NetworkTaskFactory networkTaskFactory;
- private final TaskFactory openSessionTaskFactory;
- private final TaskFactory importNetworkFileTF;
-
- private final CySwingApplication app;
- private final CyProperty<Properties> cyProps;
-
- private final BundleContext bc;
-
- private boolean hide = false;
-
- public WelcomeScreenAction(final BundleContext bc, final
CySwingApplication app,
- OpenBrowser openBrowserServiceRef,
RecentlyOpenedTracker fileTracker, final TaskFactory openSessionTaskFactory,
TaskManager guiTaskManager,
- final TaskFactory importNetworkFileTF, final
ImportNetworksTaskFactory importNetworksTaskFactory, final NetworkTaskFactory
networkTaskFactory,
- final CyApplicationConfiguration config, final
DataSourceManager dsManager, final CyProperty<Properties> cyProps) {
- super(MENU_NAME);
- setPreferredMenu(PARENT_NAME);
-
- this.openBrowser = openBrowserServiceRef;
- this.fileTracker = fileTracker;
- this.guiTaskManager = guiTaskManager;
- this.importNetworksTaskFactory = importNetworksTaskFactory;
- this.networkTaskFactory = networkTaskFactory;
- this.config = config;
- this.dsManager = dsManager;
- this.app = app;
- this.cyProps = cyProps;
- this.openSessionTaskFactory = openSessionTaskFactory;
- this.importNetworkFileTF = importNetworkFileTF;
- this.bc = bc;
-
- }
-
- @Override
- public void actionPerformed(ActionEvent ae) {
- final WelcomeScreenDialog welcomeScreen = new
WelcomeScreenDialog(bc,openBrowser, fileTracker, openSessionTaskFactory,
guiTaskManager, config,
- importNetworkFileTF, importNetworksTaskFactory,
networkTaskFactory, dsManager, cyProps, hide);
- welcomeScreen.setLocationRelativeTo(app.getJFrame());
- welcomeScreen.setVisible(true);
- this.hide = welcomeScreen.getHideStatus();
-
this.cyProps.getProperties().setProperty(DO_NOT_DISPLAY_PROP_NAME,
((Boolean)hide).toString());
- }
-
- @Override
- public void handleEvent(CyStartEvent e) {
- // Simply displays the dialog after startup.
- final String hideString =
this.cyProps.getProperties().getProperty(DO_NOT_DISPLAY_PROP_NAME);
-
- if (hideString == null)
- hide = false;
- else {
- try {
- hide = Boolean.parseBoolean(hideString);
- } catch (Exception ex) {
- hide = false;
- }
- }
-
- if(hide == false)
- actionPerformed(null);
- }
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/BackgroundImagePanel.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/BackgroundImagePanel.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/BackgroundImagePanel.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,32 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-
-import javax.swing.JPanel;
-
-public class BackgroundImagePanel extends JPanel {
-
- private static final long serialVersionUID = 3969531543044198032L;
-
- private final BufferedImage image;
-
- public BackgroundImagePanel(final BufferedImage image) {
- this.image = image;
- }
-
- @Override
- public void paintComponent(Graphics g) {
- Graphics2D g2D = (Graphics2D) g;
-
- int panelWidth = this.getWidth();
- int panelHeight = this.getHeight();
-
- g2D.setColor(getBackground());
- g2D.fillRect(0, 0, panelWidth, panelHeight);
-
- g2D.drawImage(image, null, 0, 0);
- }
-
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/CreateNewNetworkPanel.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/CreateNewNetworkPanel.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/CreateNewNetworkPanel.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,297 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.awt.Color;
-import java.awt.GridLayout;
-import java.awt.Window;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.imageio.ImageIO;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.ImageIcon;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.border.LineBorder;
-
-import org.cytoscape.application.CyApplicationConfiguration;
-import org.cytoscape.application.swing.CyAction;
-import org.cytoscape.datasource.DataSource;
-import org.cytoscape.datasource.DataSourceManager;
-import org.cytoscape.io.DataCategory;
-import org.cytoscape.model.CyNetwork;
-import org.cytoscape.task.NetworkTaskFactory;
-import org.cytoscape.task.creation.ImportNetworksTaskFactory;
-import org.cytoscape.work.AbstractTask;
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.work.TaskIterator;
-import org.cytoscape.work.TaskManager;
-import org.cytoscape.work.TaskMonitor;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CreateNewNetworkPanel extends JPanel implements ActionListener {
-
- private static final long serialVersionUID = -8750909701276867389L;
-
- private static final Logger logger =
LoggerFactory.getLogger(CreateNewNetworkPanel.class);
-
- private static final String VIEW_THRESHOLD = "viewThreshold";
- private static final int DEF_VIEW_THRESHOLD = 3000;
-
- private static final String ICON_OPEN =
"images/Icons/net_file_import_small.png";
- private static final String ICON_DATABASE =
"images/Icons/net_db_import_small.png";
-
- private JLabel loadNetwork;
- private JLabel fromDB;
- private JLabel fromWebService;
-
- private JComboBox networkList;
- private JCheckBox layout;
-
- private final TaskManager guiTaskManager;
-
- private Window parent;
-
- private final BundleContext bc;
-
- private final ImportNetworksTaskFactory importNetworkFromURLTF;
- private final TaskFactory importNetworkFileTF;
- private final NetworkTaskFactory createViewTaskFactory;
-
- private final DataSourceManager dsManager;
- private final Map<String, String> dataSourceMap;
-
- private final int viewThreshold;
-
- private boolean firstSelection = false;
-
- CreateNewNetworkPanel(Window parent, final BundleContext bc, final
TaskManager guiTaskManager,
- final TaskFactory importNetworkFileTF, final
ImportNetworksTaskFactory loadTF,
- final NetworkTaskFactory createViewTaskFactory, final
CyApplicationConfiguration config,
- final DataSourceManager dsManager, final Properties
props) {
- this.parent = parent;
- this.bc = bc;
-
- this.importNetworkFromURLTF = loadTF;
- this.createViewTaskFactory = createViewTaskFactory;
- this.importNetworkFileTF = importNetworkFileTF;
- this.guiTaskManager = guiTaskManager;
- this.dsManager = dsManager;
- this.viewThreshold = getViewThreshold(props);
-
- this.dataSourceMap = new HashMap<String, String>();
- this.networkList = new JComboBox();
-
- setFromDataSource();
-
- initComponents();
-
- // Enable combo box listener here to avoid unnecessary reaction.
- this.networkList.addActionListener(this);
- }
-
- private void setFromDataSource() {
- DefaultComboBoxModel theModel = new DefaultComboBoxModel();
-
- // Extract the URL entries
- final Collection<DataSource> dataSources =
dsManager.getDataSources(DataCategory.NETWORK);
- final SortedSet<String> labelSet = new TreeSet<String>();
- if (dataSources != null) {
- for (DataSource ds : dataSources) {
- String link = null;
- link = ds.getLocation().toString();
- final String sourceName = ds.getName();
- final String provider = ds.getProvider();
- final String sourceLabel = provider + ":" +
sourceName;
- dataSourceMap.put(sourceLabel, link);
- labelSet.add(sourceLabel);
- }
- }
-
- theModel.addElement("Select a network ...");
-
- for (final String label : labelSet)
- theModel.addElement(label);
-
- this.networkList.setModel(theModel);
- }
-
- private void initComponents() {
-
- BufferedImage openIconImg = null;
- BufferedImage databaseIconImg = null;
- try {
- openIconImg =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource(ICON_OPEN));
- databaseIconImg =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource(ICON_DATABASE));
- } catch (IOException e) {
- logger.error("Could not load icons", e);
- }
-
- ImageIcon openIcon = new ImageIcon(openIconImg);
- ImageIcon databaseIcon = new ImageIcon(databaseIconImg);
-
- this.layout = new JCheckBox();
- layout.setText("Apply default layout");
- layout.setToolTipText("Note: This option may take minutes to
finish for large networks!");
-
- this.loadNetwork = new JLabel("From file...");
- this.loadNetwork.setIcon(openIcon);
-
- loadNetwork.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent ev) {
- // Load network from file.
- parent.dispose();
- guiTaskManager.execute(importNetworkFileTF);
- }
- });
- this.setBorder(new LineBorder(new Color(0, 0, 0, 0), 10));
-
- this.fromDB = new JLabel("From Reference Network Data:");
- this.fromDB.setIcon(databaseIcon);
-
- this.fromWebService = new JLabel("From Public Web Service...");
- this.fromWebService.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent ev) {
- // Load network from web service.
- parent.dispose();
- try {
- execute(bc);
- } catch (InvalidSyntaxException e) {
- logger.error("Could not execute the
action", e);
- }
- }
- });
-
- this.setLayout(new GridLayout(5, 1));
- this.add(loadNetwork);
- this.add(fromWebService);
- this.add(fromDB);
- this.add(networkList);
- this.add(layout);
-
- }
-
- private void loadNetwork() throws URISyntaxException,
MalformedURLException {
-
- // Get selected file from the combo box
- final Object file = networkList.getSelectedItem();
- if (file == null)
- return;
-
- if (!dataSourceMap.containsKey(file))
- return;
- final URL url = new URL(dataSourceMap.get(file));
-
- parent.dispose();
-
- // TODO REFACTOR!!!!!!!!!!!!!!!!!!!
- guiTaskManager.execute(new TaskFactory() {
-
- @Override
- public TaskIterator createTaskIterator() {
- return new TaskIterator(2,
- new CreateNetworkViewTask(url,
importNetworkFromURLTF, createViewTaskFactory));
- }
- });
-
- }
-
- private int getViewThreshold(final Properties props) {
- final String vts = props.getProperty(VIEW_THRESHOLD);
- int threshold;
- try {
- threshold = Integer.parseInt(vts);
- } catch (Exception e) {
- threshold = DEF_VIEW_THRESHOLD;
- }
-
- return threshold;
- }
-
- private final class CreateNetworkViewTask extends AbstractTask {
-
- private final ImportNetworksTaskFactory loadNetworkFileTF;
- private final NetworkTaskFactory createViewTaskFactory;
-
- private final URL url;
-
- public CreateNetworkViewTask(final URL url, final
ImportNetworksTaskFactory loadNetworkFileTF,
- final NetworkTaskFactory createViewTaskFactory)
{
- this.loadNetworkFileTF = loadNetworkFileTF;
- this.createViewTaskFactory = createViewTaskFactory;
- this.url = url;
- }
-
- @Override
- public void run(TaskMonitor taskMonitor) throws Exception {
- taskMonitor.setTitle("Loading network...");
- taskMonitor.setStatusMessage("Loading network. Please
wait...");
- taskMonitor.setProgress(0.01d);
-
- final Set<CyNetwork> networks =
this.loadNetworkFileTF.loadCyNetworks(url);
- taskMonitor.setProgress(1.0d);
- /*
- if (networks.size() != 0) {
- taskMonitor.setTitle("Creating View for the new
network");
- CyNetwork network = networks.iterator().next();
- final int numGraphObjects =
network.getNodeCount() + network.getEdgeCount();
- if (numGraphObjects >= viewThreshold) {
- // Force to create view.
-
createViewTaskFactory.setNetwork(network);
- taskMonitor.setStatusMessage("Loading
done. Creating view for the network...");
-
insertTasksAfterCurrentTask(createViewTaskFactory.createTaskIterator());
- }
- }
- */
- }
-
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- try {
- loadNetwork();
- } catch (Exception ex) {
- logger.error("Could not load network.", ex);
- }
- }
-
- /**
- * Due to its dependency, we need to import this service dynamically.
- *
- * @throws InvalidSyntaxException
- */
- private void execute(BundleContext bc) throws InvalidSyntaxException {
- final ServiceReference[] actions =
bc.getAllServiceReferences("org.cytoscape.application.swing.CyAction",
-
"(id=showImportNetworkFromWebServiceDialogAction)");
- if (actions == null || actions.length != 1) {
- logger.error("Could not find action");
- return;
- }
-
- final ServiceReference ref = actions[0];
- final CyAction action = (CyAction) bc.getService(ref);
- action.actionPerformed(null);
- }
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTask.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTask.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTask.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,151 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import javax.swing.JComboBox;
-
-import org.cytoscape.work.AbstractTask;
-import org.cytoscape.work.TaskMonitor;
-
-public class DownloadBiogridDataTask extends AbstractTask {
-
- private static final String DEF_URL =
"http://thebiogrid.org/downloads/archives/Release%20Archive/BIOGRID-3.1.81/BIOGRID-ORGANISM-3.1.81.mitab.zip";
-
- public final static int BUF_SIZE = 1024;
- private static final String LOCAL = "biogrid";
- private URL source;
- private File localFile;
-
- private JComboBox fileList;
-
- private static final Map<String, String> FILTER = new HashMap<String,
String>();
- private final Map<String, URL> sourceMap;
-
- static {
- FILTER.put("Homo_sapiens", "BioGRID: Human Interactome");
- FILTER.put("Saccharomyces_cerevisiae", "BioGRID: Yeast
Interactome");
- FILTER.put("Drosophila_melanogaster", "BioGRID: Fly
Interactome");
- FILTER.put("Mus_musculus", "BioGRID: Mouse Interactome");
- }
-
- public DownloadBiogridDataTask(final File settingFileLocation,
JComboBox fileList) {
- this.fileList = fileList;
- fileList.addItem("Preparing files. Please wait...");
- fileList.setEnabled(false);
- sourceMap = new HashMap<String, URL>();
-
- localFile = new File(settingFileLocation, LOCAL);
- if (localFile.exists() == false)
- localFile.mkdir();
- }
-
- private boolean isUp2Date() {
-
- final String[] listOfFiles = localFile.list();
-
- if (listOfFiles.length != 0)
- return true;
- else
- return false;
- }
-
- @Override
- public void run(TaskMonitor taskMonitor) throws Exception {
-
- if (isUp2Date() == false) {
- source = new URL(DEF_URL);
- download();
- } else {
- File[] files = localFile.listFiles();
- for (File file : files) {
- String name = file.getName();
- String fileName = createName(name);
- if (name.equals(fileName))
- continue;
- fileList.addItem(fileName);
- sourceMap.put(fileName, file.toURI().toURL());
-
- }
- }
-
- fileList.removeItemAt(0);
- fileList.setEnabled(true);
- taskMonitor.setProgress(1.0);
- }
-
- private void download() throws IOException {
- ZipInputStream zis = new ZipInputStream(source.openStream());
-
- try {
-
- // Extract list of entries
- ZipEntry zen = null;
- String entryName = null;
-
- while ((zen = zis.getNextEntry()) != null) {
- entryName = zen.getName();
- // Remove .txt
- String newName = entryName.replace(".txt", "");
- final String name = createName(newName);
- if (name.equals(newName))
- continue;
-
- File outFile = new File(localFile, newName);
- this.fileList.addItem(name);
-
- processOneEntry(outFile, zis);
- zis.closeEntry();
- this.sourceMap.put(name,
outFile.toURI().toURL());
- }
-
- } finally {
- if (zis != null)
- zis.close();
- zis = null;
- }
- }
-
- private void processOneEntry(File outFile, InputStream is) throws
IOException {
- outFile.createNewFile();
- FileWriter outWriter = new FileWriter(outFile);
- String line;
- final BufferedReader br = new BufferedReader(new
InputStreamReader(is));
-
- int count = 0;
- while ((line = br.readLine()) != null) {
- if (line.startsWith("#"))
- continue;
- outWriter.write(line + "\n");
- count++;
- }
- outWriter.close();
- }
-
- private String createName(String name) {
- for (String key : FILTER.keySet()) {
- if (name.contains(key)) {
- return FILTER.get(key);
- }
- }
-
- return name;
- }
-
- Map<String, URL> getSourceMap() {
- return this.sourceMap;
- }
-
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTaskFactory.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTaskFactory.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/DownloadBiogridDataTaskFactory.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,36 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Map;
-
-import javax.swing.JComboBox;
-
-import org.cytoscape.application.CyApplicationConfiguration;
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.work.TaskIterator;
-
-public class DownloadBiogridDataTaskFactory implements TaskFactory {
-
- private final JComboBox list;
-
- private DownloadBiogridDataTask task;
-
- private final File settingFile;
-
- DownloadBiogridDataTaskFactory(final JComboBox list, final
CyApplicationConfiguration config) {
- settingFile = config.getConfigurationDirectoryLocation();
- this.list = list;
- }
-
- @Override
- public TaskIterator createTaskIterator() {
- task = new DownloadBiogridDataTask(settingFile, list);
- return new TaskIterator(task);
- }
-
- Map<String, URL> getMap() {
- return task.getSourceMap();
- }
-
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/HelpPanel.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/HelpPanel.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/HelpPanel.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,99 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.GridLayout;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-
-import org.cytoscape.property.CyProperty;
-import org.cytoscape.util.swing.OpenBrowser;
-
-public class HelpPanel extends JPanel {
-
- private static final Font LABEL_FONT = new Font("SansSerif",
Font.PLAIN, 12);
- private static final Color LABEL_COLOR = new Color(0x40, 0x40, 0x40);
-
- private static final Color SELECTED_COLOR = new Color(0x63, 0xB8, 0xFF);
- private static final Font SELECTED_FONT = new Font("SansSerif",
Font.BOLD, 12);
-
-
- private JLabel about;
- private JLabel manual;
- private JLabel tutorial;
- private JLabel bugReport;
-
- private final List<JLabel> labelSet;
- private final Map<JLabel, String> urlMap;
-
- private final OpenBrowser openBrowserServiceRef;
- private final CyProperty<Properties> cyProps;
-
- HelpPanel(final OpenBrowser openBrowserServiceRef,
CyProperty<Properties> cyProps) {
- labelSet = new ArrayList<JLabel>();
- urlMap = new HashMap<JLabel, String>();
- this.openBrowserServiceRef = openBrowserServiceRef;
- this.cyProps = cyProps;
- initComponents();
- }
-
- private void initComponents() {
- this.setLayout(new GridLayout(4, 1));
- about = new JLabel(" About Cytoscape >>");
- manual = new JLabel(" User Documentation >>");
- tutorial = new JLabel(" Tutorials >>");
- bugReport = new JLabel(" Report a bug >>");
-
- // get Cytoscape version
- String cyversion =
this.cyProps.getProperties().getProperty("cytoscape.version.number");
-
- // get OS string
- String os_str = System.getProperty("os.name")+ "_"+
System.getProperty("os.version");
- os_str = os_str.replace(" ", "_");
-
- labelSet.add(about);
- labelSet.add(manual);
- labelSet.add(tutorial);
- labelSet.add(bugReport);
- urlMap.put(about,
"http://www.cytoscape.org/what_is_cytoscape.html");
- urlMap.put(manual,
"http://www.cytoscape.org/documentation_users.html");
- urlMap.put(tutorial,
"http://opentutorials.cgl.ucsf.edu/index.php/Portal:Cytoscape3");
- urlMap.put(bugReport,
"http://chianti.ucsd.edu/cyto_web/bugreport/bugreport.php?cyversion="+cyversion+"&os="+os_str);
-
- for(final JLabel label: labelSet) {
- label.setFont(LABEL_FONT);
- label.setForeground(LABEL_COLOR);
- label.setHorizontalAlignment(SwingConstants.LEFT);
- label.setHorizontalTextPosition(SwingConstants.LEFT);
- label.setOpaque(false);
- label.addMouseListener(new LabelMouseListener(label,
urlMap.get(label), this));
- add(label);
- }
- }
-
- private final class LabelMouseListener extends MouseAdapter {
-
- private final String url;
-
- LabelMouseListener(final JLabel label, final String url, final
JPanel parent) {
- this.url = url;
- }
-
- @Override
- public void mouseClicked(MouseEvent arg0) {
- openBrowserServiceRef.openURL(url);
- }
- }
-
-
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/LogoPanel.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/LogoPanel.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/LogoPanel.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,39 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.awt.BorderLayout;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-
-import javax.imageio.ImageIO;
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-
-public class LogoPanel extends JPanel {
-
- private static final String IMAGE_LOCATION = "images/logo.png";
- private BufferedImage bgImage;
-
- LogoPanel() {
-
-
- initComponents();
- }
-
- void initComponents() {
- try {
- bgImage =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource(IMAGE_LOCATION));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- this.setLayout(new BorderLayout());
- JLabel logo = new JLabel();
- logo.setIcon(new ImageIcon(bgImage));
- logo.setHorizontalAlignment(SwingConstants.CENTER);
-
- this.add(logo, BorderLayout.CENTER);
- }
-
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/OpenPanel.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/OpenPanel.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/OpenPanel.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,139 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.GridLayout;
-import java.awt.Window;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import javax.imageio.ImageIO;
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-import javax.swing.border.LineBorder;
-
-import org.cytoscape.io.util.RecentlyOpenedTracker;
-import org.cytoscape.session.CySession;
-import org.cytoscape.task.creation.LoadSession;
-import org.cytoscape.work.AbstractTask;
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.work.TaskIterator;
-import org.cytoscape.work.TaskManager;
-import org.cytoscape.work.TaskMonitor;
-
-public class OpenPanel extends JPanel {
-
- private static final Font FILE_NAME_FONT = new Font(Font.DIALOG,
Font.PLAIN, 12);
- private static final String ICON_LOCATION =
"/images/Icons/open_session.png";
- private BufferedImage openIconImg;
- private ImageIcon openIcon;
-
- private static final int MAX_FILES = 5;
-
- private JLabel open;
-
- private final RecentlyOpenedTracker fileTracker;
- private final TaskManager taskManager;
- private final TaskFactory openSessionTaskFactory;
-
- Window parent;
-
- OpenPanel(Window parent, final RecentlyOpenedTracker fileTracker, final
TaskManager taskManager,
- final TaskFactory openSessionTaskFactory) {
- this.fileTracker = fileTracker;
- this.parent = parent;
- this.taskManager = taskManager;
- this.openSessionTaskFactory = openSessionTaskFactory;
- initComponents();
- }
-
- private void initComponents() {
- try {
- openIconImg =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource(ICON_LOCATION));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- openIcon = new ImageIcon(openIconImg);
-
- final List<URL> recentFiles =
fileTracker.getRecentlyOpenedURLs();
- final int fileCount = recentFiles.size();
-
- this.setLayout(new GridLayout(MAX_FILES + 1, 1));
-
- final LineBorder padLine = new LineBorder(new Color(0, 0, 0,
0), 20, false);
-
- for (int i = 0; i < fileCount; i++) {
- final URL target = recentFiles.get(i);
- final JLabel fileLabel = new
JLabel(recentFiles.get(i).toString());
-
- fileLabel.setFont(FILE_NAME_FONT);
- fileLabel.setBorder(padLine);
- fileLabel.setHorizontalAlignment(SwingConstants.LEFT);
- fileLabel.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseClicked(MouseEvent e) {
- try {
- final File targetFile = new
File(target.toURI());
- taskManager.execute(new
TaskFactory() {
- @Override
- public TaskIterator
createTaskIterator() {
- return new
TaskIterator(new OpenSessionDirectTask(targetFile));
- }
- });
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- parent.dispose();
- }
- });
-
- this.add(fileLabel);
- }
- open = new JLabel("Open other...");
- open.setIcon(openIcon);
- open.setBorder(padLine);
- open.setHorizontalAlignment(SwingConstants.LEFT);
- open.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseClicked(MouseEvent e) {
- parent.dispose();
- taskManager.execute(openSessionTaskFactory);
- }
- });
-
- this.add(open);
- }
-
- private final class OpenSessionDirectTask extends AbstractTask {
-
- private final File file;
-
- OpenSessionDirectTask(final File file) {
- this.file = file;
- }
-
- @Override
- public void run(TaskMonitor taskMonitor) throws Exception {
- if(openSessionTaskFactory instanceof LoadSession) {
- taskMonitor.setTitle("Opening Session File");
- taskMonitor.setProgress(0.1d);
- taskMonitor.setStatusMessage("Opening session
file. Please wait...");
- LoadSession loadSession = (LoadSession)
openSessionTaskFactory;
- CySession session =
loadSession.loadSession(file);
- taskMonitor.setProgress(1.0d);
- }
- }
-
- }
-}
Deleted:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/WelcomeScreenDialog.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/WelcomeScreenDialog.java
2012-02-22 19:48:27 UTC (rev 28336)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/welcomescreen/WelcomeScreenDialog.java
2012-02-22 19:50:29 UTC (rev 28337)
@@ -1,218 +0,0 @@
-package org.cytoscape.internal.actions.welcomescreen;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.util.Properties;
-
-import javax.imageio.ImageIO;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.LineBorder;
-
-import org.cytoscape.application.CyApplicationConfiguration;
-import org.cytoscape.datasource.DataSourceManager;
-import org.cytoscape.internal.actions.WelcomeScreenAction;
-import org.cytoscape.io.util.RecentlyOpenedTracker;
-import org.cytoscape.property.CyProperty;
-import org.cytoscape.task.NetworkTaskFactory;
-import org.cytoscape.task.creation.ImportNetworksTaskFactory;
-import org.cytoscape.util.swing.OpenBrowser;
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.work.TaskManager;
-import org.osgi.framework.BundleContext;
-
-public class WelcomeScreenDialog extends JDialog {
- private static final long serialVersionUID = -2783045197802550425L;
-
- private static final String TITLE = "Welcome to Cytoscape 3";
-
- private static final Color PANEL_COLOR = new Color(0xff, 0xff, 0xff,
220);
- private static final Color LABEL_COLOR = new Color(0xa0, 0xa0, 0xa0,
230);
- private static final Color TRANSPARENT_COLOR = new Color(0xc0, 0xc0,
0xc0, 0);
-
- private static final Font TITLE_FONT = new Font("SansSerif",
Font.PLAIN, 14);
-
- private static final String IMAGE_LOCATION = "images/background.png";
- private BufferedImage bgImage;
-
- private static final Dimension DEF_SIZE = new Dimension(600, 500);
-
- private BackgroundImagePanel basePanel;
- private JPanel mainPanel;
-
- private final OpenBrowser openBrowserServiceRef;
- private final RecentlyOpenedTracker fileTracker;
- private final TaskFactory openSessionTaskFactory;
-
- private final TaskManager guiTaskManager;
-
- private final CyApplicationConfiguration config;
- private final ImportNetworksTaskFactory loadNetworkTF;
- private final NetworkTaskFactory networkTaskFactory;
-
- private final DataSourceManager dsManager;
-
- private final CyProperty<Properties> cyProps;
-
- private final TaskFactory importNetworkFileTF;
- private final BundleContext bc;
-
- final JCheckBox checkBox = new JCheckBox();
-
- public WelcomeScreenDialog(final BundleContext bc, OpenBrowser
openBrowserServiceRef, RecentlyOpenedTracker fileTracker, final TaskFactory
openSessionTaskFactory,
- TaskManager guiTaskManager, final
CyApplicationConfiguration config,
- final TaskFactory importNetworkFileTF, final
ImportNetworksTaskFactory importNetworkTF, final NetworkTaskFactory
networkTaskFactory,
- final DataSourceManager dsManager, final
CyProperty<Properties> cyProps, final boolean hide) {
- this.openBrowserServiceRef = openBrowserServiceRef;
- this.fileTracker = fileTracker;
- this.config = config;
- this.loadNetworkTF = importNetworkTF;
- this.networkTaskFactory = networkTaskFactory;
- this.dsManager = dsManager;
- this.openSessionTaskFactory = openSessionTaskFactory;
- this.importNetworkFileTF = importNetworkFileTF;
- this.bc = bc;
-
- this.guiTaskManager = guiTaskManager;
- this.cyProps = cyProps;
-
- initComponents();
-
- this.setTitle(TITLE);
-
- this.setSize(DEF_SIZE);
- this.setPreferredSize(DEF_SIZE);
- this.setMinimumSize(DEF_SIZE);
- this.setMaximumSize(DEF_SIZE);
- this.setResizable(false);
- this.setModal(true);
-
this.setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
- this.setAlwaysOnTop(true);
-
- checkBox.setSelected(hide);
- }
-
- public boolean getHideStatus() {
- return checkBox.isSelected();
- }
-
- private void initComponents() {
-
- try {
- bgImage =
ImageIO.read(WelcomeScreenDialog.class.getClassLoader().getResource(IMAGE_LOCATION));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- basePanel = new BackgroundImagePanel(bgImage);
- basePanel.setBackground(new Color(0xaa, 0xaa, 0xaa, 30));
- basePanel.setLayout(new BorderLayout());
-
- mainPanel = new JPanel();
- mainPanel.setSize(DEF_SIZE);
- mainPanel.setLayout(new GridLayout(2, 2));
- mainPanel.setOpaque(false);
-
- basePanel.add(mainPanel, BorderLayout.CENTER);
-
- final JPanel bottomPanel = new JPanel();
- bottomPanel.setLayout(new BorderLayout());
- bottomPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
- bottomPanel.setBackground(PANEL_COLOR);
-
- checkBox.setText("Don't show again");
- checkBox.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent ae) {
-
cyProps.getProperties().setProperty(WelcomeScreenAction.DO_NOT_DISPLAY_PROP_NAME,
((Boolean)checkBox.isSelected()).toString());
- }
- });
-
- JButton closeButton = new JButton("Close");
- closeButton.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- });
- bottomPanel.add(checkBox, BorderLayout.CENTER);
- bottomPanel.add(closeButton, BorderLayout.EAST);
- checkBox.setHorizontalAlignment(SwingConstants.CENTER);
- basePanel.add(bottomPanel, BorderLayout.SOUTH);
-
- this.add(basePanel);
- createChildPanels();
-
- pack();
- }
-
- private void createChildPanels() {
- JPanel panel1 = new JPanel();
- JPanel panel2 = new JPanel();
- JPanel panel3 = new JPanel();
- JPanel panel4 = new JPanel();
-
- panel1.setOpaque(false);
- panel2.setOpaque(false);
- panel3.setOpaque(false);
- panel4.setOpaque(false);
-
- Color borderPaint = new Color(0xff, 0xff, 0xff, 50);
- final LineBorder border = new LineBorder(borderPaint, 10,
false);
- panel1.setBorder(border);
- panel2.setBorder(border);
- panel3.setBorder(border);
- panel4.setBorder(border);
-
- panel1.setBackground(PANEL_COLOR);
- panel2.setBackground(PANEL_COLOR);
- panel3.setBackground(PANEL_COLOR);
- panel4.setBackground(PANEL_COLOR);
-
- buildHelpPanel(panel1, new OpenPanel(this, fileTracker,
guiTaskManager, openSessionTaskFactory),
- "Open a Recent Session");
- buildHelpPanel(panel2,
- new CreateNewNetworkPanel(this, bc,
guiTaskManager, importNetworkFileTF, loadNetworkTF, networkTaskFactory,
- config, dsManager,
cyProps.getProperties()),
- "Create New Network");
- buildHelpPanel(panel3, new HelpPanel(openBrowserServiceRef,
cyProps), "Help");
- buildHelpPanel(panel4, new LogoPanel(), "Latest News");
-
- mainPanel.setBorder(border);
-
- mainPanel.add(panel1);
- mainPanel.add(panel2);
- mainPanel.add(panel3);
- mainPanel.add(panel4);
- }
-
- private void buildHelpPanel(JPanel panel, JPanel contentPanel, final
String label) {
- JPanel titlePanel = new JPanel();
- contentPanel.setBackground(PANEL_COLOR);
-
- titlePanel.setLayout(new GridLayout(1, 2));
- titlePanel.setBackground(LABEL_COLOR);
- panel.setLayout(new BorderLayout());
-
- final JLabel title = new JLabel();
- title.setFont(TITLE_FONT);
- title.setText(label);
- title.setForeground(Color.DARK_GRAY);
- title.setBorder(new LineBorder(TRANSPARENT_COLOR, 8, false));
- titlePanel.add(title);
- panel.add(titlePanel, BorderLayout.NORTH);
- panel.add(contentPanel, BorderLayout.CENTER);
- }
-}
--
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.