public abstract class DocumentViewerMessageHandler extends Object
DocumentViewer.setOutgoingMessageHandler(DocumentViewerMessageHandler).
When a DocumentViewer wishes to send a message,
it can do the following: getOutgoingMessageHandler().handleMessage(...)
DocumentViewer.getIncomingMessageHandler() on
which handleMessage(org.jdom.Element, String, boolean) will be called when a message is
received.| Constructor and Description |
|---|
DocumentViewerMessageHandler() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
handleMessage(org.jdom.Element message,
String senderName,
boolean focusReciever)
Handle an incoming or outgoing message
|
boolean |
setSequenceSelection(SequenceSelection newSelection,
String senderName)
Notifies when the selected sequence or residues has changed in a viewer.
|
public abstract boolean handleMessage(org.jdom.Element message,
String senderName,
boolean focusReciever)
message - the message to handle. This can be any valid XML. It is up to the DocumentViewers to define a DTD for the XML accepted.
For example, SequenceViewer accepts messages such as
<select><sequence>Sequence Name</sequence><sequence>another sequence name</sequence></select>
However, sending a selection message using handleMessage is deprecated. Use setSequenceSelection(SequenceSelection, String) instead.senderName - Some token identifiying the sender, say its class namefocusReciever - true to change the focus to the viewer which accepts the message. Incoming handlers should ignore this parameter.public boolean setSequenceSelection(SequenceSelection newSelection, String senderName)
newSelection - the new sequence selectionsenderName - Some token identifiying the sender, say its class name