actionevt.java

来自「kaffe是一个java虚拟机的源代码。里面包含了一些java例程和标准的jav」· Java 代码 · 共 51 行

JAVA
51
字号
package java.awt;class ActionEvt  extends java.awt.event.ActionEvent{	private static ActionEvt cache;ActionEvt ( Object src, int evtId, String cmd, int mod ) {	super( src, evtId, cmd, mod);}protected void dispatch () {	if ( source instanceof Component ){		((Component)source).process( this);	}	else if ( source instanceof MenuItem ){		((MenuItem)source).process( this);	}	if ( (Defaults.RecycleEvents & AWTEvent.ACTION_EVENT_MASK) != 0 )	recycle();}static synchronized ActionEvt getEvent ( Object source, int id, String cmd, int mods ){	if ( cache == null ){		return new ActionEvt( source, id, cmd, mods);	}	else {		ActionEvt e = cache;		cache = (ActionEvt)e.next;		e.next = null;				e.source = source;		e.id = id;		e.cmd = cmd;		e.mods = mods;				return e;	}	}protected void recycle () {	synchronized ( ActionEvt.class ) {		source = null;		next = cache;			cache = this;	}}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?