⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphicswrapper.java

📁 请认真阅读您的文件包然后写出其具体功能(至少要20个字)。尽量不要让站长把时间都花费在为您修正说明上。压缩包解压时不能有密码。系统会自动删除debug和release目录
💻 JAVA
字号:
package de.tsr.jsol.gui;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

public class GraphicsWrapper implements IGraphicsWrapper {
	private Graphics _g;
	private int _xOffset;
	private int _yOffset;
	
	public GraphicsWrapper(Graphics g, int xOffset, int yOffset ) {
		_g = g;
		_xOffset = xOffset;
		_yOffset = yOffset;
	}
	
	public void drawRect( int x, int y, int w, int h ) {
		_g.drawRect( _xOffset+x, _yOffset+y, w, h );
	}
	
	public void drawString( String text, int x, int y, int anchor ) {
		_g.drawString( text, _xOffset+x, _yOffset+y, anchor );
	}
	
	public void setColor( int r, int g, int b ) {
		_g.setColor( r, g, b );
	}
	
	public void clearRect( int x, int y, int w, int h ) {
		_g.setColor( 255,255,255 );
		_g.fillRect(_xOffset+x,_yOffset+y,w,h);
		_g.setColor( 0,0,0 );
	}	
	
	public void fillRect(int x, int y, int w, int h) {
		_g.fillRect(_xOffset+x,_yOffset+y,w,h);
	}
	public void setStrokeStyle(int style) {
		_g.setStrokeStyle( style );
	}
    public void drawImage(Image image, int x, int y, int anchor) {
        _g.drawImage(image, _xOffset+x, _yOffset+y, anchor);
    }
}

⌨️ 快捷键说明

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