本文整理汇总了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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}