Author: laylaoesper
Date: 2010-09-19 14:06:14 -0700 (Sun, 19 Sep 2010)
New Revision: 21945
Added:
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/AboutPanel.java
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/ShowAboutPanelAction.java
Modified:
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/jars/WordCloud.jar
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryInputPanel.java
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryPlugin.java
Log:
Adding about panel.
Modified:
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/jars/WordCloud.jar
===================================================================
(Binary files differ)
Added:
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/AboutPanel.java
===================================================================
---
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/AboutPanel.java
(rev 0)
+++
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/AboutPanel.java
2010-09-19 21:06:14 UTC (rev 21945)
@@ -0,0 +1,94 @@
+/*
+ File: AboutPanel.java
+
+ Copyright 2010 - The Cytoscape Consortium (www.cytoscape.org)
+
+ Code written by: Layla Oesper
+ Authors: Layla Oesper, Ruth Isserlin, Daniele Merico
+
+ This library is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this project. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package cytoscape.csplugins.wordcloud;
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.HTMLEditorKit;
+import cytoscape.*;
+
+/**
+ * This class handles about WordCloud popup from the WordCloud menu.
+ * @version 1.0
+ */
+
+public class AboutPanel extends JDialog {
+
+ private static final long serialVersionUID = 5805773796102997091L;
+
+ String pluginUrl = "http://www.baderlab.org/GSoC2010";
+
+ public AboutPanel() {
+ super(Cytoscape.getDesktop(), "About WordCloud", false);
+ setResizable(false);
+
+ //main panel for dialog box
+ JEditorPane editorPane = new JEditorPane();
+ editorPane.setMargin(new Insets(10,10,10,10));
+ editorPane.setEditable(false);
+ editorPane.setEditorKit(new HTMLEditorKit());
+ editorPane.addHyperlinkListener(new HyperlinkAction(editorPane));
+
+ editorPane.setText(
+ "<html><body>"+
+ "<table border='0'><tr>" +
+ "<td width='125'></td>"+
+ "<td width='200'>"+
+ "<p align=center><b>WordCloud"+ "</b><BR>" +
+ "A Cytoscape Plugin<BR>" +
+ "<BR></p>" +
+ "</td>"+
+ "<td width='125'><div align='right'>" + //<img height='77'
width='125' src=\""+
+ //"\" ></div></td>"+
+ "</tr></table>" +
+ "<p align=center>WordCloud is a Cytoscape plugin that
generates a word tag cloud<BR>"+
+ "from a user-define node selection, summarizing an attribute
of choice.<BR>" +
+ "<BR>" +
+ "by Layla Oesper, Daniele Merico, Ruth Isserlin and Gary
Bader<BR>" +
+ "(<a href='http://www.baderlab.org/'>Bader Lab</a>, University
of Toronto)<BR>" +
+ "<BR>" +
+ "Plugin Homepage:<BR>" +
+ "<a href='" + pluginUrl + "'>" + pluginUrl + "</a><BR>" +
+ "<BR>" +
+ "<font size='-1'>" + "</font>" +
+ "</p></body></html>"
+ );
+ setContentPane(editorPane);
+ }
+
+ private class HyperlinkAction implements HyperlinkListener {
+ @SuppressWarnings("unused")
+ JEditorPane pane;
+
+ public HyperlinkAction(JEditorPane pane) {
+ this.pane = pane;
+ }
+
+ public void hyperlinkUpdate(HyperlinkEvent event) {
+ if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+ cytoscape.util.OpenBrowser.openURL(event.getURL().toString());
+ }
+ }
+ }
+}
Modified:
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryInputPanel.java
===================================================================
---
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryInputPanel.java
2010-09-19 19:38:13 UTC (rev 21944)
+++
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryInputPanel.java
2010-09-19 21:06:14 UTC (rev 21945)
@@ -263,9 +263,9 @@
collapsiblePanel.getContentPane().add(panel,
BorderLayout.NORTH);
//Network Level Panel
- CollapsiblePanel collapsiblePanel2 = new
CollapsiblePanel("Network Parameters");
+ CollapsiblePanel collapsiblePanel2 = new CollapsiblePanel("Text
Processing Parameters");
collapsiblePanel2.setCollapsed(false);
-
collapsiblePanel2.getTitleComponent().setToolTipText("Parameters that will be
applied to all clouds created from the current network");
+ collapsiblePanel2.getTitleComponent().setToolTipText("Text
processing parameters that will be applied to all clouds created from the
current network");
JPanel networkPanel = new JPanel();
networkPanel.setLayout(new BoxLayout(networkPanel,
BoxLayout.Y_AXIS));
@@ -391,7 +391,7 @@
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
//Max words input
- JLabel maxWordsLabel = new JLabel("Max Num of Words");
+ JLabel maxWordsLabel = new JLabel("Max Number of Words");
maxWordsTextField = new JFormattedTextField(intFormat);
maxWordsTextField.setColumns(10);
maxWordsTextField.setValue(params.getDefaultMaxWords()); //Set
to default initially
Modified:
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryPlugin.java
===================================================================
---
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryPlugin.java
2010-09-19 19:38:13 UTC (rev 21944)
+++
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/SemanticSummaryPlugin.java
2010-09-19 21:06:14 UTC (rev 21945)
@@ -24,10 +24,14 @@
import java.io.BufferedWriter;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Properties;
import java.util.Set;
@@ -61,15 +65,19 @@
public SemanticSummaryPlugin()
{
+
//New actions for response to menu selections
SemanticSummaryPluginAction settings = new
SemanticSummaryPluginAction();
CreateCloudAction create = new CreateCloudAction();
+ ShowAboutPanelAction about = new ShowAboutPanelAction();
create.setPreferredMenu("Plugins.WordCloud");
settings.setPreferredMenu("Plugins.WordCloud");
+ about.setPreferredMenu("Plugins.WordCloud");
//Add to Plugin Menu
Cytoscape.getDesktop().getCyMenus().addAction(create);
Cytoscape.getDesktop().getCyMenus().addAction(settings);
+ Cytoscape.getDesktop().getCyMenus().addAction(about);
//Add to right click menus
@@ -467,4 +475,24 @@
}//end restore session method
+ /**
+ *
+ * @param propFileName
+ * @return
+ * @throws IOException
+ */
+ private Properties getPropertiesFromClasspath(String propFileName)
throws IOException {
+ // loading properties file from the classpath
+ Properties props = new Properties();
+ InputStream inputStream =
this.getClass().getClassLoader().getResourceAsStream(propFileName);
+
+ if (inputStream == null) {
+ throw new FileNotFoundException("property file '" + propFileName
+ + "' not found in the classpath");
+ }
+
+ props.load(inputStream);
+ return props;
+ }
+
}
Added:
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/ShowAboutPanelAction.java
===================================================================
---
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/ShowAboutPanelAction.java
(rev 0)
+++
csplugins/trunk/soc/layla/WordCloudPlugin/trunk/WordCloud/src/cytoscape/csplugins/wordcloud/ShowAboutPanelAction.java
2010-09-19 21:06:14 UTC (rev 21945)
@@ -0,0 +1,47 @@
+/*
+ File: ShowAboutPanelAction.java
+
+ Copyright 2010 - The Cytoscape Consortium (www.cytoscape.org)
+
+ Code written by: Layla Oesper
+ Authors: Layla Oesper, Ruth Isserlin, Daniele Merico
+
+ This library is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this project. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package cytoscape.csplugins.wordcloud;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.JFrame;
+
+import cytoscape.Cytoscape;
+import cytoscape.util.CytoscapeAction;
+
+public class ShowAboutPanelAction extends CytoscapeAction
+{
+ public ShowAboutPanelAction()
+ {
+ super("About");
+ }
+
+ public void actionPerformed(ActionEvent event)
+ {
+ AboutPanel aboutPanel = new AboutPanel();
+ aboutPanel.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ aboutPanel.pack();
+ aboutPanel.setLocationRelativeTo(Cytoscape.getDesktop());
+ aboutPanel.setVisible(true);
+ }
+}
--
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.