[MOBY-guts] biomoby commit

Martin Senger senger at pub.open-bio.org
Sun Sep 18 14:09:42 UTC 2005


senger
Sun Sep 18 10:09:42 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard
In directory pub.open-bio.org:/tmp/cvs-serv26273/src/main/org/biomoby/service/dashboard

Modified Files:
	AbstractPanel.java ConsolePanel.java Dashboard.java NOTES 
	RegistryPanel.java 
Log Message:


moby-live/Java/src/main/org/biomoby/service/dashboard AbstractPanel.java,1.4,1.5 ConsolePanel.java,1.2,1.3 Dashboard.java,1.2,1.3 NOTES,1.2,1.3 RegistryPanel.java,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java	2005/09/18 08:46:26	1.4
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/AbstractPanel.java	2005/09/18 14:09:42	1.5
@@ -81,6 +81,7 @@
     // something need to be done only once - keep it here
     protected Icon panelIcon;
     protected JComponent pComponent;
+    protected Icon confirmIcon;
 
     // re-use "style" components
     protected static final Insets BREATH_TOP = new Insets (10,0,0,0);
@@ -276,7 +277,10 @@
      * Return true if confirmation dialog passed.
      ********************************************************************/
     public boolean confirm (Object msg) {
-        return SwingUtils.confirm (this, msg, null);
+	if (confirmIcon == null)
+	    confirmIcon =
+		SwingUtils.createIcon ("images/confirmButton.gif", Dashboard.class);
+        return SwingUtils.confirm (this, msg, confirmIcon);
     }
 
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java	2005/09/18 08:46:26	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/ConsolePanel.java	2005/09/18 14:09:42	1.3
@@ -15,7 +15,6 @@
 import javax.swing.Icon;
 import javax.swing.JComponent;
 import javax.swing.JScrollPane;
-import javax.swing.JViewport;
 import javax.swing.JTextArea;
 import javax.swing.JPanel;
 import javax.swing.text.html.HTMLDocument;

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java	2005/09/18 08:46:26	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/Dashboard.java	2005/09/18 14:09:42	1.3
@@ -10,6 +10,7 @@
 
 import org.tulsoft.tools.gui.SwingUtils;
 import org.tulsoft.tools.gui.AwtUtils;
+import org.tulsoft.tools.gui.ProgressView;
 
 import org.apache.commons.discovery.tools.Service;
 
@@ -50,6 +51,7 @@
     private JComponent dashboard;
     private StatusBar statusBar;
     private DashboardHeader header;
+    public static boolean useLoadMonitor = true;
     protected JTabbedPane tabbedPane;
     protected DashboardPanel[] panels;
     protected static Properties dashboardProperties;
@@ -185,6 +187,11 @@
 	if (dashboard != null)
 	    return dashboard;
 
+	if (useLoadMonitor) {
+	    ProgressView.monitor = new ProgressView (panels.length);
+	    ProgressView.monitor.show ("Welcome to Biomoby Dashboard");
+	}
+
 	// create itself
 	JPanel p = new JPanel (new GridBagLayout(), true);
 
@@ -192,10 +199,16 @@
 	tabbedPane = new JTabbedPane();
 	tabbedPane.addChangeListener (this);
 	for (int i = 0; i < panels.length; i++) {
-	    tabbedPane.addTab (panels[i].getName(), panels[i].getIcon(), panels[i].getComponent());
+	    String name = panels[i].getName();
+	    if (useLoadMonitor)
+		ProgressView.monitor.setTextAndAdd ("Loading " + name + "...");
+	    tabbedPane.addTab (name, panels[i].getIcon(), panels[i].getComponent());
 	}
         statusBar = getStatusBar();
 
+	if (useLoadMonitor)
+	    ProgressView.monitor.destroy();
+
 	// put it all together
 	SwingUtils.addComponent (p, header,     0, 0, 1, 1, AbstractPanel.HORI, AbstractPanel.NWEST, 1.0, 0.0);
 	SwingUtils.addComponent (p, tabbedPane, 0, 1, 1, 1, AbstractPanel.BOTH, AbstractPanel.NWEST, 1.0, 1.0);
@@ -295,6 +308,8 @@
      *
      **************************************************************************/
     public static void main (String[] args) {
+	if (args.length > 0 && args[0].equals ("-nop"))
+	    Dashboard.useLoadMonitor = false;
 	new Dashboard().show();
     }
 

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES	2005/09/18 08:46:26	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES	2005/09/18 14:09:42	1.3
@@ -9,9 +9,7 @@
   * configure dashbard (add/remove dynamically panels)
   * configure user preferences
 
-* Registry panel:
-  - trees should be in panned blocks (user-resizable)
-
+* running from run-dashboard does not work
 
 Registry panel
 --------------

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java	2005/09/18 08:46:26	1.4
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java	2005/09/18 14:09:42	1.5
@@ -18,10 +18,14 @@
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JFileChooser;
+import javax.swing.JSplitPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
 import javax.swing.JComponent;
 import javax.swing.text.html.HTMLDocument;
 
 import java.awt.GridBagLayout;
+import java.awt.Font;
 
 import java.awt.event.KeyEvent;
 import java.awt.event.ActionEvent;
@@ -80,16 +84,38 @@
 	DataTypesTree dataTypesTree = new DataTypesTree();
 	NamespacesTree namespacesTree = new NamespacesTree();
 
+	JSplitPane split1 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT,
+					    servicesTree.scrollable(),
+					    dataTypesTree.scrollable());
+	split1.setResizeWeight (0.5);
+	split1.setContinuousLayout (true);
+	split1.setOneTouchExpandable (true);
+	JSplitPane split2 = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT,
+					    split1,
+					    namespacesTree.scrollable());
+	split2.setResizeWeight (0.7);
+	split2.setContinuousLayout (true);
+	split2.setOneTouchExpandable (true);
+
+	// console panel
+	JPanel console = getConsole();
+
+	JSplitPane split3 = new JSplitPane (JSplitPane.VERTICAL_SPLIT,
+					    split2,
+					    console);
+	split3.setResizeWeight (0.75);
+	split3.setContinuousLayout (true);
+	split3.setOneTouchExpandable (true);
+
+
 	// registry and cache locations
 	JPanel regLocation = getRegistryLocation();
 	JPanel cacheLocation = getCacheLocation();
 
 	// put all together
- 	SwingUtils.addComponent (pComponent, servicesTree.scrollable(),   0, 0, 1, 2, BOTH, NWEST, 0.25, 0.66);
- 	SwingUtils.addComponent (pComponent, dataTypesTree.scrollable(),  1, 0, 1, 2, BOTH, NWEST, 0.25, 0.66);
- 	SwingUtils.addComponent (pComponent, namespacesTree.scrollable(), 2, 0, 1, 2, BOTH, NWEST, 0.25, 0.66);
- 	SwingUtils.addComponent (pComponent, regLocation,                 3, 0, 1, 1, HORI, NWEST, 0.1, 0.0);
- 	SwingUtils.addComponent (pComponent, cacheLocation,               3, 1, 1, 1, HORI, NWEST, 0.1, 0.0);
+ 	SwingUtils.addComponent (pComponent, split3,                      0, 0, 1, 2, BOTH, NWEST, 1.0, 1.0);
+ 	SwingUtils.addComponent (pComponent, regLocation,                 1, 0, 1, 1, HORI, NWEST, 0.0, 0.0);
+ 	SwingUtils.addComponent (pComponent, cacheLocation,               1, 1, 1, 1, HORI, NWEST, 0.0, 0.0);
 
 	return pComponent;
     }
@@ -235,6 +261,35 @@
     /**************************************************************************
      *
      **************************************************************************/
+    protected JPanel getConsole() {
+	JPanel p = new JPanel (new GridBagLayout());
+
+        JTextArea textArea = new JTextArea();
+        textArea.setFont (new Font ("Courier", Font.PLAIN, 10));
+	textArea.setEditable (false);
+	JScrollPane scroller = new JScrollPane (textArea);
+
+// 	JButton cleanButton =
+// 	    createButton (" Clean ",
+// 			  "Remove all messages from the console area",
+// 			  KeyEvent.VK_C,
+// 			  new ActionListener() {
+// 			      public void actionPerformed (ActionEvent e) {
+// 				  if (! "".equals (textArea.getText()) && confirm ("Remove all messages?"))
+// 				      textArea.setText ("");
+// 			      }
+// 			  });
+
+	// put it together
+ 	SwingUtils.addComponent (p, scroller,    0, 0, 1, 1, BOTH, NWEST, 1.0, 1.0);
+//  	SwingUtils.addComponent (p, cleanButton, 0, 1, 1, 1, NONE, NWEST, 0.0, 0.0);
+
+	return p;
+    }
+
+    /**************************************************************************
+     *
+     **************************************************************************/
     class ServicesTree extends CommonTree {
 	public ServicesTree() {
 	    super ("Services");




More information about the MOBY-guts mailing list