1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
/* Representation graphique du chemin en utilisant l'objet Graphics
g passé en argument (tracés de segments de droite bleus) */
public void draw(Graphics g)
{
g.setColor(Color.blue);
for (i=0; i<(1-v.size()); i++)
g.drawLine((int)((TPos)v.get(i)).x,(int)((TPos)v.get(i)).y,(int)((TPos)v.get(i+1)).x,(int)((TPos)v.get(i+1)).y);
}
/* Dessin du rectangle englobant en utilisant l'objet Graphics g
passé en argument (tracé d'un rectangle jaune) */
void drawBounds(Graphics g)
{
g.setColor(Color.yellow);
g.drawRect((int)(posMin()).x,(int)(posMin()).y,(int)(posMax()).x,(int)(posMax()).y);
}
} |