Picking API now has message classes and basic implementation of interfaces (for its...
[vamsas.git] / src / uk / ac / vamsas / client / picking / MouseOverMessage.java
diff --git a/src/uk/ac/vamsas/client/picking/MouseOverMessage.java b/src/uk/ac/vamsas/client/picking/MouseOverMessage.java
new file mode 100644 (file)
index 0000000..d14dc22
--- /dev/null
@@ -0,0 +1,38 @@
+package uk.ac.vamsas.client.picking;\r
+\r
+/**\r
+ * Message class that can be used to send mouse over events.\r
+ */\r
+public class MouseOverMessage extends Message\r
+{\r
+       private String vorbaID;\r
+       private int position;\r
+       \r
+       /**\r
+        * Constructs a new mouse over message.\r
+        * @param vorbaID the VAMSAS object ID of the event's source (usually an\r
+        * alignment or alignment sequence)\r
+        * @param position a position on the source in its coordinate system (ie a\r
+        * column or nucleotide/residue position)\r
+        */\r
+       public MouseOverMessage(String vorbaID, int position)\r
+       {\r
+               this.vorbaID = vorbaID;\r
+               this.position = position;\r
+               \r
+               message = "MOUSEOVER_"\r
+                       + "vorbaID=" + vorbaID + "_" + "position=" + position;\r
+       }\r
+       \r
+       /**\r
+        * Constructs a new mouse over message from its underlying string format.\r
+        * @param str the string representation of an instance of this object\r
+        * @throws java.lang.Exception if the message cannot be reconstructed\r
+        */\r
+       MouseOverMessage(String str)\r
+               throws Exception\r
+       {\r
+               String[] elements = str.split("_");\r
+               \r
+       }\r
+}
\ No newline at end of file