init 2: Start project
This commit is contained in:
56
PROJET/linea/ObjetGraphique.java
Normal file
56
PROJET/linea/ObjetGraphique.java
Normal file
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
protected double y;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user