當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。