2026-02-03 13:50:27 +01:00
|
|
|
package linea;
|
|
|
|
|
|
|
|
|
|
import java.awt.Color;
|
|
|
|
|
import java.awt.Graphics;
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
// ObjetGraphique :
|
|
|
|
|
// classe abstraite, qui ne peut donc pas être instanciée
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
abstract class ObjetGraphique {
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
// PROPRIETES
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// Position
|
|
|
|
|
protected double x;
|
2026-02-03 15:36:11 +01:00
|
|
|
protected double y;
|
2026-02-03 13:50:27 +01:00
|
|
|
protected Color couleur = new Color(0.0f,0.2f,0.2f);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
// METHODES
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
// Constructeur : rien à faire
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
public ObjetGraphique(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
// Les méthodes d'affichage et d'animation : abstraites
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
abstract void Afficher(Graphics g);
|
|
|
|
|
abstract void Animer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
// Quelques méthodes d'accès
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
public double getX(){
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public double getY(){
|
|
|
|
|
return y;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setCouleur(Color c){
|
|
|
|
|
couleur = c;
|
|
|
|
|
}
|
|
|
|
|
}
|