// TODO: these could be optimised
private void initShape() {
        // TODO: these could be optimised
        float cx = dim * 0.5f;
        float cy = dim * 0.5f + 1;
        float r  = (dim - 3) * 0.5f;
        float rh = r * 0.4f;
        for (int i = 0; i < 10; i++) {
            double ang = Math.PI/180 * (i * 36 - 90);
            float ri   = i % 2 == 0 ? r : rh;
            float x    = (float) Math.cos(ang) * ri + cx;
            float y    = (float) Math.sin(ang) * ri + cy;
            if (i == 0) {
                gp.moveTo(x, y);
            } else {
                gp.lineTo(x, y);
            }
        }
        gp.closePath();
    }
private void initShape() {
// TODO: these could be optimised
float cx = dim * 0.5f;
float cy = dim * 0.5f + 1;
private void initShape() {
// TODO: these could be optimised
float cx = dim * 0.5f;
float cy = dim * 0.5f + 1;
float r = (dim - 3) * 0.5f;
float rh = r * 0.4f;
for (int i = 0; i < 10; i++) {
double ang = Math.PI/180 * (i * 36 - 90);
float ri = i % 2 == 0 ? r : rh;
float x = (float) Math.cos(ang) * ri + cx;
float y = (float) Math.sin(ang) * ri + cy;
if (i == 0) {
private void initShape() {
// TODO: these could be optimised
float cx = dim * 0.5f;
float cy = dim * 0.5f + 1;
float r = (dim - 3) * 0.5f;
float rh = r * 0.4f;
for (int i = 0; i < 10; i++) {
double ang = Math.PI/180 * (i * 36 - 90);
float ri = i % 2 == 0 ? r : rh;
float x = (float) Math.cos(ang) * ri + cx;
float y = (float) Math.sin(ang) * ri + cy;
if (i == 0) {
gp.moveTo(x, y);
} else {
gp.lineTo(x, y);
}
}
gp.closePath();
}