paintevent.java

来自「java virtual machince kaffe」· Java 代码 · 共 64 行

JAVA
64
字号
package java.awt.event;import java.awt.Component;import java.awt.Rectangle;public class PaintEvent  extends ComponentEvent{	protected int x;	protected int y;	protected int width;	protected int height;	public static final int PAINT = 800;	public static final int PAINT_FIRST = 800;	public static final int PAINT_LAST = 801;	public static final int UPDATE = 801;	private static final long serialVersionUID = 1267492026433337593L;public PaintEvent ( Component src, int evtId, Rectangle updateRect ) {	super( src, evtId);	x = updateRect.x;	y = updateRect.y;	width = updateRect.width;	height = updateRect.height;}protected PaintEvent ( Component src, int evtId, int x, int y, int width, int height ) {	super( src, evtId);	this.x = x;	this.y = y;	this.width = width;	this.height = height;}public Rectangle getUpdateRect() {	return new Rectangle( x, y, width, height);}protected boolean isLiveEventFor ( Object src ) {	return (source == src);}public String paramString () {	String ps;		if ( id == PAINT ) ps = "PAINT";	else if ( id == UPDATE ) ps = "UPDATE";	else ps = "unknown Paint";		ps += " ["+x+','+y+','+width+','+height+"]";		return ps;}public void setUpdateRect( Rectangle r ) {	x = r.x;	y = r.y;	width = r.width;	height = r.height;}}

⌨️ 快捷键说明

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