Ho il compito di scrivere il programma che consente agli utenti di disegnare stelle, che possono differire per dimensioni e quantità di braccia. Quando avevo a che fare con le stelle di base che stavo facendo con GeneralPath e tabelle di punti:Disegno di forme a stella con parametri variabili
int xPoints[] = { 55, 67, 109, 73, 83, 55, 27, 37, 1, 43 };
int yPoints[] = { 0, 36, 36, 54, 96, 72, 96, 54, 36, 36 };
Graphics2D g2d = (Graphics2D) g;
GeneralPath star = new GeneralPath();
star.moveTo(xPoints[ 0 ], yPoints[ 0 ]);
for (int k = 1; k < xPoints.length; k++)
star.lineTo(xPoints[ k ], yPoints[ k ]);
star.closePath();
g2d.fill(star);
Quale metodo devo scegliere per disegnare stelle con raggio interno ed esterno variabile, così come diverse quantità di armi? Questo è ciò che dovrei ottenere:
alt text http://img228.imageshack.us/img228/6427/lab6c.jpg