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


Java Canvas.dispatchEvent方法代码示例

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


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

示例1: mouseClicked

import java.awt.Canvas; //导入方法依赖的package包/类
public void mouseClicked(MouseEvent e) {
	if (inputEnabled && client != null) {
		e.setSource(client);
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:9,代码来源:InputListeners.java

示例2: mousePressed

import java.awt.Canvas; //导入方法依赖的package包/类
public void mousePressed(MouseEvent e) {
	if (inputEnabled && client != null) {
		e.setSource(client);
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null) {
			if (!hasFocus)
				canvas.requestFocus();

			canvas.dispatchEvent(e);
		}
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:13,代码来源:InputListeners.java

示例3: mouseReleased

import java.awt.Canvas; //导入方法依赖的package包/类
public void mouseReleased(MouseEvent e) {
	if (inputEnabled && client != null) {
		e.setSource(client);
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:9,代码来源:InputListeners.java

示例4: mouseEntered

import java.awt.Canvas; //导入方法依赖的package包/类
public void mouseEntered(MouseEvent e) {
	e.setSource(client);
	if (inputEnabled && client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:9,代码来源:InputListeners.java

示例5: mouseExited

import java.awt.Canvas; //导入方法依赖的package包/类
public void mouseExited(MouseEvent e) {
	e.setSource(client);
	if (inputEnabled && client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:9,代码来源:InputListeners.java

示例6: mouseDragged

import java.awt.Canvas; //导入方法依赖的package包/类
public void mouseDragged(MouseEvent e) {
	e.setSource(client);
	if (inputEnabled && client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:9,代码来源:InputListeners.java

示例7: mouseMoved

import java.awt.Canvas; //导入方法依赖的package包/类
public void mouseMoved(MouseEvent e) {
	e.setSource(client);
	if (inputEnabled && client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:9,代码来源:InputListeners.java

示例8: mouseWheelMoved

import java.awt.Canvas; //导入方法依赖的package包/类
public void mouseWheelMoved(MouseWheelEvent e) {
	e.setSource(client);
	if (inputEnabled && client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:9,代码来源:InputListeners.java

示例9: keyTyped

import java.awt.Canvas; //导入方法依赖的package包/类
public void keyTyped(KeyEvent e) {
	if (Settings.NEW_FKEYS) {
		switch (e.getKeyCode()) {
		case KeyEvent.VK_F2:
			//combat
			e.setKeyCode(KeyEvent.VK_F1);
			break;
		case KeyEvent.VK_F1:
			//inv
			e.setKeyCode(KeyEvent.VK_ESCAPE);
			break;
		case KeyEvent.VK_F3:
			//pray
			e.setKeyCode(KeyEvent.VK_F5);
			break;
		case KeyEvent.VK_F4:
			//magic
			e.setKeyCode(KeyEvent.VK_F6);
			break;

		case KeyEvent.VK_F5:
			//equip
			e.setKeyCode(KeyEvent.VK_F4);
			break;
		}
	}

	e.setSource(client);
	if (client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:35,代码来源:InputListeners.java

示例10: keyPressed

import java.awt.Canvas; //导入方法依赖的package包/类
public void keyPressed(KeyEvent e) {
	if (Settings.NEW_FKEYS) {
		switch (e.getKeyCode()) {
		case KeyEvent.VK_F2:
			//combat
			e.setKeyCode(KeyEvent.VK_F1);
			break;
		case KeyEvent.VK_F1:
			//inv
			e.setKeyCode(KeyEvent.VK_ESCAPE);
			break;
		case KeyEvent.VK_F3:
			//pray
			e.setKeyCode(KeyEvent.VK_F5);
			break;
		case KeyEvent.VK_F4:
			//magic
			e.setKeyCode(KeyEvent.VK_F6);
			break;

		case KeyEvent.VK_F5:
			//equip
			e.setKeyCode(KeyEvent.VK_F4);
			break;
		}
	}
	
	e.setSource(client);
	if (client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:35,代码来源:InputListeners.java

示例11: keyReleased

import java.awt.Canvas; //导入方法依赖的package包/类
public void keyReleased(KeyEvent e) {
	if (Settings.NEW_FKEYS) {
		switch (e.getKeyCode()) {
		case KeyEvent.VK_F2:
			//combat
			e.setKeyCode(KeyEvent.VK_F1);
			break;
		case KeyEvent.VK_F1:
			//inv
			e.setKeyCode(KeyEvent.VK_ESCAPE);
			break;
		case KeyEvent.VK_F3:
			//pray
			e.setKeyCode(KeyEvent.VK_F5);
			break;
		case KeyEvent.VK_F4:
			//magic
			e.setKeyCode(KeyEvent.VK_F6);
			break;

		case KeyEvent.VK_F5:
			//equip
			e.setKeyCode(KeyEvent.VK_F4);
			break;
		}
	}
	
	e.setSource(client);
	if (client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null) {
			canvas.dispatchEvent(e);
		}
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:36,代码来源:InputListeners.java

示例12: focusGained

import java.awt.Canvas; //导入方法依赖的package包/类
public void focusGained(FocusEvent e) {
	hasFocus = true;
	e.setSource(client);
	if (inputEnabled && client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:10,代码来源:InputListeners.java

示例13: focusLost

import java.awt.Canvas; //导入方法依赖的package包/类
public void focusLost(FocusEvent e) {
	hasFocus = false;
	e.setSource(client);
	if (inputEnabled && client != null) {
		Canvas canvas = (Canvas) client.getComponent(0);
		if (canvas != null)
			canvas.dispatchEvent(e);
	}
}
 
开发者ID:LoveLeAnon,项目名称:OSLoader,代码行数:10,代码来源:InputListeners.java


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