package mobileapplication7;
import java.util.Random;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Bartosz
*/
public class Plotno
extends Canvas {
long start, stop;
public Plotno() {
}
start
= System.
currentTimeMillis(); // start timing
for (int i = 0; i < 100; i++) {
Triangle t = new Triangle(r.nextInt(getWidth() + 1), r.nextInt(getWidth() + 1), r.nextInt(getWidth() + 1), r.nextInt(getHeight() + 1), r.nextInt(getHeight() + 1), r.nextInt(getHeight() + 1));
g.setColor(r.nextInt(256), r.nextInt(256), r.nextInt(256));
g.fillTriangle(t.getX1(), t.getY1(), t.getX2(), t.getY2(), t.getX3(), t.getY3());
}
stop
= System.
currentTimeMillis(); // stop timing
napis
= Long.
toString(stop
- start
);
g.setColor(0, 0, 0);
g.
setFont(Font.
getFont(Font.
FACE_PROPORTIONAL,
Font.
STYLE_BOLD,
Font.
SIZE_MEDIUM));
g.
drawString("Czas rysowania: " + napis
+ "ms",
this.
getWidth() / 2,
this.
getHeight() / 4,
Graphics.
BASELINE | Graphics.
HCENTER);
}
// protected void keyPressed(int kod) {
// switch (kod) {
// case KEY_NUM2:
// napis = "góra";
// break;
// case KEY_NUM8:
// napis = "dół";
// break;
// case KEY_NUM4:
// napis = "lewo";
// break;
// case KEY_NUM6:
// napis = "prawo";
// break;
// }
// this.repaint();
// serviceRepaints();
// }
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}