本文整理匯總了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);
}
}