[MOBY-guts] biomoby commit

Martin Senger senger at pub.open-bio.org
Sat Nov 5 20:14:49 UTC 2005


senger
Sat Nov  5 15:14:49 EST 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard
In directory pub.open-bio.org:/tmp/cvs-serv1852/src/main/org/biomoby/service/dashboard

Modified Files:
	CommonTree.java RegistrationPanel.java RegistryPanel.java 
Log Message:


moby-live/Java/src/main/org/biomoby/service/dashboard CommonTree.java,1.12,1.13 RegistrationPanel.java,1.8,1.9 RegistryPanel.java,1.17,1.18
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java	2005/11/05 17:51:04	1.12
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/CommonTree.java	2005/11/05 20:14:49	1.13
@@ -243,16 +243,16 @@
 	    menuReloadIconDis = 
 		SwingUtils.createIcon ("images/smallReload_dis.gif", Dashboard.class);
 
-	if (smallNIcon    == null) smallNIcon    = loadIcon ("images/smallN.gif");
-	if (smallNIconDis == null) smallNIconDis = loadIcon ("images/smallN_dis.gif");
-	if (smallAIcon    == null) smallAIcon    = loadIcon ("images/smallA.gif");
-	if (smallAIconDis == null) smallAIconDis = loadIcon ("images/smallA_dis.gif");
-	if (smallTIcon    == null) smallTIcon    = loadIcon ("images/smallT.gif");
-	if (smallTIconDis == null) smallTIconDis = loadIcon ("images/smallT_dis.gif");
-	if (smallIIcon    == null) smallIIcon    = loadIcon ("images/smallI.gif");
-	if (smallIIconDis == null) smallIIconDis = loadIcon ("images/smallI_dis.gif");
-	if (smallOIcon    == null) smallOIcon    = loadIcon ("images/smallO.gif");
-	if (smallOIconDis == null) smallOIconDis = loadIcon ("images/smallO_dis.gif");
+	if (smallNIcon    == null) smallNIcon    = loadIcon ("images/smallSortAZ.gif");
+	if (smallNIconDis == null) smallNIconDis = loadIcon ("images/smallSortAZ_dis.gif");
+	if (smallAIcon    == null) smallAIcon    = loadIcon ("images/smallAuth.gif");
+	if (smallAIconDis == null) smallAIconDis = loadIcon ("images/smallAuth_dis.gif");
+	if (smallTIcon    == null) smallTIcon    = loadIcon ("images/smallInher.gif");
+	if (smallTIconDis == null) smallTIconDis = loadIcon ("images/smallInher_dis.gif");
+	if (smallIIcon    == null) smallIIcon    = loadIcon ("images/smallImport.gif");
+	if (smallIIconDis == null) smallIIconDis = loadIcon ("images/smallImport_dis.gif");
+	if (smallOIcon    == null) smallOIcon    = loadIcon ("images/smallExport.gif");
+	if (smallOIconDis == null) smallOIconDis = loadIcon ("images/smallExport_dis.gif");
 
 	if (nsLeafIcon == null) nsLeafIcon = loadIcon ("images/small_yellow.gif");
 	if (stLeafIcon == null) stLeafIcon = loadIcon ("images/magentaDiamond.gif");

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java	2005/11/05 17:51:04	1.8
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationPanel.java	2005/11/05 20:14:49	1.9
@@ -190,15 +190,11 @@
 	if (menuAddHASIconDis == null)
 	    menuAddHASIconDis = loadIcon ("images/smallAddHAS_dis.gif");
 	
-	if (menuUnregisterIcon == null)
-	    menuUnregisterIcon = loadIcon ("images/smallUnregister.gif");
-	if (menuUnregisterIconDis == null)
-	    menuUnregisterIconDis = loadIcon ("images/smallUnregister_dis.gif");
-
-	if (registerIcon == null)
-	    registerIcon = loadIcon ("images/smallRegister.gif");
-	if (registerIconDis == null)
-	    registerIconDis = loadIcon ("images/smallRegister_dis.gif");
+	if (menuUnregisterIcon == null) menuUnregisterIcon = loadIcon ("images/smallTrash.gif");
+	if (menuUnregisterIconDis == null) menuUnregisterIconDis = loadIcon ("images/smallTrash_dis.gif");
+
+	if (registerIcon == null) registerIcon = loadIcon ("images/smallRegister.gif");
+	if (registerIconDis == null) registerIconDis = loadIcon ("images/smallRegister_dis.gif");
 
 	if (addDataIcon == null)
 	    addDataIcon = loadIcon ("images/smallAddData.gif");
@@ -697,6 +693,7 @@
 
 	    JComboBox comboBox = new JComboBox (comboModel);
 	    comboBox.setOpaque (true);
+	    createPopups ("Namespace Menu", comboBox);
 
 	    MobyPrimaryDataSimple simple = null;
 	    if (value instanceof MobyPrimaryDataSimple) {
@@ -2021,4 +2018,57 @@
 	}
     }
 
+
+
+
+    protected JPopupMenu popup;
+
+    /*********************************************************************
+     * Create a popup object with common items. Subclasses can (and
+     * usually do) add more items, or re-created the whole popup. <p>
+     *
+     * @param title is given to the popups
+     ********************************************************************/
+    protected void createPopups (String title, JComponent component) {
+	System.out.println ("POPUP");
+	popup = new JPopupMenu (title);
+	popup.add
+	    (CommonTree.createMenuItem (new AbstractAction ("Remove") {
+		    public void actionPerformed (ActionEvent e) {
+		    }
+		}, "R", trashIcon, trashIcon));
+
+	// add listener to this tree to bring up popup menus
+	MouseListener popupListener = new PopupListener();
+	component.addMouseListener (popupListener);
+    }
+
+    class PopupListener extends MouseAdapter {
+	public void mousePressed (MouseEvent e) {
+	    maybeShowPopup (e);
+	}
+	public void mouseReleased (MouseEvent e) {
+	    maybeShowPopup (e);
+	}
+	private void maybeShowPopup (MouseEvent e) {
+	    System.out.println ("ME: " + e);
+	    if (e.isPopupTrigger() && popup.isEnabled()) {
+		popup.show (e.getComponent(),
+			e.getX(), e.getY());
+	    }
+	}
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java	2005/11/05 17:51:04	1.17
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java	2005/11/05 20:14:49	1.18
@@ -82,7 +82,9 @@
     CommonConsole console;
 
     // shared icons
-    protected static Icon infoIcon, infoIconDis;
+    protected static Icon defaultsIcon;
+    protected static Icon reloadIcon;
+    protected static Icon infoIcon, updateIcon, eraseIcon;
 
     /*********************************************************************
      * Default constructor.
@@ -96,7 +98,11 @@
      ********************************************************************/
     protected void loadIcons() {
 	super.loadIcons();
-	if (infoIcon    == null) infoIcon = loadIcon ("images/smallInfo.gif");
+	if (defaultsIcon == null) defaultsIcon = loadIcon ("images/smallUndo.gif");
+	if (reloadIcon == null) reloadIcon = loadIcon ("images/smallReload.gif");
+	if (infoIcon == null) infoIcon = loadIcon ("images/smallInfo.gif");
+	if (updateIcon == null) updateIcon = loadIcon ("images/smallSynch.gif");
+	if (eraseIcon == null) eraseIcon = loadIcon ("images/smallTrash.gif");
     }
 	
     /**************************************************************************
@@ -247,6 +253,7 @@
 				  onReloadAll();
 			      }
 			  });
+	reloadAllButton.setIcon (reloadIcon);
 	JButton defaultsButton =
 	    createButton (" Restore defaults ",
 			  "Fill the text fields above with the default values",
@@ -256,6 +263,8 @@
 				  onDefaults();
 			      }
 			  });
+	defaultsButton.setIcon (defaultsIcon);
+
 	JPanel buttonPanel = createButtonPanel (new JButton[] { reloadAllButton,
 								defaultsButton });
 	JPanel rLocation = createTitledPanel ("Biomoby registry location");
@@ -300,7 +309,7 @@
 				  onCacheInfo();
 			      }
 			  });
-// 	infoButton.setIcon (infoIcon);
+ 	infoButton.setIcon (infoIcon);
 
 	JButton updateButton =
 	    createButton (" Update ",
@@ -311,6 +320,7 @@
 				  onCacheUpdate();
 			      }
 			  });
+	updateButton.setIcon (updateIcon);
 	JButton eraseButton =
 	    createButton (" Erase ",
 			  "Remove everything from the local cache",
@@ -320,6 +330,7 @@
 				  onCacheErase();
 			      }
 			  });
+	eraseButton.setIcon (eraseIcon);
 	JPanel buttonPanel = createButtonPanel (new JButton[] { infoButton,
 								updateButton,
 								eraseButton });




More information about the MOBY-guts mailing list