Exemplo n.º 1
0
 public static final boolean ExecMouseEvent(GxwCbkHost host, MouseEvent e) {
   int button = e.getButton(), val = 0;
   if (button == MouseEvent.BUTTON1) val = IptMouseBtn_.Left.Val();
   if (button == MouseEvent.BUTTON2) val |= IptMouseBtn_.Middle.Val();
   if (button == MouseEvent.BUTTON3) val |= IptMouseBtn_.Right.Val();
   IptEvtDataMouse data =
       IptEvtDataMouse.new_(IptMouseBtn_.api_(val), IptMouseWheel_.None, e.getX(), e.getY());
   boolean rv = true;
   int id = e.getID();
   if (id == MouseEvent.MOUSE_PRESSED) rv = host.MouseDownCbk(data);
   else if (id == MouseEvent.MOUSE_RELEASED) rv = host.MouseUpCbk(data);
   return rv;
 }
Exemplo n.º 2
0
 public static final boolean ExecMouseWheel(GxwCbkHost host, MouseWheelEvent e) {
   IptMouseWheel wheel = e.getWheelRotation() < 0 ? IptMouseWheel_.Up : IptMouseWheel_.Down;
   return host.MouseWheelCbk(IptEvtDataMouse.new_(IptMouseBtn_.None, wheel, e.getX(), e.getY()));
 }