X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fvamsas%2Fclient%2FClientDocument.java;h=66eaef0bfed29344215200811fba9f616c80d9d7;hb=e2773f79b74e2536dd83d8db802cdece4d9567b9;hp=d3a38866b7fd196282c3e8e2a6c6361e37ef7689;hpb=4e2e8ec4215ad0f0864048e3eb44fdb7ec494e15;p=vamsas.git 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