当前位置: 首页>>代码示例>>Java>>正文


Java NativeMouseEvent.getID方法代码示例

本文整理汇总了Java中org.jnativehook.mouse.NativeMouseEvent.getID方法的典型用法代码示例。如果您正苦于以下问题:Java NativeMouseEvent.getID方法的具体用法?Java NativeMouseEvent.getID怎么用?Java NativeMouseEvent.getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jnativehook.mouse.NativeMouseEvent的用法示例。


在下文中一共展示了NativeMouseEvent.getID方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processButtonEvent

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
/**
 * Processes native mouse button events by dispatching them to all registered
 * <code>NativeMouseListener</code> objects.
 *
 * @param e the <code>NativeMouseEvent</code> to dispatch.
 * @see NativeMouseEvent
 * @see NativeMouseListener
 * @see #addNativeMouseListener(NativeMouseListener)
 */
private void processButtonEvent(NativeMouseEvent e) {
	NativeMouseListener[] listeners = eventListeners.getListeners(NativeMouseListener.class);

	for (int i = 0; i < listeners.length; i++) {
		switch (e.getID()) {
			case NativeMouseEvent.NATIVE_MOUSE_CLICKED:
				listeners[i].nativeMouseClicked(e);
				break;

			case NativeMouseEvent.NATIVE_MOUSE_PRESSED:
				listeners[i].nativeMousePressed(e);
				break;

			case NativeMouseEvent.NATIVE_MOUSE_RELEASED:
				listeners[i].nativeMouseReleased(e);
				break;
		}
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:29,代码来源:GlobalScreen.java

示例2: processMouseEvent

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
/**
 * Processes native mouse events by dispatching them to all registered
 * <code>NativeMouseListener</code> objects.
 *
 * @param e the <code>NativeMouseEvent</code> to dispatch.
 * @see NativeMouseEvent
 * @see NativeMouseMotionListener
 * @see #addNativeMouseMotionListener(NativeMouseMotionListener)
 */
private void processMouseEvent(NativeMouseEvent e) {
	NativeMouseMotionListener[] listeners = eventListeners.getListeners(NativeMouseMotionListener.class);

	for (int i = 0; i < listeners.length; i++) {
		switch (e.getID()) {
			case NativeMouseEvent.NATIVE_MOUSE_MOVED:
				listeners[i].nativeMouseMoved(e);
				break;

			case NativeMouseEvent.NATIVE_MOUSE_DRAGGED:
				listeners[i].nativeMouseDragged(e);
				break;
		}
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:25,代码来源:GlobalScreen.java

示例3: nativeMouseClicked

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseClicked(NativeMouseEvent e) {
	System.out.println("Received " + e.paramString());

	if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_CLICKED) {
		throw new IllegalArgumentException("Invalid event type received for nativeMouseClicked!");
	}

	lastEvent = e;

	synchronized(this) {
		this.notifyAll();
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:14,代码来源:NativeMouseInputListenerImpl.java

示例4: nativeMousePressed

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMousePressed(NativeMouseEvent e) {
	System.out.println("Received " + e.paramString());

	if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_PRESSED) {
		throw new IllegalArgumentException("Invalid event type received for nativeKeyPressed!");
	}

	lastEvent = e;

	synchronized(this) {
		this.notifyAll();
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:14,代码来源:NativeMouseInputListenerImpl.java

示例5: nativeMouseReleased

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseReleased(NativeMouseEvent e) {
	System.out.println("Received " + e.paramString());

	if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_RELEASED) {
		throw new IllegalArgumentException("Invalid event type received for nativeMouseReleased!");
	}

	lastEvent = e;

	synchronized(this) {
		this.notifyAll();
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:14,代码来源:NativeMouseInputListenerImpl.java

示例6: nativeMouseMoved

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseMoved(NativeMouseEvent e) {
	System.out.println("Received " + e.paramString());

	if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_MOVED) {
		throw new IllegalArgumentException("Invalid event type received for nativeMouseMoved!");
	}

	lastEvent = e;

	synchronized(this) {
		this.notifyAll();
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:14,代码来源:NativeMouseInputListenerImpl.java

示例7: nativeMouseDragged

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseDragged(NativeMouseEvent e) {
	System.out.println("Received " + e.paramString());

	if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_DRAGGED) {
		throw new IllegalArgumentException("Invalid event type received" +
				"" +
				" for nativeMouseDragged!");
	}

	lastEvent = e;

	synchronized(this) {
		this.notifyAll();
	}
}
 
开发者ID:kwhat,项目名称:jnativehook,代码行数:16,代码来源:NativeMouseInputListenerImpl.java

示例8: processMouseEvent

import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
/**
 * Processes native mouse events by dispatching them to all registered
 * <code>NativeMouseListener</code> objects.
 *
 * @param e the <code>NativeMouseEvent</code> to dispatch.
 * @see NativeMouseEvent
 * @see NativeMouseListener
 * @see #addNativeMouseListener(NativeMouseListener)
 */
protected void processMouseEvent(NativeMouseEvent e) {
	int id = e.getID();

	EventListener[] listeners;
	if (id == NativeMouseEvent.NATIVE_MOUSE_MOVED || id == NativeMouseEvent.NATIVE_MOUSE_DRAGGED) {
		listeners = eventListeners.getListeners(NativeMouseMotionListener.class);
	}
	else {
		listeners = eventListeners.getListeners(NativeMouseListener.class);
	}

	for (int i = 0; i < listeners.length; i++) {
		switch (id) {
			case NativeMouseEvent.NATIVE_MOUSE_CLICKED:
				((NativeMouseListener) listeners[i]).nativeMouseClicked(e);
				break;

			case NativeMouseEvent.NATIVE_MOUSE_PRESSED:
				((NativeMouseListener) listeners[i]).nativeMousePressed(e);
				break;

			case NativeMouseEvent.NATIVE_MOUSE_RELEASED:
				((NativeMouseListener) listeners[i]).nativeMouseReleased(e);
				break;

			case NativeMouseEvent.NATIVE_MOUSE_MOVED:
				((NativeMouseMotionListener) listeners[i]).nativeMouseMoved(e);
				break;

			case NativeMouseEvent.NATIVE_MOUSE_DRAGGED:
				((NativeMouseMotionListener) listeners[i]).nativeMouseDragged(e);
				break;
		}
	}
}
 
开发者ID:Hual,项目名称:UploadR,代码行数:45,代码来源:GlobalScreen.java


注:本文中的org.jnativehook.mouse.NativeMouseEvent.getID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。