00001 package edu.stanford.hci.r3.actions.remote; 00002 00003 import java.net.Socket; 00004 00005 import edu.stanford.hci.r3.PaperToolkit; 00006 import edu.stanford.hci.r3.actions.R3Action; 00007 00025 public class ActionJavaObjectXMLMessenger extends ActionMessenger { 00026 00030 public ActionJavaObjectXMLMessenger(Socket s) { 00031 super(s); 00032 } 00033 00039 public byte[] getMessage(R3Action action) { 00040 String xmlString = PaperToolkit.toXML(action); 00041 // put it all on one line 00042 if (xmlString.contains("\n")) { 00043 xmlString = xmlString.replace("\n", ""); 00044 } 00045 // do not remove spaces!!!! as actions may have paths, which depend on spaces... 00046 return (xmlString + LINE_SEPARATOR).getBytes(); 00047 } 00048 }