If you think the Android project Processing-Android-Eclipse-Demos listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- *//*fromwww.java2s.com*//*
Part of the Processing project - http://processing.org
Copyright (c) 2012 The Processing Foundation
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/package com.processing.event;
//import processing.core.PConstants;
publicclass MouseEvent extends Event {
staticpublicfinalint PRESS = 1;
staticpublicfinalint RELEASE = 2;
staticpublicfinalint CLICK = 3;
staticpublicfinalint DRAG = 4;
staticpublicfinalint MOVE = 5;
staticpublicfinalint ENTER = 6;
staticpublicfinalint EXIT = 7;
protectedint x, y;
protectedint button;
protectedint clickCount;
// public MouseEvent(int x, int y) {
// this(null,
// System.currentTimeMillis(), PRESSED, 0,
// x, y, PConstants.LEFT, 1);
// }
public MouseEvent(Object nativeObject,
long millis, int action, int modifiers,
int x, int y, int button, int clickCount) {
super(nativeObject, millis, action, modifiers);
this.flavor = MOUSE;
this.x = x;
this.y = y;
this.button = button;
this.clickCount = clickCount;
}
publicint getX() {
return x;
}
publicint getY() {
return y;
}
/** Which button was pressed, either LEFT, CENTER, or RIGHT. */publicint getButton() {
return button;
}
// public void setButton(int button) {
// this.button = button;
// }
publicint getClickCount() {
return clickCount;
}
// public void setClickCount(int clickCount) {
// this.clickCount = clickCount;
// }
}