1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
public class Cercle implements UndoableAction {
private Bitmap bitmap = null;
private Canvas canvas = null;
private Point center = null;
private Paint paint = null;
private double x = 10, y = 20;
private static final int rayon = 4;
String name;
public Cercle() {
center = new Point();
}
public Cercle(String name, int x, int y) {
this();
setName(name);
setPosition(x, y);
}
public void doBitmap(int width, int height) {
bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
canvas = new Canvas(bitmap);
paint = new Paint();
paint.setColor(Color.BLACK);
canvas.drawCircle(center.x, center.y, rayon, paint);
}
}
public void setPosition(int x, int y) {
center.x = x;
center.y = y;
}
@Override
public void redo() {
// TODO Auto-generated method stub
}
@Override
public void undo() {
// TODO Auto-generated method stub
}
} |