1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| public void paint(Graphics g) {
super.paint(g);
//on teste si il y a des evenements
if (tousRectangle == null)
return;
//on dessine les rectangles
for(int i = 0; i < tousRectangle.length;i++) {
g.setColor(Color.LIGHT_GRAY);
g.fill3DRect(tousRectangle[i].x,tousRectangle[i].y,
tousRectangle[i].width,tousRectangle[i].height, true);
g.setColor(Color.black);
String sujet = ((Events)list.get(i)).getInfo()[1]; //contient le sujet
if(A TROUVER) {//depassera du rectangle
//la fin sera remplace par ".."
String tmp = sujet.substring(16);
sujet =sujet.replace(tmp, "..");
}
g.drawString(sujet, tousRectangle[i].x + 5, tousRectangle[i].y + 15);
}
} |
Partager