[MOBY-guts] biomoby commit
Andreas Groscurth
groscurt at dev.open-bio.org
Mon Jan 5 08:47:04 UTC 2009
groscurt
Mon Jan 5 03:47:04 EST 2009
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard
In directory dev.open-bio.org:/tmp/cvs-serv24002/src/main/org/biomoby/service/dashboard
Modified Files:
RegistrationServiceTypeSubPanel.java
RegistrationNamespaceSubPanel.java
RegistrationDataTypeSubPanel.java
Log Message:
Added an unregistration button at the bar with the other buttons.
moby-live/Java/src/main/org/biomoby/service/dashboard RegistrationServiceTypeSubPanel.java,1.9,1.10 RegistrationNamespaceSubPanel.java,1.8,1.9 RegistrationDataTypeSubPanel.java,1.11,1.12
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationServiceTypeSubPanel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationServiceTypeSubPanel.java 2005/12/20 20:00:41 1.9
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationServiceTypeSubPanel.java 2009/01/05 08:47:04 1.10
@@ -15,6 +15,7 @@
import org.tulsoft.tools.gui.SwingUtils;
import org.tulsoft.tools.gui.JTextFieldWithHistory;
+import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JSplitPane;
@@ -24,6 +25,7 @@
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.GridBagLayout;
+import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
@@ -49,6 +51,8 @@
JTextFieldWithHistory stName, stAuth, stEmail;
JTextArea stDescArea;
JLabel stISA;
+ CustomServiceTypesTree serviceTypeTree;
+ JButton unregisButton;
/*********************************************************************
* Default constructor.
@@ -97,7 +101,7 @@
new ServiceTypesBoard (registryModel,
console,
propertyChannel,
- new CustomServiceTypesTree (registryModel, console));
+ serviceTypeTree = new CustomServiceTypesTree (registryModel, console));
serviceTypesBoard.updateTree (CommonTree.SORTED_BY_NAME);
// allow to copy selected service types to the new one
@@ -131,12 +135,25 @@
KeyEvent.VK_F,
REG_ST_FROM_XML,
createXMLChooser (REG_ST_FROM_XML));
+ unregisButton =
+ createButton (" Unregister Service Type ",
+ "Remove an existing service type from a Biomoby registry",
+ KeyEvent.VK_U,
+ new ActionListener() {
+ public void actionPerformed (ActionEvent e) {
+ serviceTypeTree.onUnregisterServiceType();
+ }
+ });
+ unregisButton.setIcon (unregisterIcon);
+ unregisButton.setDisabledIcon (unregisterIconDis);
+
// put it together
- SwingUtils.addComponent (p, split, 0, 0, 3, 1, BOTH, NWEST, 1.0, 1.0);
+ SwingUtils.addComponent (p, split, 0, 0, 4, 1, BOTH, NWEST, 1.0, 1.0);
SwingUtils.addComponent (p, registerButton, 0, 1, 1, 1, NONE, WEST, 0.0, 0.0);
SwingUtils.addComponent (p, showXMLButton, 1, 1, 1, 1, NONE, WEST, 0.0, 0.0);
SwingUtils.addComponent (p, fromXMLButton, 2, 1, 1, 1, NONE, WEST, 0.0, 0.0);
+ SwingUtils.addComponent (p, unregisButton, 3, 1, 1, 1, NONE, NEAST, 0.0, 0.0);
return p;
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationNamespaceSubPanel.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/RegistrationNamespaceSubPanel.java 2005/12/20 20:00:41 1.8
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationNamespaceSubPanel.java 2009/01/05 08:47:04 1.9
@@ -15,6 +15,8 @@
import org.tulsoft.tools.gui.SwingUtils;
import org.tulsoft.tools.gui.JTextFieldWithHistory;
+import javax.swing.Box;
+import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JSplitPane;
@@ -23,7 +25,9 @@
import javax.swing.JComponent;
import javax.swing.tree.DefaultMutableTreeNode;
+import java.awt.Component;
import java.awt.GridBagLayout;
+import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
@@ -46,6 +50,8 @@
// components that are used from more methods
JTextFieldWithHistory nsName, nsAuth, nsEmail;
JTextArea nsDescArea;
+ JButton unregisButton;
+ CustomNamespacesTree namespacesTree;
/*********************************************************************
* Default constructor.
@@ -90,7 +96,7 @@
new NamespacesBoard (registryModel,
console,
propertyChannel,
- new CustomNamespacesTree (registryModel, console));
+ namespacesTree = new CustomNamespacesTree (registryModel, console));
namespacesBoard.updateTree (CommonTree.SORTED_BY_NAME);
// allow to copy selected namespace to the new one
@@ -124,12 +130,24 @@
KeyEvent.VK_F,
REG_NS_FROM_XML,
createXMLChooser (REG_NS_FROM_XML));
+ unregisButton =
+ createButton (" Unregister Namespace ",
+ "Remove an existing namespace from a Biomoby registry",
+ KeyEvent.VK_U,
+ new ActionListener() {
+ public void actionPerformed (ActionEvent e) {
+ namespacesTree.onUnregisterNamespace();
+ }
+ });
+ unregisButton.setIcon (unregisterIcon);
+ unregisButton.setDisabledIcon (unregisterIconDis);
// put it together
- SwingUtils.addComponent (p, split, 0, 0, 3, 1, BOTH, NWEST, 1.0, 1.0);
+ SwingUtils.addComponent (p, split, 0, 0, 4, 1, BOTH, NWEST, 1.0, 1.0);
SwingUtils.addComponent (p, registerButton, 0, 1, 1, 1, NONE, WEST, 0.0, 0.0);
SwingUtils.addComponent (p, showXMLButton, 1, 1, 1, 1, NONE, WEST, 0.0, 0.0);
SwingUtils.addComponent (p, fromXMLButton, 2, 1, 1, 1, NONE, WEST, 0.0, 0.0);
+ SwingUtils.addComponent (p, unregisButton, 3, 1, 1, 1, NONE, NEAST, 0.0, 0.0);
return p;
}
@@ -306,6 +324,7 @@
MobyException exception = null;
public Object construct() {
try {
+ unregisButton.setEnabled( false );
MobyNamespace namespace = new MobyNamespace (name);
console.setText ("Namespace to be unregistered: " + name + "\n");
registryModel.unRegisterNamespace (namespace);
@@ -320,6 +339,7 @@
// runs on the event-dispatching thread.
public void finished() {
+ unregisButton.setEnabled( true );
if (exception != null)
error ("An error occured when trying to unregister a namespace.\n\n",
exception);
@@ -328,5 +348,4 @@
worker.start();
}
}
-
}
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationDataTypeSubPanel.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationDataTypeSubPanel.java 2008/05/22 17:09:40 1.11
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/dashboard/RegistrationDataTypeSubPanel.java 2009/01/05 08:47:04 1.12
@@ -19,6 +19,7 @@
import org.tulsoft.tools.gui.SwingUtils;
import org.tulsoft.tools.gui.JTextFieldWithHistory;
+import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JSplitPane;
@@ -28,6 +29,7 @@
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.GridBagLayout;
+import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
@@ -52,6 +54,9 @@
JTextFieldWithHistory dtName, dtAuth, dtEmail;
JTextArea dtDescArea;
MobyException dtUnregException;
+ CustomDataTypesTree datatypeTree;
+ JButton unregisButton;
+
// some texts
final static String DATA_TYPE_UNREG_PROLOGUE =
@@ -100,7 +105,7 @@
new DataTypesBoard (registryModel,
console,
propertyChannel,
- new CustomDataTypesTree (registryModel, console));
+ datatypeTree = new CustomDataTypesTree (registryModel, console));
dataTypesBoard.updateTree (CommonTree.SORTED_BY_NAME);
// allow to copy selected namespace to the new one
@@ -134,16 +139,28 @@
KeyEvent.VK_F,
REG_DT_FROM_XML,
createXMLChooser (REG_DT_FROM_XML));
+ unregisButton =
+ createButton (" Unregister Data Type ",
+ "Remove an existing datatype from a Biomoby registry",
+ KeyEvent.VK_U,
+ new ActionListener() {
+ public void actionPerformed (ActionEvent e) {
+ datatypeTree.onUnregisterDataType();
+ }
+ });
+ unregisButton.setIcon (unregisterIcon);
+ unregisButton.setDisabledIcon (unregisterIconDis);
// make splits
JSplitPane split = hSplit (hSplit (buildTree.scrollable(),
defs, 0.5),
board, 0.6);
// put it together
- SwingUtils.addComponent (p, split, 0, 0, 3, 1, BOTH, NWEST, 1.0, 1.0);
+ SwingUtils.addComponent (p, split, 0, 0, 4, 1, BOTH, NWEST, 1.0, 1.0);
SwingUtils.addComponent (p, registerButton, 0, 1, 1, 1, NONE, WEST, 0.0, 0.0);
SwingUtils.addComponent (p, showXMLButton, 1, 1, 1, 1, NONE, WEST, 0.0, 0.0);
SwingUtils.addComponent (p, fromXMLButton, 2, 1, 1, 1, NONE, WEST, 0.0, 0.0);
+ SwingUtils.addComponent (p, unregisButton, 3, 1, 1, 1, NONE, NEAST, 0.0, 0.0);
return p;
}
@@ -406,6 +423,7 @@
final SwingWorker worker = new SwingWorker() {
public Object construct() {
try {
+ unregisButton.setEnabled( false );
MobyDataType dataType = new MobyDataType (dataTypeName);
console.setText ("Data type to be unregistered: " + dataTypeName + "\n");
registryModel.unRegisterDataType (dataType);
@@ -420,6 +438,7 @@
// runs on the event-dispatching thread.
public void finished() {
+ unregisButton.setEnabled( true );
if (dtUnregException != null)
error (DATA_TYPE_UNREG_PROLOGUE, dtUnregException);
}
More information about the MOBY-guts
mailing list