1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| public void paintComponent(Graphics g) {
double ratioCourant = ratio;
setSize((int)(largeur*ratioCourant),
(int)(hauteur*ratioCourant));
// Affichage de l'arriere plan (... ou non)
try{
if (arrierePlan && background != null) {
g.drawImage(background, 0, 0, getWidth(),
getHeight(), this);
} else {
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
}
} catch (Throwable t) {
t.printStackTrace();
}
if (tampon == null ||
(! (tampon.getWidth(this) == this.getWidth()
&& tampon.getHeight(this) ==
this.getHeight()))
|| (!redraw)) {
tampon = new BufferedImage(this.getWidth(),
this.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
affRes.rendre(ratioCourant, tampon.getGraphics() );
}
redraw = true;
g.drawImage(tampon, 0, 0, this);
if (itemSelect){
StringTokenizer s = new
StringTokenizer(list.getSelectedItem(), "\t");
affRes.selectRequete(g,((String)
s.nextElement()).trim(), ratioCourant);
}
sp.invalidate();
} |
Partager