public MultiPointerServer(String iEventHeapName, String iMachineName) {
    try {
      mMachineName = iMachineName;
      mEventHeap = new EventHeap(iEventHeapName);
      nameToPointTable = new Hashtable();
      isRunning = false;
      robot = new Robot();

      Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
      LEAVE_MAX_X = dim.width;
      LEAVE_MAX_Y = dim.height;
    } catch (AWTException robotExp) {
      System.out.println(robotExp);
      System.exit(-1);
    }
  }
Esempio n. 2
0
 public Shake(String ip, String proxyID, String cmprt) {
   try {
     eventHeap = new EventHeap(ip);
     template = new Event[1];
     template[0] = new Event("Shake"); // the Events to be fetched should be of type Shake
     template[0].addField(
         "Command",
         String.class,
         FieldValueTypes.FORMAL,
         FieldValueTypes
             .FORMAL); // the events to be fetched should have a field Command of an Integer value
     // type
     this.proxyID = proxyID;
     this.comPort = cmprt;
     initSerial();
     eventHeap.registerForEvents(template, this); // register to receive events of type template
   } catch (Exception ex) {
     ex.printStackTrace();
     System.exit(-1);
   }
 }