Author: kono
Date: 2010-07-27 19:12:38 -0700 (Tue, 27 Jul 2010)
New Revision: 21042

Added:
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ServiceState.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/SearchResultDialog.java
Modified:
   csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/build.xml
   csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/plugin.props
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSI25VisualStyleBuilder.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICServiceRegistory.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClient.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClientPlugin.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/RegistryManager.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/Mitab25Mapper.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/PSIEntryMapper.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/ResultDialog.java
   
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/test/org/cytoscape/webservice/psicquic/test/RegistoryManagerTest.java
Log:
Version 0.25.  New information dialog added and some bug fixes.

Modified: csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/build.xml
===================================================================
--- csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/build.xml  2010-07-27 
23:27:42 UTC (rev 21041)
+++ csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/build.xml  2010-07-28 
02:12:38 UTC (rev 21042)
@@ -40,7 +40,9 @@
        <!-- ==================== Compile Target 
==============================-->
        <target name="compile" depends="prepare" description="Compiles all Java 
source files">
                <mkdir dir="${build.dir}/classes" />
-               <javac srcdir="${src.dir}" source="1.5" target="1.5" 
destdir="${build.dir}/classes" debug="${compile.debug}" 
deprecation="${compile.deprecation}" optimize="${compile.optimize}">
+               <javac srcdir="${src.dir}" source="1.5" target="1.5" 
+                       destdir="${build.dir}/classes" debug="${compile.debug}" 
+                       deprecation="${compile.deprecation}" 
optimize="${compile.optimize}">
                        <classpath refid="compile.classpath" />
                </javac>
        </target>

Modified: csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/plugin.props
===================================================================
--- csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/plugin.props       
2010-07-27 23:27:42 UTC (rev 21041)
+++ csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/plugin.props       
2010-07-28 02:12:38 UTC (rev 21042)
@@ -8,13 +8,13 @@
 
 # Description used to give users information about the plugin such as what it 
does.  
 # Html tags are encouraged for formatting purposes.
-pluginDescription=PSICQUIC Web Service Universal Client.  You can perform 
meta-search for <a href="http://code.google.com/p/psicquic/";>PSICQUIC data 
service providers</a>.  This plugin works with Cytoscape 2.7.0 (not released 
yet) or later.
+pluginDescription=PSICQUIC Web Service Universal Client.  You can perform 
meta-search in PSICQUIC-compliant databases.  This plugin works with Cytoscape 
2.7.0 or later.
 
 # Plugin version number, this must be two numbers separated by a decimlal.  
Ex. 0.2, 14.03
-pluginVersion=0.08
+pluginVersion=0.25
 
 # Compatible Cytoscape version
-cytoscapeVersion=2.7
+cytoscapeVersion=2.7, 2.8
 
 # Category, use one of the categories listed on the website or create your own
 pluginCategory=Network and Attribute I/O

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSI25VisualStyleBuilder.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSI25VisualStyleBuilder.java
 2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSI25VisualStyleBuilder.java
 2010-07-28 02:12:38 UTC (rev 21042)
@@ -1,7 +1,9 @@
 package org.cytoscape.webservice.psicquic;
 
 import static cytoscape.visual.VisualPropertyType.NODE_LABEL;
+import giny.view.Justification;
 import giny.view.Label;
+import giny.view.Position;
 
 import java.awt.Color;
 import java.awt.Font;
@@ -22,6 +24,7 @@
 import cytoscape.visual.mappings.DiscreteMapping;
 import cytoscape.visual.mappings.ObjectMapping;
 import cytoscape.visual.mappings.PassThroughMapping;
+import ding.view.ObjectPositionImpl;
 
 public class PSI25VisualStyleBuilder {
 
@@ -29,7 +32,7 @@
        private static final String DEF_VS_NAME = "PSI-MI 25 Style";
 
        // Prefix for all PSI-MI 25 attributes
-       private static final String ATTR_PREFIX = "PSI-MI-25.";
+       public static final String ATTR_PREFIX = "PSI-MI-25.";
 
        // Top level interaction types
        private static final String[] ITR_TYPE_ROOT_TERMS = { "MI:0208", 
"MI:0403",
@@ -61,9 +64,12 @@
                // Default values
                final int edgeOp = 160;
                final Color nodeColor = new Color(0, 128, 128);
-               final Color nodeLineColor = new Color(20, 20, 20);
+               final Color nodeLineColor = new Color(40, 40, 40);
                final Color nodeLabelColor = new Color(30, 30, 30);
 
+               final Color nodeCompoundColor = new Color(100, 100, 100);
+               final Color nodeNestedColor = Color.white;
+               
                // final Color edgeColor = new Color(112,128,144);
                final Color edgeColor = Color.black;
                final Font nodeLabelFont = new Font("SansSerif.BOLD", 16, 
Font.BOLD);
@@ -86,7 +92,7 @@
                                nodeColor);
                nac.getDefaultAppearance().set(VisualPropertyType.NODE_SHAPE,
                                NodeShape.RECT);
-               nac.getDefaultAppearance().set(VisualPropertyType.NODE_OPACITY, 
180);
+               nac.getDefaultAppearance().set(VisualPropertyType.NODE_OPACITY, 
150);
                
nac.getDefaultAppearance().set(VisualPropertyType.NODE_BORDER_OPACITY,
                                220);
                
nac.getDefaultAppearance().set(VisualPropertyType.NODE_LINE_WIDTH, 3);
@@ -98,13 +104,57 @@
                                nodeLabelColor);
                
nac.getDefaultAppearance().set(VisualPropertyType.NODE_FONT_FACE,
                                nodeLabelFont);
+               
                nac.getDefaultAppearance().set(
                                VisualPropertyType.NODE_LABEL_POSITION,
                                new LabelPosition(Label.SOUTH, Label.NORTHWEST,
                                                Label.JUSTIFY_CENTER, -7, 1.0));
+               
+               // TODO: this is for 2.8.0
+//             nac.getDefaultAppearance().set(
+//                             VisualPropertyType.NODE_LABEL_POSITION,
+//                             new ObjectPositionImpl(Position.SOUTH, 
Position.NORTH_WEST,
+//                                             Justification.JUSTIFY_CENTER, 
-7, 1.0));
 
-               
nac.getDefaultAppearance().set(VisualPropertyType.NODE_FONT_SIZE, 14);
+               
nac.getDefaultAppearance().set(VisualPropertyType.NODE_FONT_SIZE, 10);
                nac.setNodeSizeLocked(false);
+               
+               DiscreteMapping nodeColorMapping = new 
DiscreteMapping(nodeColor,
+                               ATTR_PREFIX + "interactor type", 
ObjectMapping.NODE_MAPPING);
+               nodeColorMapping.putMapValue("compound", nodeCompoundColor);
+               nodeColorMapping.putMapValue("nested", nodeNestedColor);
+               final Calculator nodeColorCalc = new 
BasicCalculator(DEF_VS_NAME + "-"
+                               + "NodeColorMapping", nodeColorMapping,
+                               VisualPropertyType.NODE_FILL_COLOR);
+               nac.setCalculator(nodeColorCalc);
+               
+               DiscreteMapping nodeShapeMapping = new 
DiscreteMapping(NodeShape.RECT,
+                               ATTR_PREFIX + "interactor type", 
ObjectMapping.NODE_MAPPING);
+               nodeShapeMapping.putMapValue("compound", NodeShape.ELLIPSE);
+               nodeShapeMapping.putMapValue("nested", NodeShape.ROUND_RECT);
+               final Calculator nodeShapeCalc = new 
BasicCalculator(DEF_VS_NAME + "-"
+                               + "NodeShapeMapping", nodeShapeMapping,
+                               VisualPropertyType.NODE_SHAPE);
+               nac.setCalculator(nodeShapeCalc);
+               
+               DiscreteMapping nodeWidthMapping = new DiscreteMapping(30,
+                               ATTR_PREFIX + "interactor type", 
ObjectMapping.NODE_MAPPING);
+               nodeWidthMapping.putMapValue("compound", 15);
+               nodeWidthMapping.putMapValue("nested", 100);
+               final Calculator nodeWidthCalc = new 
BasicCalculator(DEF_VS_NAME + "-"
+                               + "NodeWidthMapping", nodeWidthMapping,
+                               VisualPropertyType.NODE_WIDTH);
+               nac.setCalculator(nodeWidthCalc);
+               DiscreteMapping nodeHeightMapping = new DiscreteMapping(30,
+                               ATTR_PREFIX + "interactor type", 
ObjectMapping.NODE_MAPPING);
+               nodeHeightMapping.putMapValue("compound", 15);
+               nodeHeightMapping.putMapValue("nested", 100);
+               final Calculator nodeHeightCalc = new 
BasicCalculator(DEF_VS_NAME + "-"
+                               + "NodeHeightMapping", nodeHeightMapping,
+                               VisualPropertyType.NODE_HEIGHT);
+               nac.setCalculator(nodeHeightCalc);
+               
+               
 
                // eac.setCalculator(calce);
                eac.getDefaultAppearance()

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICServiceRegistory.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICServiceRegistory.java
        2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICServiceRegistory.java
        2010-07-28 02:12:38 UTC (rev 21042)
@@ -33,8 +33,6 @@
 
 public class PSICQUICServiceRegistory {
 
-       private static RegistryManager manager;
-
        private enum OperationType {
                GET_COUNT, IMPORT;
        }
@@ -43,7 +41,7 @@
        private static Map<URI, String> serviceNames;
        private static List<PsicquicService> ports;
 
-       private Set<URI> emptyResults = new CopyOnWriteArraySet<URI>();
+       Set<URI> skip = new CopyOnWriteArraySet<URI>();
 
        /*
         * Initialize services. In 3.0, this will be done by Spring DM.
@@ -56,19 +54,17 @@
                try {
                        // Human-readable database name should be taken from 
PSI-MI 2.5
                        // ontology.
-
-                       manager = new RegistryManager();
-
-                       for (String serviceName : 
manager.getRegistry().keySet()) {
+                       
+                       for (String serviceName : 
RegistryManager.getManager().getActiveServices().keySet()) {
                                final ClientProxyFactoryBean factory = new 
JaxWsProxyFactoryBean();
                                factory.setServiceClass(PsicquicService.class);
-                               
factory.setAddress(manager.getRegistry().get(serviceName));
+                               
factory.setAddress(RegistryManager.getManager().getActiveServices().get(serviceName));
                                serviceNames.put(
-                                               new 
URI(manager.getRegistry().get(serviceName)),
+                                               new 
URI(RegistryManager.getManager().getActiveServices().get(serviceName)),
                                                serviceName);
                                final PsicquicService port = (PsicquicService) 
factory.create();
                                ports.add(port);
-                               services.put(new 
URI(manager.getRegistry().get(serviceName)),
+                               services.put(new 
URI(RegistryManager.getManager().getActiveServices().get(serviceName)),
                                                port);
                        }
                } catch (Exception e) {
@@ -128,7 +124,7 @@
                        System.out.println("Submit search query to " + key);
                }
 
-               emptyResults.clear();
+               skip.clear();
                try {
                        for (int i = 0; i < services.size(); i++) {
                                res = cs.take();
@@ -140,7 +136,7 @@
                                                        + ": Interactions Found 
=  "
                                                        + 
qr.getResultInfo().getTotalResults());
                                        if 
(qr.getResultInfo().getTotalResults() == 0) {
-                                               emptyResults.add(name);
+                                               skip.add(name);
                                        }
                                }
                        }
@@ -192,7 +188,7 @@
                // Submit tasks
                Object port;
                for (URI key : services.keySet()) {
-                       if (emptyResults.contains(key))
+                       if (skip.contains(key))
                                continue;
 
                        port = services.get(key);
@@ -204,16 +200,16 @@
                                cs.submit(new PSICQUICRemoteTask(interactors, 
reqInfo,
                                                operator, port, key, 
OperationType.IMPORT));
                        }
-                       System.out.println("Submit search query to " + key);
+                       System.out.println("Submit import request to " + key);
                }
 
                try {
 
-                       for (int i = 0; i < services.size() - 
emptyResults.size(); i++) {
+                       for (int i = 0; i < services.size() - skip.size(); i++) 
{
 
                                res = cs.take();
                                URI name = (URI) res.get().get(0);
-                               if (emptyResults.contains(name))
+                               if (skip.contains(name))
                                        continue;
 
                                final List<QueryResponse> qrList = new 
ArrayList<QueryResponse>();
@@ -251,13 +247,13 @@
        }
 
        protected boolean isEmpty(final URI serviceURI) {
-               if (this.emptyResults.contains(serviceURI))
+               if (this.skip.contains(serviceURI))
                        return true;
                else
                        return false;
        }
 
-       class PSICQUICRemoteTask implements Callable<List<Object>>,
+       static final class PSICQUICRemoteTask implements Callable<List<Object>>,
                        CyWebServiceEventListener {
 
                List<DbRef> interactorList;

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClient.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClient.java
 2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClient.java
 2010-07-28 02:12:38 UTC (rev 21042)
@@ -10,12 +10,15 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.regex.Pattern;
 
+import javax.swing.JDialog;
 import javax.swing.JPanel;
 
 import org.cytoscape.webservice.psicquic.mapper.Mitab25Mapper;
 import org.cytoscape.webservice.psicquic.ui.ResultDialog;
+import org.cytoscape.webservice.psicquic.ui.SearchResultDialog;
 import org.hupo.psi.mi.psicquic.DbRef;
 import org.hupo.psi.mi.psicquic.QueryResponse;
 import org.hupo.psi.mi.psicquic.RequestInfo;
@@ -70,16 +73,14 @@
 
                // General setting
                props.add(new Tunable("block_size", "Block Size", 
Tunable.INTEGER,
-                               new Integer(100)));
+                               Integer.valueOf(100)));
                props.add(new Tunable("timeout", "Timeout (sec.)", 
Tunable.INTEGER,
                                new Integer(6000)));
-               props.add(new Tunable("active_only", "Active Services Only",
-                               Tunable.BOOLEAN, new Boolean(true)));
 
                final String[] modeArray = { QueryMode.GET_BY_INTERACTOR.name(),
                                QueryMode.GET_BY_QUERY.toString() };
                props.add(new Tunable("query_mode", "Query Mode", Tunable.LIST,
-                               new Integer(0), (Object) modeArray, (Object) 
null, 0));
+                               Integer.valueOf(0), (Object) modeArray, 
(Object) null, 0));
 
        }
 
@@ -102,6 +103,8 @@
        private Map<URI, QueryResponse> sResult;
        private List<DbRef> queryList;
        private String query;
+       
+       private final ServiceState states;
 
        static {
                try {
@@ -119,6 +122,9 @@
                setDescription();
                // Set properties for this client.
                setProperty();
+               
+               this.states = new ServiceState(((PSICQUICServiceRegistory) 
clientStub));
+
        }
 
        public static WebServiceClient<PSICQUICServiceRegistory> getClient() {
@@ -135,9 +141,16 @@
 
                if (e.getSource().equals(CLIENT_ID)) {
                        if 
(e.getEventType().equals(WSEventType.IMPORT_NETWORK)) {
-                               importNetwork(e.getParameter(), null);
+                               SearchResultDialog searchResultDialog = new 
SearchResultDialog(Cytoscape.getDesktop(), states);
+                               searchResultDialog.setVisible(true);
+                               Set<String> selected = 
searchResultDialog.getSelected();
+                               
+                               importNetwork(selected, null);
                        } else if 
(e.getEventType().equals(WSEventType.EXPAND_NETWORK)) {
-                               importNetwork(e.getParameter(), 
Cytoscape.getCurrentNetwork());
+                               SearchResultDialog searchResultDialog = new 
SearchResultDialog(Cytoscape.getDesktop(), states);
+                               searchResultDialog.setVisible(true);
+                               Set<String> selected = 
searchResultDialog.getSelected();
+                               importNetwork(selected, 
Cytoscape.getCurrentNetwork());
                        } else if 
(e.getEventType().equals(WSEventType.SEARCH_DATABASE)) {
                                search(e.getParameter().toString(), e);
                        }
@@ -188,19 +201,32 @@
                        nextMove = WSEventType.IMPORT_NETWORK;
 
                Integer total = 0;
-               for (URI key : sResult.keySet())
+               for (URI key : sResult.keySet()) {
+                       final Integer count = 
sResult.get(key).getResultInfo().getTotalResults();
+                       
states.setRecentResultCount(states.getName(key.toString()), count);
                        total = total + 
sResult.get(key).getResultInfo().getTotalResults();
-
+               }
+                       
                Cytoscape.firePropertyChange(SEARCH_FINISHED.toString(), 
this.clientID,
                                new DatabaseSearchResult<Map<URI, 
QueryResponse>>(total,
                                                sResult, nextMove));
 
        }
 
-       private void importNetwork(Object result, CyNetwork e)
+       private void importNetwork(Set<String> selected, CyNetwork e)
                        throws CyWebServiceException {
+               
+               if(selected == null || selected.size() == 0)
+                       return;
 
                PSICQUICServiceRegistory importClient = 
((PSICQUICServiceRegistory) clientStub);
+               for(URI uri:importClient.getServiceNames().keySet()) {
+                       String name = importClient.getServiceNames().get(uri);
+                       if(selected.contains(name) == false)
+                               importClient.skip.add(uri);
+               }
+               
+               
                Map<URI, List<QueryResponse>> importResult = null;
                final RequestInfo info = new RequestInfo();
 
@@ -291,6 +317,9 @@
                        targetView.redrawGraph(true, false);
                        CyNode nestedNode = Cytoscape.getCyNode(net.getTitle(), 
true);
                        nestedNode.setNestedNetwork(net);
+                       
+                       
Cytoscape.getNodeAttributes().setAttribute(nestedNode.getIdentifier(), 
PSI25VisualStyleBuilder.ATTR_PREFIX + "interactor type", "nested");
+                       
                        parentNetwork.addNode(nestedNode);
                        parentNetwork.addEdge(Cytoscape.getCyEdge(nestedNode, 
centerNode, "interaction", "query_result", true));
                }
@@ -360,5 +389,9 @@
                }
                return interactorList;
        }
+       
+       public void getLatestSearchResult() {
+               
+       }
 
 }

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClientPlugin.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClientPlugin.java
   2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/PSICQUICUniversalClientPlugin.java
   2010-07-28 02:12:38 UTC (rev 21042)
@@ -1,8 +1,13 @@
 package org.cytoscape.webservice.psicquic;
 
+import java.awt.Component;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import cytoscape.Cytoscape;
 import cytoscape.data.webservice.WebServiceClientManager;
 import cytoscape.logger.CyLogger;
 import cytoscape.plugin.CytoscapePlugin;
@@ -15,33 +20,63 @@
  * 
  * @author kono
  * @since Cytoscape 2.7
- *
+ * 
  */
 public class PSICQUICUniversalClientPlugin extends CytoscapePlugin {
+       
+       private static final String TARGET_MENU = "Network from Web 
Services...";
 
+       private static final CyLogger logger = CyLogger.getLogger();
+
        public PSICQUICUniversalClientPlugin() {
+               
+               // Disable menu until initialization process ends.
+               
+               final JMenu importMenu = 
Cytoscape.getDesktop().getCyMenus().getMenuBar().getMenu("File.Import");
+               final Component[] menues = importMenu.getMenuComponents();
+               JMenuItem webServiceMenu = null;
+               
+               for(Component menu: menues) {
+                       if(menu instanceof JMenuItem) {
+                               JMenuItem menuItem = (JMenuItem) menu;
+                               if(menuItem.getText().contains(TARGET_MENU)) {
+                                       webServiceMenu = menuItem;
+                                       break;
+                               }
+                       }
+               }
+               
+               if(webServiceMenu != null) {
+                       webServiceMenu.setEnabled(false);
+                       webServiceMenu.setToolTipText("Initializing web service 
clients.  Please wait...");
+               }
 
+               final ExecutorService ex = Executors.newSingleThreadExecutor();
+
                try {
-                       
-                       final ExecutorService ex = 
Executors.newSingleThreadExecutor();
-               System.out.println("Initializatin process start in separate 
thread for PSICQUIC");
-               ex.execute(new InitTask());
-                       
+                       logger.info("Initializatin process start in separate 
thread for PSICQUIC.");
+                       ex.execute(new InitTask(webServiceMenu));
                } catch (Exception e) {
-                       CyLogger.getLogger().error(
-                                       "Failed to register PSICQUIC Universal 
client.", e);
+                       logger.error("Failed to initialize PSICQUIC Universal 
Client.", e);
+                       webServiceMenu.setEnabled(true);
+                       webServiceMenu.setToolTipText(null);
                }
-               
-               
+       }
 
-       }
        
        class InitTask implements Runnable {
+               
+               private final JMenuItem menuItem;
+               
+               InitTask(JMenuItem menu) {
+                       this.menuItem = menu;
+               }
 
                public void run() {
                        
WebServiceClientManager.registerClient(PSICQUICUniversalClient
                                        .getClient());
+                       menuItem.setEnabled(true);
+                       menuItem.setToolTipText(null);
                }
-               
        }
 }

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/RegistryManager.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/RegistryManager.java
 2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/RegistryManager.java
 2010-07-28 02:12:38 UTC (rev 21042)
@@ -29,31 +29,65 @@
  * 
  */
 public class RegistryManager {
-       
+
+       private static RegistryManager manager;
+
+       static {
+               try {
+                       manager = new RegistryManager();
+               } catch (IOException e) {
+                       manager = null;
+                       e.printStackTrace();
+               }
+       }
+
+       public static RegistryManager getManager() {
+               return manager;
+       }
+
        // Tag definitions
        private static final String SOAP_URL = "soapUrl";
+       private static final String IS_ACTIVE = "active";
        private static final String SERVICE_URL = 
"http://www.ebi.ac.uk/Tools/webservices/psicquic/registry/registry";;
-       
-       //Defines action command
+
+       // Defines action command
        public enum STATE {
                ACTIVE, INACTIVE, STATUS;
        }
 
-       private final Map<String, String> regMap;
+       private final Map<String, String> activeServiceMap;
+       private final Map<String, String> inactiveServiceMap;
+       
+       private final Map<String, Boolean> statusMap;
+       private final Map<String, String> urlMap;
 
-       public RegistryManager() throws IOException {
-               regMap = new HashMap<String, String>();
+       private RegistryManager() throws IOException {
+               activeServiceMap = new HashMap<String, String>();
+               inactiveServiceMap = new HashMap<String, String>();
+               statusMap = new HashMap<String, Boolean>();
+               urlMap = new HashMap<String, String>();
                invoke();
        }
 
-       public Map<String, String> getRegistry() {
-               return regMap;
+       public Map<String, String> getActiveServices() {
+               return activeServiceMap;
        }
 
-       
+       public Map<String, String> getInactiveServices() {
+               return inactiveServiceMap;
+       }
+
        private void invoke() throws IOException {
-               String command = "?action=" + STATE.ACTIVE.name() 
+"&format=xml";
+               final String command = "?action=" + STATE.STATUS.name() + 
"&format=xml";
 
+               callRegistry(command);
+               
+               setMap();
+
+               System.out.println("PSICQUIC Registory Manager is ready.");
+       }
+
+       private void callRegistry(final String command) throws IOException {
                URL url = new URL(SERVICE_URL + command);
                HttpURLConnection connection = (HttpURLConnection) 
url.openConnection();
                connection.setRequestMethod("GET");
@@ -73,27 +107,27 @@
                        builder.append(next);
                }
 
+               reader.close();
+               reader = null;
+
                try {
                        parse(builder.toString());
                } catch (ParserConfigurationException e) {
-                       
+
                        e.printStackTrace();
                        throw new IOException("Could not parse message from 
registry.");
                } catch (XPathException e) {
-                       // TODO Auto-generated catch block
                        e.printStackTrace();
                        throw new IOException("Could not parse message from 
registry.");
                } catch (SAXException e) {
-                       // TODO Auto-generated catch block
                        e.printStackTrace();
                        throw new IOException("Could not parse message from 
registry.");
                }
-               
-               System.out.println("PSICQUIC Registory Manager is ready.");
 
        }
 
-       private void parse(String result) throws ParserConfigurationException, 
IOException, XPathException, SAXException {
+       private void parse(String result) throws ParserConfigurationException,
+                       IOException, XPathException, SAXException {
 
                DocumentBuilderFactory dbfactory = 
DocumentBuilderFactory.newInstance();
                DocumentBuilder docbuilder = dbfactory.newDocumentBuilder();
@@ -111,7 +145,8 @@
                for (int i = 0; i < list.getLength(); i++) {
                        regName = list.item(i).getFirstChild().getFirstChild()
                                        .getNodeValue();
-                       System.out.println("Service Provider " + i  + ": " + 
regName);
+                       System.out.println("Service Provider " + i + ": " + 
regName);
+
                        walk(list.item(i), regName);
                }
 
@@ -119,16 +154,31 @@
 
        private void walk(Node item, String serviceName) {
 
-                       String tag = null;
-                       for(Node n = item.getFirstChild(); n!=null; n = 
n.getNextSibling()) {
-                               tag = item.getNodeName();
-                               if(tag.equals(SOAP_URL)) {
-                                       System.out.println("SOAP = "
-                                                       + 
item.getFirstChild().getNodeValue());
-                                       regMap.put(serviceName, 
item.getFirstChild().getNodeValue());
-                                       return;
-                               }
-                               walk(n, serviceName);
-                       }       
+               String tag = null;
+               
+               for (Node n = item.getFirstChild(); n != null; n = 
n.getNextSibling()) {
+                       tag = item.getNodeName();
+                       if (tag.equals(SOAP_URL)) {
+                               System.out.println("SOAP = "
+                                               + 
item.getFirstChild().getNodeValue());
+                               urlMap.put(serviceName, 
item.getFirstChild().getNodeValue());
+
+                       } else if (tag.equals(IS_ACTIVE)) {
+                               System.out.println("Active? = "
+                                               + 
item.getFirstChild().getNodeValue());
+                               statusMap.put(serviceName, 
Boolean.parseBoolean(item.getFirstChild().getNodeValue()));
+                       }
+                       walk(n, serviceName);
+               }
        }
+       
+       private void setMap() {
+               for(String serviceName: statusMap.keySet()){
+                       System.out.println("######## Complete for " + 
serviceName + " = " + statusMap.get(serviceName));
+                       if (statusMap.get(serviceName) == true)
+                               activeServiceMap.put(serviceName, 
urlMap.get(serviceName));
+                       else
+                               inactiveServiceMap.put(serviceName, 
urlMap.get(serviceName));
+               }
+       }
 }

Added: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ServiceState.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ServiceState.java
                            (rev 0)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ServiceState.java
    2010-07-28 02:12:38 UTC (rev 21042)
@@ -0,0 +1,60 @@
+package org.cytoscape.webservice.psicquic;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+public class ServiceState {
+       private final SortedSet<String> services;
+       private final Map<String, Integer> lastCounts;
+       
+       private final Map<String, String> uri2name;
+       
+       
+       public ServiceState(PSICQUICServiceRegistory reg) {
+               services = new 
TreeSet<String>(RegistryManager.getManager().getActiveServices().keySet());
+               
services.addAll(RegistryManager.getManager().getInactiveServices().keySet());
+               
+               uri2name = new HashMap<String, String>();
+               for(String serviceName: 
RegistryManager.getManager().getActiveServices().keySet()) {
+                       
uri2name.put(RegistryManager.getManager().getActiveServices().get(serviceName), 
serviceName);
+               }
+               
+               lastCounts = new HashMap<String, Integer>();
+               
+       }
+       
+       public boolean isActive(final String serviceName) {
+               
if(RegistryManager.getManager().getInactiveServices().keySet().contains(serviceName))
+                       return false;
+               else
+                       return true;
+               
+       }
+       
+       public Collection<String> getServiceNames() {
+               return services;
+       }
+       
+       public int getRecentResultCount(final String serviceName) {
+               Integer count = lastCounts.get(serviceName);
+               
+               if(count != null)
+                       return count;
+               else
+                       return 0;
+       }
+       
+       public void setRecentResultCount(final String serviceName, Integer 
count) {
+               lastCounts.put(serviceName, count);
+       }
+       
+       public String getName(String uriString) {
+               return this.uri2name.get(uriString);
+       }
+
+       
+       
+}

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/Mitab25Mapper.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/Mitab25Mapper.java
    2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/Mitab25Mapper.java
    2010-07-28 02:12:38 UTC (rev 21042)
@@ -12,6 +12,7 @@
 import cytoscape.CyNode;
 import cytoscape.Cytoscape;
 import cytoscape.data.CyAttributes;
+import cytoscape.logger.CyLogger;
 
 /**
  * Map minimal set of information from MITAB25.
@@ -21,11 +22,14 @@
  */
 public class Mitab25Mapper {
 
+       private static final CyLogger logger = CyLogger.getLogger();
+
        // Separator for multiple entries.
        private static final String SEPARATOR = "\\|";
-
        private static final String ATTR_PREFIX = "PSI-MI-25.";
 
+       private static final int COLUMN_COUNT = 15;
+
        final Set<CyNode> nodes;
        final Set<CyEdge> edges;
 
@@ -47,11 +51,17 @@
                        + "interaction type";
        private static final String SOURCE_DB = ATTR_PREFIX + "source database";
        private static final String INTERACTION_ID = ATTR_PREFIX + "Interaction 
ID";
+       private static final String EDGE_SCORE = ATTR_PREFIX + "confidence 
score";
 
        // Stable IDs which maybe used for mapping later
        private static final String UNIPROT = "uniprotkb";
        private static final String ENTREZ_GENE = "entrezgene/locuslink";
        private static final String ENTREZ_GENE_SYN = "entrez gene/locuslink";
+       
+       private static final String CHEBI = "chebi";
+       
+       private static final String INTERACTOR_TYPE = ATTR_PREFIX + "interactor 
type";
+       private static final String COMPOUND = "compound";
 
        private Matcher matcher;
 
@@ -65,81 +75,14 @@
                networkAttr = Cytoscape.getNetworkAttributes();
        }
 
-       public CyNetwork map(String mitab, String networkName, CyNetwork 
parentNetwork) {
+       public CyNetwork map(String mitab, String networkName,
+                       CyNetwork parentNetwork) {
 
                // Read the long string of MITAB
                String[] lines = mitab.split("\n");
 
-               String[] entry;
-               String[] sourceID;
-               String[] targetID;
+               parse(lines);
 
-               String[] detectionMethods;
-               CyNode source;
-               CyNode target;
-               CyEdge e;
-
-               String[] sourceDB;
-               String[] interactionID;
-               String[] interactionType;
-
-               for (String line : lines) {
-                       entry = line.split(TAB);
-                       if (entry == null || entry.length < 12)
-                               continue;
-
-                       sourceID = entry[0].split(SEPARATOR);
-                       targetID = entry[1].split(SEPARATOR);
-
-                       source = Cytoscape.getCyNode(sourceID[0], true);
-                       target = Cytoscape.getCyNode(targetID[0], true);
-                       nodes.add(source);
-                       nodes.add(target);
-
-                       // Aliases
-                       setAliases(nodeAttr, source.getIdentifier(), entry[0]
-                                       .split(SEPARATOR));
-                       setAliases(nodeAttr, target.getIdentifier(), entry[1]
-                                       .split(SEPARATOR));
-                       setAliases(nodeAttr, source.getIdentifier(), entry[2]
-                                       .split(SEPARATOR));
-                       setAliases(nodeAttr, target.getIdentifier(), entry[3]
-                                       .split(SEPARATOR));
-                       setAliases(nodeAttr, source.getIdentifier(), entry[4]
-                                       .split(SEPARATOR));
-                       setAliases(nodeAttr, target.getIdentifier(), entry[5]
-                                       .split(SEPARATOR));
-
-                       // Tax ID (pick first one only)
-                       setTaxID(nodeAttr, source.getIdentifier(), entry[9]
-                                       .split(SEPARATOR)[0]);
-                       setTaxID(nodeAttr, target.getIdentifier(), entry[10]
-                                       .split(SEPARATOR)[0]);
-
-                       sourceDB = entry[12].split(SEPARATOR);
-                       interactionID = entry[13].split(SEPARATOR);
-
-                       detectionMethods = entry[6].split(SEPARATOR);
-                       interactionType = entry[11].split(SEPARATOR);
-                       e = Cytoscape.getCyEdge(source, target, INTERACTION,
-                                       interactionID[0], true);
-                       edges.add(e);
-
-                       setEdgeListAttribute(edgeAttr, e.getIdentifier(), 
interactionType,
-                                       INTERACTION_TYPE);
-                       setEdgeListAttribute(edgeAttr, e.getIdentifier(), 
detectionMethods,
-                                       DETECTION_METHOD);
-                       setEdgeListAttribute(edgeAttr, e.getIdentifier(), 
sourceDB,
-                                       SOURCE_DB);
-
-                       edgeAttr.setAttribute(e.getIdentifier(), INTERACTION_ID,
-                                       interactionID[0]);
-
-                       setPublication(edgeAttr, e.getIdentifier(), entry[8]
-                                       .split(SEPARATOR), 
entry[7].split(SEPARATOR));
-
-               }
-
                // Create top attribues for important keys
                List<String> currentAttr;
                for (CyNode node : nodes) {
@@ -155,7 +98,7 @@
                                nodeAttr.setAttribute(node.getIdentifier(), 
ATTR_PREFIX
                                                + ENTREZ_GENE + ".top", 
currentAttr.get(0));
                        }
-                       
+
                        currentAttr = 
nodeAttr.getListAttribute(node.getIdentifier(),
                                        ATTR_PREFIX + ENTREZ_GENE_SYN);
                        if (currentAttr != null && currentAttr.size() != 0) {
@@ -176,6 +119,99 @@
                }
        }
 
+       private void parse(final String[] lines) {
+               String[] entry;
+               String[] sourceID;
+               String[] targetID;
+
+               String[] detectionMethods;
+               CyNode source;
+               CyNode target;
+               CyEdge e;
+
+               String[] sourceDB;
+               String[] interactionID;
+               String[] interactionType;
+
+               String[] edgeScore;
+
+               for (String line : lines) {
+                       try {
+                               entry = line.split(TAB);
+
+                               // Validate entry list.
+                               if (entry == null || entry.length < 
COLUMN_COUNT)
+                                       continue;
+
+                               sourceID = entry[0].split(SEPARATOR);
+                               targetID = entry[1].split(SEPARATOR);
+
+                               source = Cytoscape.getCyNode(sourceID[0], true);
+                               target = Cytoscape.getCyNode(targetID[0], true);
+                               nodes.add(source);
+                               nodes.add(target);
+                               
+                               // Set type if not protein
+                               if(source.getIdentifier().contains(CHEBI))
+                                       
nodeAttr.setAttribute(source.getIdentifier(), INTERACTOR_TYPE, COMPOUND);
+                               if(target.getIdentifier().contains(CHEBI))
+                                       
nodeAttr.setAttribute(target.getIdentifier(), INTERACTOR_TYPE, COMPOUND);
+
+                               // Aliases
+                               setAliases(nodeAttr, source.getIdentifier(),
+                                               entry[0].split(SEPARATOR));
+                               setAliases(nodeAttr, target.getIdentifier(),
+                                               entry[1].split(SEPARATOR));
+                               setAliases(nodeAttr, source.getIdentifier(),
+                                               entry[2].split(SEPARATOR));
+                               setAliases(nodeAttr, target.getIdentifier(),
+                                               entry[3].split(SEPARATOR));
+                               setAliases(nodeAttr, source.getIdentifier(),
+                                               entry[4].split(SEPARATOR));
+                               setAliases(nodeAttr, target.getIdentifier(),
+                                               entry[5].split(SEPARATOR));
+
+                               // Tax ID (pick first one only)
+                               setTaxID(nodeAttr, source.getIdentifier(),
+                                               entry[9].split(SEPARATOR)[0]);
+                               setTaxID(nodeAttr, target.getIdentifier(),
+                                               entry[10].split(SEPARATOR)[0]);
+
+                               sourceDB = entry[12].split(SEPARATOR);
+                               interactionID = entry[13].split(SEPARATOR);
+
+                               edgeScore = entry[14].split(SEPARATOR);
+
+                               detectionMethods = entry[6].split(SEPARATOR);
+                               interactionType = entry[11].split(SEPARATOR);
+                               e = Cytoscape.getCyEdge(source, target, 
INTERACTION,
+                                               interactionID[0], true);
+                               edges.add(e);
+
+                               setEdgeListAttribute(edgeAttr, 
e.getIdentifier(),
+                                               interactionType, 
INTERACTION_TYPE);
+                               setEdgeListAttribute(edgeAttr, 
e.getIdentifier(),
+                                               detectionMethods, 
DETECTION_METHOD);
+                               setEdgeListAttribute(edgeAttr, 
e.getIdentifier(), sourceDB,
+                                               SOURCE_DB);
+                               
+                               // Map scores
+                               setEdgeScoreListAttribute(edgeAttr, 
e.getIdentifier(), edgeScore,
+                                               EDGE_SCORE);
+
+                               edgeAttr.setAttribute(e.getIdentifier(), 
INTERACTION_ID,
+                                               interactionID[0]);
+
+                               setPublication(edgeAttr, e.getIdentifier(),
+                                               entry[8].split(SEPARATOR), 
entry[7].split(SEPARATOR));
+                       } catch (Exception ex) {
+                               logger.warn("Invalid entry line found: " + 
line, ex);
+                               continue;
+                       }
+
+               }
+       }
+
        private void setNetworkAttr(final CyNetwork net) {
 
        }
@@ -191,8 +227,8 @@
                        if (matcher.find()) {
                                taxonName = matcher.group();
                                attr.setAttribute(id, attrName, 
buf[1].split("\\(")[0]);
-                               attr.setAttribute(id, attrName + ".name", 
taxonName.substring(
-                                               1, taxonName.length() - 1));
+                               attr.setAttribute(id, attrName + ".name",
+                                               taxonName.substring(1, 
taxonName.length() - 1));
                        } else {
                                attr.setAttribute(id, attrName, buf[1]);
                        }
@@ -249,7 +285,36 @@
                        listAttrMapper(attr, key + ".name", id, name);
                }
        }
+       
+       // Special case for edge scores
+       private void setEdgeScoreListAttribute(CyAttributes attr, String id,
+                       String[] entry, String key) {
 
+               String scoreString;
+               String scoreType;
+
+               for (String val : entry) {
+                       final String[] parts = val.split(":");
+                       if(parts == null || parts.length != 2)
+                               continue;
+                       
+                       scoreString = parts[1];
+                       scoreType = parts[0];
+               
+                       try {
+                               final Double score = 
Double.parseDouble(scoreString);
+                               edgeAttr.setAttribute(id, key + "." + 
scoreType, score);
+                       } catch (Exception e) {
+                               if(scoreString != null && 
scoreString.trim().equals("") == false)
+                                       edgeAttr.setAttribute(id, key + "." + 
scoreType, scoreString);
+                                       
+                               continue;
+                       }
+               }
+       }
+       
+       
+
        private void listAttrMapper(CyAttributes attr, String attrName, String 
id,
                        String value) {
                List currentAttr;

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/PSIEntryMapper.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/PSIEntryMapper.java
   2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/mapper/PSIEntryMapper.java
   2010-07-28 02:12:38 UTC (rev 21042)
@@ -40,12 +40,12 @@
        public void map(Entry entry) {
                
                // Extract All
-               AttributeList attrs = entry.getAttributeList();
-               AvailabilityList availability = entry.getAvailabilityList();
-               ExperimentDescriptionList expList = entry.getExperimentList();
+//             AttributeList attrs = entry.getAttributeList();
+//             AvailabilityList availability = entry.getAvailabilityList();
+//             ExperimentDescriptionList expList = entry.getExperimentList();
                InteractionList interactions = entry.getInteractionList();
                InteractorList interactors = entry.getInteractorList();
-               Source source = entry.getSource();
+//             Source source = entry.getSource();
                
                mapInteractors(interactors);
                mapInteractions(interactions);

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/ResultDialog.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/ResultDialog.java
 2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/ResultDialog.java
 2010-07-28 02:12:38 UTC (rev 21042)
@@ -16,12 +16,16 @@
 public class ResultDialog extends javax.swing.JDialog {
 
        private static final long serialVersionUID = 6996385373168492882L;
+       
        private Map<URI, String> dbNames;
        private DefaultTableModel model;
 
        private boolean mergeNetworks;
 
-       /** Creates new form PSICQUICResultDialog */
+       /** 
+        * Creates new form PSICQUICResultDialog 
+        * 
+        */
        public ResultDialog(Frame parent, boolean modal, Map<URI, String> 
dbNames) {
                super(parent, modal);
                this.dbNames = dbNames;
@@ -42,7 +46,7 @@
                });
 
                model = (DefaultTableModel) resultTable.getModel();
-               model.addColumn("Source", dbNames.keySet().toArray());
+               model.addColumn("Service URL", dbNames.keySet().toArray());
                model.addColumn("Network Name (Please edit these if 
necessary)");
                for (int i = 0; i < model.getRowCount(); i++) {
                        model.setValueAt(dbNames.get(model.getValueAt(i, 0)), 
i, 1);

Added: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/SearchResultDialog.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/SearchResultDialog.java
                           (rev 0)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/src/org/cytoscape/webservice/psicquic/ui/SearchResultDialog.java
   2010-07-28 02:12:38 UTC (rev 21042)
@@ -0,0 +1,320 @@
+package org.cytoscape.webservice.psicquic.ui;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Frame;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableCellRenderer;
+
+import org.cytoscape.webservice.psicquic.ServiceState;
+
+public class SearchResultDialog extends javax.swing.JDialog {
+
+       private static final long serialVersionUID = 6996385373168492882L;
+
+       private DefaultTableModel model;
+
+       private final ServiceState state;
+
+       /**
+        * Creates new form PSICQUICResultDialog
+        * 
+        */
+       public SearchResultDialog(Frame parent, final ServiceState states) {
+               super(parent, true);
+               this.state = states;
+
+               setTableModel();
+               initComponents();
+
+               setCoumnWidth();
+
+               pack();
+               this.setLocationRelativeTo(parent);
+       }
+       
+       public Set<String> getSelected() {
+               final Set<String> selectedService = new HashSet<String>();
+               
+               for(int i=0; i<model.getRowCount(); i++) {
+                       Boolean selected = (Boolean) model.getValueAt(i, 0);
+                       
+                       if(selected) {
+                               selectedService.add(model.getValueAt(i, 
1).toString());
+                       }
+               }
+               
+               return selectedService;
+       }
+
+       private void setCoumnWidth() {
+
+               resultTable.getTableHeader().setReorderingAllowed(false);
+               resultTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+               // Checkbox
+               resultTable.getColumnModel().getColumn(0).setPreferredWidth(70);
+               // Name
+               
resultTable.getColumnModel().getColumn(1).setPreferredWidth(200);
+               // Number of result
+               
resultTable.getColumnModel().getColumn(2).setPreferredWidth(120);
+               // Status
+               
resultTable.getColumnModel().getColumn(3).setPreferredWidth(100);
+
+       }
+
+       private void setTableModel() {
+               resultTable = new javax.swing.JTable(new DefaultTableModel() {
+
+                       private static final long serialVersionUID = 
-7798626850196524108L;
+
+                       @Override
+                       public boolean isCellEditable(int row, int column) {
+                               final int count = (Integer) 
model.getValueAt(row, 2);
+                               final String active = model.getValueAt(row, 
3).toString();
+                               
+                               if (column == 0 && active.equals("Active") && 
count != 0)
+                                       return true;
+                               else
+                                       return false;
+                       }
+                       
+                       public Class<?> getColumnClass(int c) {
+                   return getValueAt(0, c).getClass();
+               }
+               });
+
+               model = (DefaultTableModel) resultTable.getModel();
+
+               model.addColumn("Import?");
+               model.addColumn("Service Name");
+               model.addColumn("Records Found");
+               model.addColumn("Status");
+
+               System.out.println("########Service count = "
+                               + state.getServiceNames().size());
+               for (final String serviceName : state.getServiceNames()) {
+                       Object[] vals = new Object[4];
+
+                       vals[1] = serviceName;
+                       vals[2] = state.getRecentResultCount(serviceName);
+
+                       if (state.isActive(serviceName)) {
+                               vals[3] = "Active";
+                               if((Integer)vals[2] != 0)
+                                       vals[0] = true;
+                               else
+                                       vals[0] = false;
+                       } else {
+                               vals[0] = false;
+                               vals[3] = "Inactive";
+                       }
+                       model.addRow(vals);
+               }
+
+       }
+
+       /**
+        * 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.
+        */
+       @SuppressWarnings("unchecked")
+       // <editor-fold defaultstate="collapsed" desc="Generated Code">
+       private void initComponents() {
+               setTitle("PSICQUIC Import Result");
+
+               titlePanel = new javax.swing.JPanel();
+               titleLabel = new javax.swing.JLabel();
+               resultScrollPane = new javax.swing.JScrollPane();
+
+               buttonPanel = new javax.swing.JPanel();
+               okButton = new javax.swing.JButton();
+               mergeButton = new javax.swing.JButton();
+               mergeButton = new javax.swing.JButton();
+
+               
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+               titlePanel.setBackground(java.awt.Color.white);
+
+               titleLabel.setFont(new java.awt.Font("SansSerif", 1, 14)); // 
NOI18N
+               titleLabel.setText("PSICQUIC DB Search Result");
+
+               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)
+                                                               
.addContainerGap(200, Short.MAX_VALUE)));
+               
titlePanelLayout.setVerticalGroup(titlePanelLayout.createParallelGroup(
+                               org.jdesktop.layout.GroupLayout.LEADING).add(
+                               titlePanelLayout
+                                               .createSequentialGroup()
+                                               .addContainerGap()
+                                               .add(titleLabel)
+                                               .addContainerGap(
+                                                               
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+                                                               
Short.MAX_VALUE)));
+
+               resultScrollPane.setBackground(java.awt.Color.white);
+
+               resultScrollPane.setViewportView(resultTable);
+
+               buttonPanel.setBackground(java.awt.Color.white);
+
+               okButton.setText("OK");
+               okButton.setPreferredSize(new java.awt.Dimension(70, 26));
+               okButton.addActionListener(new java.awt.event.ActionListener() {
+                       public void actionPerformed(java.awt.event.ActionEvent 
evt) {
+                               okButtonActionPerformed(evt);
+                       }
+               });
+
+               mergeButton.setText("Cancel");
+               mergeButton.setPreferredSize(new java.awt.Dimension(70, 26));
+               mergeButton.addActionListener(new 
java.awt.event.ActionListener() {
+                       public void actionPerformed(java.awt.event.ActionEvent 
evt) {
+                               dispose();
+                       }
+               });
+
+               org.jdesktop.layout.GroupLayout buttonPanelLayout = new 
org.jdesktop.layout.GroupLayout(
+                               buttonPanel);
+               buttonPanel.setLayout(buttonPanelLayout);
+               buttonPanelLayout
+                               .setHorizontalGroup(buttonPanelLayout
+                                               .createParallelGroup(
+                                                               
org.jdesktop.layout.GroupLayout.LEADING)
+                                               
.add(org.jdesktop.layout.GroupLayout.TRAILING,
+                                                               
buttonPanelLayout
+                                                                               
.createSequentialGroup()
+                                                                               
.addContainerGap(450, Short.MAX_VALUE)
+                                                                               
.add(mergeButton,
+                                                                               
                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(okButton,
+                                                                               
                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+                                                                               
                55,
+                                                                               
                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                                                                               
.addContainerGap()));
+               buttonPanelLayout
+                               .setVerticalGroup(buttonPanelLayout
+                                               .createParallelGroup(
+                                                               
org.jdesktop.layout.GroupLayout.LEADING)
+                                               
.add(org.jdesktop.layout.GroupLayout.TRAILING,
+                                                               
buttonPanelLayout
+                                                                               
.createSequentialGroup()
+                                                                               
.addContainerGap(
+                                                                               
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+                                                                               
                Short.MAX_VALUE)
+                                                                               
.add(buttonPanelLayout
+                                                                               
                .createParallelGroup(
+                                                                               
                                org.jdesktop.layout.GroupLayout.BASELINE)
+                                                                               
                .add(okButton,
+                                                                               
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+                                                                               
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+                                                                               
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                                                                               
                .add(mergeButton,
+                                                                               
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+                                                                               
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+                                                                               
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+                                                                               
.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(resultScrollPane,
+                                               
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 480,
+                                               Short.MAX_VALUE)
+                               .add(buttonPanel, 
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(resultScrollPane,
+                                                               
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+                                                               250, 
Short.MAX_VALUE)
+                                               .addPreferredGap(
+                                                               
org.jdesktop.layout.LayoutStyle.RELATED)
+                                               .add(buttonPanel,
+                                                               
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+                                                               
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+                                                               
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
+
+               pack();
+       }// </editor-fold>
+
+       private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
+               this.dispose();
+       }
+
+       // Variables declaration - do not modify
+       private javax.swing.JPanel buttonPanel;
+       private javax.swing.JButton mergeButton;
+       private javax.swing.JButton okButton;
+       private javax.swing.JScrollPane resultScrollPane;
+       private javax.swing.JTable resultTable;
+       private javax.swing.JLabel titleLabel;
+       private javax.swing.JPanel titlePanel;
+
+       // End of variables declaration
+
+       static class SearchResultTableRenderer implements TableCellRenderer {
+
+               public SearchResultTableRenderer() {
+               }
+
+               public Component getTableCellRendererComponent(JTable table,
+                               Object value, boolean isSelected, boolean 
hasFocus, int row,
+                               int column) {
+
+                       if (value == null)
+                               return null;
+
+                       Boolean target = (Boolean) 
table.getModel().getValueAt(row, 0);
+                       
+                       if (column == 0) {
+                               JCheckBox checkBox = new JCheckBox();
+                               checkBox.setSelected((Boolean) value);
+                               if (target == false)
+                                       return checkBox;
+                       } else {
+                               JLabel label = new JLabel(value.toString());
+
+                               if (target == false) {
+                                       label.setForeground(Color.red);
+                               }
+                               return label;
+                       }
+
+                       return null;
+
+               }
+       }
+
+}

Modified: 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/test/org/cytoscape/webservice/psicquic/test/RegistoryManagerTest.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/test/org/cytoscape/webservice/psicquic/test/RegistoryManagerTest.java
      2010-07-27 23:27:42 UTC (rev 21041)
+++ 
csplugins/trunk/ucsd/kono/PSIQUICUniversalClient/test/org/cytoscape/webservice/psicquic/test/RegistoryManagerTest.java
      2010-07-28 02:12:38 UTC (rev 21042)
@@ -22,9 +22,8 @@
        
        @Test
        public void accessRegistory() throws Exception {
-               RegistryManager rm = new RegistryManager();
                
-               assertNotNull(rm.getRegistry());
+               assertNotNull(RegistryManager.getManager().getActiveServices());
        }
 
 }

-- 
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.

Reply via email to