X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fclient%2Fpicking%2FMouseOverMessage.java;h=2cb85316b329de0d9530d6bbfade93ab0842642e;hb=f5306591821b5f6d4e381ff30b647bd149d51f43;hp=d14dc226a8f1afd28d852719d04b88f55dbe69cd;hpb=f46a9401190f34549d6c1bef0c2ce8a920cab83d;p=vamsas.git diff --git a/src/uk/ac/vamsas/client/picking/MouseOverMessage.java b/src/uk/ac/vamsas/client/picking/MouseOverMessage.java index d14dc22..2cb8531 100644 --- a/src/uk/ac/vamsas/client/picking/MouseOverMessage.java +++ b/src/uk/ac/vamsas/client/picking/MouseOverMessage.java @@ -20,8 +20,8 @@ public class MouseOverMessage extends Message this.vorbaID = vorbaID; this.position = position; - message = "MOUSEOVER_" - + "vorbaID=" + vorbaID + "_" + "position=" + position; + message = "MOUSEOVER\t" + + "vorbaID=" + vorbaID + "\t" + "position=" + position; } /** @@ -32,7 +32,30 @@ public class MouseOverMessage extends Message MouseOverMessage(String str) throws Exception { - String[] elements = str.split("_"); + message = str; + String[] elements = str.split("\t"); + + for (int i = 0; i < elements.length; i++) + { + if (elements[i].startsWith("vorbaID=")) + vorbaID = elements[i].substring(8); + else if (elements[i].startsWith("position=")) + position = Integer.parseInt(elements[i].substring(9)); + } } + + /** + * Returns the VAMSAS object ID associated with this message. + * @return the VAMSAS object ID associated with this message + */ + public String getVorbaID() + { return vorbaID; } + + /** + * Returns the position value associated with this message. + * @return the position value associated with this message + */ + public int getPosition() + { return position; } } \ No newline at end of file