From: jprocter Date: Thu, 22 Sep 2005 21:58:56 +0000 (+0000) Subject: refactored Client to simpleClient. Implemented many housekeeping functions. X-Git-Tag: Release_0.2~471 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=20c2d5a36516f2684b272c52c72bf67a65f58388;p=vamsas.git refactored Client to simpleClient. Implemented many housekeeping functions. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@49 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/.externalToolBuilders/Build VamsasClient [Builder].launch b/.externalToolBuilders/Build VamsasClient [Builder].launch index 011b4ea..7b6e116 100644 --- a/.externalToolBuilders/Build VamsasClient [Builder].launch +++ b/.externalToolBuilders/Build VamsasClient [Builder].launch @@ -1,17 +1,20 @@ - + + - - + + + + @@ -24,8 +27,6 @@ - - diff --git a/Build VamsasClient.launch b/Build VamsasClient.launch index e23a073..637e0d0 100644 --- a/Build VamsasClient.launch +++ b/Build VamsasClient.launch @@ -1,16 +1,20 @@ - + - + + + - + + + @@ -23,8 +27,6 @@ - - - - + + diff --git a/Core Object Source VamsasClient.launch b/Core Object Source VamsasClient.launch index 7958957..a3a94f1 100644 --- a/Core Object Source VamsasClient.launch +++ b/Core Object Source VamsasClient.launch @@ -1,8 +1,8 @@ - + @@ -10,7 +10,9 @@ - + + + @@ -23,8 +25,6 @@ - - diff --git a/src/org/vamsas/client/ClientDocument.java b/src/org/vamsas/client/ClientDocument.java index d3a3886..66eaef0 100644 --- a/src/org/vamsas/client/ClientDocument.java +++ b/src/org/vamsas/client/ClientDocument.java @@ -14,26 +14,38 @@ import org.vamsas.objects.core.VamsasDocument; */ public class ClientDocument implements IClientDocument { protected IClient vorba; - - protected VamsasDocument doc; - + protected org.vamsas.objects.core.VAMSAS[] roots; protected byte[] appData; /** * collection of org.vamsas.client.object references */ protected Hashtable vamsasObjects; - + /* * (non-Javadoc) * * @see org.vamsas.client.IClientDocument#getApplicationData() */ + /** + * + * @param data + * @param doc + * @param objects + * @param vorba + */ + protected ClientDocument(byte[] data, VAMSAS[] roots, Hashtable objects, IClient vorba) { + // TODO Auto-generated constructor stub + appData = data; + this.roots =roots; + vamsasObjects = objects; + this.vorba = vorba; + } + public byte[] getApplicationData() { // Look up client byte stash using client and user handle - - return null; + return appData; } /* @@ -64,7 +76,6 @@ public class ClientDocument implements IClientDocument { */ public object[] getVamsasRoots() { // extract root objects - VAMSAS[] roots = doc.getVAMSAS(); if (roots == null) return new VAMSAS[] { new VAMSAS() }; return roots; @@ -75,7 +86,6 @@ public class ClientDocument implements IClientDocument { */ public void setVamsasRoots(VAMSAS[] newroots) { // extract root objects - VAMSAS[] roots = doc.getVAMSAS(); if (newroots != null) { // check newroots for objects that were present in the old document // check to see if the 'old' objects have been modified @@ -100,7 +110,7 @@ public class ClientDocument implements IClientDocument { } } else { throw new Error( - "Client error when using setVamsasRoots : The vorbaId for object " + "SimpleClient error when using setVamsasRoots : The vorbaId for object " + i + " does not refer to an object of type VAMSAS in the current document!"); } @@ -129,11 +139,9 @@ public class ClientDocument implements IClientDocument { * @see org.vamsas.client.IClientDocument#registerObject(org.vamsas.client.object) */ public VorbaId registerObject(object unregistered) { - VorbaId rtn; if (!unregistered.isRegistered()) - unregistered.VorbaId.(rtn=unregistered.__vorba.makeVorbaId()); - else - return unregistered.getVorbaId(); + unregistered.setVorbaId(unregistered.__vorba.makeVorbaId()); + return unregistered.getVorbaId(); } /* * (non-Javadoc) @@ -141,7 +149,12 @@ public VorbaId registerObject(object unregistered) { * @see org.vamsas.client.IClientDocument#registerObjects(org.vamsas.client.object[]) */ public VorbaId[] registerObjects(object[] unregistered) { - // TODO Auto-generated method stub + if (unregistered!=null) { + VorbaId ids[] = new VorbaId[unregistered.length]; + for (int i=0,k=unregistered.length; i