Example #1
0
  /* (non-Javadoc)
   * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
   */
  public void mouseReleased(MouseEvent e) {
    if (e.getButton() == mousePressedButton) {
      InputCursor m = ActiveCursorPool.getInstance().getActiveCursorByID(lastUsedMouseID);
      MTMouseInputEvt te =
          new MTMouseInputEvt(
              this, e.getModifiers(), e.getX(), e.getY(), MTFingerInputEvt.INPUT_ENDED, m);

      // System.out.println("MouseSource Finger UP, Motion ID: " + m.getId());
      this.enqueueInputEvent(te);
      ActiveCursorPool.getInstance().removeCursor((lastUsedMouseID));
      mouseBusy = false;
    }
  }
Example #2
0
 /* (non-Javadoc)
  * @see java.awt.event.MouseMotionListener#mouseDragged(java.awt.event.MouseEvent)
  */
 public void mouseDragged(MouseEvent e) {
   try {
     InputCursor m = ActiveCursorPool.getInstance().getActiveCursorByID(lastUsedMouseID);
     if (m != null) {
       MTMouseInputEvt te =
           new MTMouseInputEvt(
               this, e.getModifiers(), e.getX(), e.getY(), MTFingerInputEvt.INPUT_UPDATED, m);
       //				System.out.println("MouseSource Finger UPDATE, Motion ID: " + m.getId());
       this.enqueueInputEvent(te);
     }
   } catch (Exception err) {
     err.printStackTrace();
   }
 }
Example #3
0
  /* (non-Javadoc)
   * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
   */
  public void mousePressed(MouseEvent e) {
    if (!mouseBusy) {
      mousePressedButton = e.getButton();
      mouseBusy = true;

      InputCursor m = new InputCursor();
      MTMouseInputEvt te =
          new MTMouseInputEvt(
              this, e.getModifiers(), e.getX(), e.getY(), MTFingerInputEvt.INPUT_STARTED, m);

      lastUsedMouseID = m.getId();
      ActiveCursorPool.getInstance().putActiveCursor(lastUsedMouseID, m);
      //			System.out.println("MouseSource Finger DOWN, Motion ID: " + m.getId());
      this.enqueueInputEvent(te);
    }
  }