In our company, I created an automatic J2ME-> Android converter. Comparing J2ME graphics (javax.microedition.ldcui.Graphics) with Android graphics (android.graphics.Canvas) is very simple.
setStrokeStyle - change the path effect on a Paint instance
PathEffect EFFECT_DOTTED_STROKE = new DashPathEffect(new float[] {2, 4}, 4);
if (style == SOLID) {
strokePaint.setPathEffect(null);
}
else {
strokePaint.setPathEffect(EFFECT_DOTTED_STROKE);
}
drawRGB - Canvas
public void drawRGB(int[] rgbData, int offset, int scanLength, int x, int y, int width, int height, boolean processAlpha) {
canvas.drawBitmap(rgbData, offset, width, x + translateX, y + translateY, width, height, processAlpha, null);
}
fillTriangle -
public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3) {
Path path = new Path();
path.moveTo(x1 + translateX, y1 + translateY);
path.lineTo(x2 + translateX, y2 + translateY);
path.lineTo(x3 + translateX, y3 + translateY);
path.close();
strokePaint.setStyle(Paint.Style.FILL);
canvas.drawPath(path, strokePaint);
}
java.util.Vector? Android API ...