1 package uk.ac.vamsas.client.picking;
\r
4 * Message class that can be used to send mouse over events.
\r
6 public class MouseOverMessage extends Message
\r
8 private String vorbaID;
\r
9 private int position;
\r
12 * Constructs a new mouse over message.
\r
13 * @param vorbaID the VAMSAS object ID of the event's source (usually an
\r
14 * alignment or alignment sequence)
\r
15 * @param position a position on the source in its coordinate system (ie a
\r
16 * column or nucleotide/residue position)
\r
18 public MouseOverMessage(String vorbaID, int position)
\r
20 this.vorbaID = vorbaID;
\r
21 this.position = position;
\r
23 message = "MOUSEOVER\t"
\r
24 + "vorbaID=" + vorbaID + "\t" + "position=" + position;
\r
28 * Constructs a new mouse over message from its underlying string format.
\r
29 * @param str the string representation of an instance of this object
\r
30 * @throws java.lang.Exception if the message cannot be reconstructed
\r
32 MouseOverMessage(String str)
\r
37 String[] elements = str.split("\t");
\r
39 for (int i = 0; i < elements.length; i++)
\r
41 if (elements[i].startsWith("vorbaID="))
\r
42 vorbaID = elements[i].substring(8);
\r
43 else if (elements[i].startsWith("position="))
\r
44 position = Integer.parseInt(elements[i].substring(9));
\r
49 * Returns the VAMSAS object ID associated with this message.
\r
50 * @return the VAMSAS object ID associated with this message
\r
52 public String getVorbaID()
\r
56 * Returns the position value associated with this message.
\r
57 * @return the position value associated with this message
\r
59 public int getPosition()
\r
60 { return position; }
\r