?? 70ff6dcce79d001d1f0cc1975aa68991
字號:
package com.misoo.pkaz;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
public class Node {
public static int x;
public static int y;
private Paint paint= new Paint();
private String name, sex;
public Node(String na, String sx) {
name = na;
sex = sx;
}
public void draw(Canvas canvas){
paint.setAntiAlias(true);
paint.setTextSize(16);
if( sex.contains("female")){
paint.setColor(Color.RED);
canvas.drawCircle(x-5, y-5, 5, paint);
}
else {
paint.setColor(Color.BLUE);
canvas.drawRect(x-10, y-10, x, y, paint);
}
canvas.drawText(name, x+10, y, paint);
y += 20;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -