[MOBY-guts] biomoby commit
Martin Senger
senger at pub.open-bio.org
Sun Sep 25 09:07:22 UTC 2005
senger
Sun Sep 25 05:07:22 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard
In directory pub.open-bio.org:/tmp/cvs-serv11299/src/main/org/biomoby/service/dashboard
Modified Files:
NOTES RegistryModel.java RegistryPanel.java
Log Message:
moby-live/Java/src/main/org/biomoby/service/dashboard NOTES,1.6,1.7 RegistryModel.java,1.2,1.3 RegistryPanel.java,1.7,1.8
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/24 17:51:51 1.6
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/NOTES 2005/09/25 09:07:22 1.7
@@ -105,6 +105,24 @@
* general Console panel (save button; various renderes?)
* graphics to trees
+---
+To put this somewhere (a small "Memory panel" that can be add
+anywhere in time of debugging...):
+
+The heap is the area in memory in which objects are created.
+
+ // Get current size of heap in bytes
+ long heapSize = Runtime.getRuntime().totalMemory();
+
+ // Get maximum size of heap in bytes. The heap cannot grow beyond this size.
+ // Any attempt will result in an OutOfMemoryException.
+ long heapMaxSize = Runtime.getRuntime().maxMemory();
+
+ // Get amount of free memory within the heap in bytes. This size will increase
+ // after garbage collection and decrease as new objects are created.
+ long heapFreeSize = Runtime.getRuntime().freeMemory();
+
+---
TODO generally:
---------------
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.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/RegistryModel.java 2005/09/24 17:51:51 1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryModel.java 2005/09/25 09:07:22 1.3
@@ -19,6 +19,7 @@
import java.util.HashSet;
import java.util.Hashtable;
+import java.util.Comparator;
import java.util.regex.Pattern;
/**
@@ -61,6 +62,30 @@
initWorker();
MobyDataType[] dataTypes = worker.getDataTypes();
+ java.util.Arrays.sort (dataTypes);
+ return dataTypes;
+ }
+
+ /*********************************************************************
+ *
+ ********************************************************************/
+ public MobyDataType[] getDataTypesByAuthority()
+ throws MobyException {
+
+ if (worker == null)
+ initWorker();
+
+ MobyDataType[] dataTypes = worker.getDataTypes();
+ java.util.Arrays.sort
+ (dataTypes,
+ new Comparator() {
+ public int compare (Object o1, Object o2) {
+ String a1 = ((MobyDataType)o1).getAuthority();
+ String a2 = ((MobyDataType)o2).getAuthority();
+ return (a1).compareToIgnoreCase ((String)a2);
+ }
+ });
+
return dataTypes;
}
@@ -102,21 +127,6 @@
return found;
}
-
-// /*********************************************************************
-// *
-// ********************************************************************/
-// public MobyDataType[] getDataTypesByAuthority()
-// throws MobyException {
-
-// if (worker == null)
-// initWorker();
-
-// MobyDataType[] dataTypes = worker.getDataTypes();
-// java.util.Arrays.sort (dataTypes);
-// return dataTypes;
-// }
-
/*********************************************************************
*
********************************************************************/
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/24 17:51:51 1.7
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistryPanel.java 2005/09/25 09:07:22 1.8
@@ -301,35 +301,6 @@
/**************************************************************************
*
**************************************************************************/
-// 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");
@@ -398,7 +369,10 @@
final SwingWorker worker = new SwingWorker() {
public Object construct() {
try {
- dataTypes = registryModel.getDataTypesByNames();
+ if (sorted == SORTED_BY_AUTHORITY)
+ dataTypes = registryModel.getDataTypesByAuthority();
+ else
+ dataTypes = registryModel.getDataTypesByNames();
} catch (MobyException e) {
// TBD: what to do here?
System.err.println ("ERROR: " + e.getMessage());
More information about the MOBY-guts
mailing list