Author: mes
Date: 2009-08-05 11:57:03 -0700 (Wed, 05 Aug 2009)
New Revision: 17695
Added:
cytoscape3/trunk/application/src/main/java/cytoscape/dialogs/
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogFactoryImpl.java
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogImpl.java
Log:
added about dialog back
Copied: cytoscape3/trunk/application/src/main/java/cytoscape/dialogs (from rev
17590, cytoscape3/trunk/application/src/main/java/cytoscape/dialogs)
Copied:
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogFactoryImpl.java
(from rev 17590,
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogFactoryImpl.java)
===================================================================
---
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogFactoryImpl.java
(rev 0)
+++
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogFactoryImpl.java
2009-08-05 18:57:03 UTC (rev 17695)
@@ -0,0 +1,60 @@
+
+/*
+ Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ 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 2.1 of the License, or
+ 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. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package cytoscape.internal.dialogs;
+
+import java.awt.Window;
+
+import cytoscape.util.OpenBrowser;
+import cytoscape.dialogs.AboutDialog;
+import cytoscape.dialogs.AboutDialogFactory;
+
+/**
+ */
+public class AboutDialogFactoryImpl implements AboutDialogFactory {
+
+ private OpenBrowser ob;
+
+ public AboutDialogFactoryImpl(OpenBrowser ob) {
+ if ( ob == null )
+ throw new NullPointerException("open browser class is
null!");
+ else
+ this.ob = ob;
+ }
+
+ public AboutDialog getAboutDialog(Window parent, boolean modal) {
+ return new AboutDialogImpl(parent,modal,ob);
+ }
+}
Copied:
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogImpl.java
(from rev 17590,
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogImpl.java)
===================================================================
---
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogImpl.java
(rev 0)
+++
cytoscape3/trunk/application/src/main/java/cytoscape/internal/dialogs/AboutDialogImpl.java
2009-08-05 18:57:03 UTC (rev 17695)
@@ -0,0 +1,234 @@
+/*
+ Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ 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 2.1 of the License, or
+ 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. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package cytoscape.internal.dialogs;
+
+import java.awt.Component;
+import java.awt.Window;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.swing.Icon;
+import javax.swing.JEditorPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+
+import cytoscape.util.OpenBrowser;
+
+import cytoscape.dialogs.AboutDialog;
+
+
+/**
+ * About page for web service clients or other plugins.
+ * Accepts HTML as the argument.
+ *
+ * @author kono
+ */
+class AboutDialogImpl extends javax.swing.JDialog implements AboutDialog {
+ private final static long serialVersionUID = 1213748837120927L;
+
+ private OpenBrowser openBrowser;
+ // Show method with full parameter set.
+ /**
+ * DOCUMENT ME!
+ *
+ * @param title DOCUMENT ME!
+ * @param icon DOCUMENT ME!
+ * @param description DOCUMENT ME!
+ */
+ public void showDialog(String title, Icon icon, String description) {
+ titleLabel.setText(title);
+ titleLabel.setIcon(icon);
+
+ URL target = null;
+ mainEditorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES,
+ Boolean.TRUE);
+ try {
+ target = new URL(description);
+ } catch (MalformedURLException e) {
+ mainEditorPane.setContentType("text/html");
+ mainEditorPane.setText(description);
+ repaint();
+ setVisible(true);
+ return;
+ }
+
+ try {
+ mainEditorPane.setPage(target);
+ pack();
+ repaint();
+ setVisible(true);
+ } catch (IOException e) {
+ mainEditorPane.setText("Could not connect to " +
target.toString());
+ e.printStackTrace();
+ pack();
+ repaint();
+ setVisible(true);
+ }
+ }
+
+ /** Creates new form WSAboutDialog */
+ public AboutDialogImpl(Window parent, boolean modal, OpenBrowser ob) {
+ // TODO: This is supported only in Java 6...
+ //super(parent, modal);
+ super();
+ this.setModal(modal);
+ this.openBrowser = ob;
+ initComponents();
+ mainEditorPane.setEditable(false);
+ mainEditorPane.addHyperlinkListener(this);
+ setLocationRelativeTo(parent);
+ setAlwaysOnTop(true);
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">
+ private void initComponents() {
+ titlePanel = new javax.swing.JPanel();
+ titleLabel = new javax.swing.JLabel();
+ mainPanel = new javax.swing.JPanel();
+ mainScrollPane = new javax.swing.JScrollPane();
+ mainEditorPane = new javax.swing.JEditorPane();
+
+
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setTitle("About");
+ setAlwaysOnTop(true);
+
+ titlePanel.setBackground(new java.awt.Color(255, 255, 255));
+
+ titleLabel.setFont(new java.awt.Font("SansSerif", 0, 18));
+ titleLabel.setText("Client Name Here");
+
+ org.jdesktop.layout.GroupLayout titlePanelLayout = new
org.jdesktop.layout.GroupLayout(titlePanel);
+ titlePanel.setLayout(titlePanelLayout);
+
titlePanelLayout.setHorizontalGroup(titlePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+
.add(titlePanelLayout.createSequentialGroup()
+
.addContainerGap()
+
.add(titleLabel,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
339,
+
Short.MAX_VALUE)
+
.addContainerGap()));
+
titlePanelLayout.setVerticalGroup(titlePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+
.add(titlePanelLayout.createSequentialGroup()
+
.addContainerGap()
+
.add(titleLabel,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
32,
+
Short.MAX_VALUE)
+
.addContainerGap()));
+
+ mainPanel.setBackground(new java.awt.Color(255, 255, 255));
+
+
mainScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ mainScrollPane.setFont(new java.awt.Font("SansSerif", 0, 12));
+
+ mainEditorPane.setEditable(false);
+ mainScrollPane.setViewportView(mainEditorPane);
+
+ org.jdesktop.layout.GroupLayout mainPanelLayout = new
org.jdesktop.layout.GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
mainPanelLayout.setHorizontalGroup(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+
.add(mainPanelLayout.createSequentialGroup()
+
.addContainerGap()
+
.add(mainScrollPane)
+
.addContainerGap()));
+
mainPanelLayout.setVerticalGroup(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+
.add(mainPanelLayout.createSequentialGroup()
+
.addContainerGap()
+
.add(mainScrollPane,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
215,
+
Short.MAX_VALUE)
+
.addContainerGap()));
+
+ org.jdesktop.layout.GroupLayout layout = new
org.jdesktop.layout.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+
layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(titlePanel,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+
.add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanel,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE));
+
layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+
.add(layout.createSequentialGroup()
+ .add(titlePanel,
+
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(mainPanel,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+
Short.MAX_VALUE)));
+
+ pack();
+ } // </editor-fold>
+
+ // Variables declaration - do not modify
+ private javax.swing.JEditorPane mainEditorPane;
+ private javax.swing.JScrollPane mainScrollPane;
+ private javax.swing.JLabel titleLabel;
+ private javax.swing.JPanel titlePanel;
+ private javax.swing.JPanel mainPanel;
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param e DOCUMENT ME!
+ */
+ public void hyperlinkUpdate(HyperlinkEvent e) {
+ if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
+ return;
+
+ String url = e.getURL().toString();
+
+ try {
+ openBrowser.openURL(url);
+ } catch (Exception err) {
+ err.printStackTrace();
+ }
+ }
+
+ // End of variables declaration
+}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---