📄 graphicswrapper.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 + -