2014-10-22 10:13:16 +04:00
|
|
|
package gfx;
|
|
|
|
|
|
|
|
import javax.microedition.lcdui.*;
|
|
|
|
import javax.microedition.midlet.*;
|
|
|
|
|
|
|
|
public class DrawAndFillRoundRectTest extends MIDlet {
|
|
|
|
private Display display;
|
|
|
|
|
|
|
|
class TestCanvas extends Canvas {
|
|
|
|
protected void paint(Graphics g) {
|
2015-01-05 10:54:46 +03:00
|
|
|
g.setColor(0x00FFFFFF);
|
|
|
|
g.fillRect(0, 0, getWidth(), getHeight());
|
|
|
|
|
2014-10-22 10:13:16 +04:00
|
|
|
g.setColor(255, 0, 0);
|
|
|
|
g.drawRoundRect(0, 0, getWidth(), getHeight(), getWidth() / 2, getHeight() / 2);
|
|
|
|
g.setColor(0, 0, 255);
|
|
|
|
g.fillRoundRect(20, 30, 200, 80, 100, 80);
|
|
|
|
System.out.println("PAINTED");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public DrawAndFillRoundRectTest() {
|
|
|
|
display = Display.getDisplay(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void startApp() {
|
|
|
|
TestCanvas test = new TestCanvas();
|
2014-12-31 15:34:19 +03:00
|
|
|
test.setFullScreenMode(true);
|
2014-10-22 10:13:16 +04:00
|
|
|
display.setCurrent(test);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void pauseApp() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void destroyApp(boolean unconditional) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|