public class Text
extends java.lang.Object
Constructor and Description |
---|
Text(int x,
int y,
java.awt.Color c,
java.lang.String text)
Crée un nouvel élément de texte.
|
Modifier and Type | Method and Description |
---|---|
int |
getX() |
int |
getY() |
void |
paint(java.awt.Graphics2D g2d)
Dessine un élément graphique dans la fenêtre graphique.
|
java.lang.String |
toString() |
void |
translate(int tx,
int ty)
Translate l'élément graphique.
|
public Text(int x, int y, java.awt.Color c, java.lang.String text)
x
- la coordonnée en x.y
- la coordonnée en y.c
- la couleur du texte.text
- le texte à afficher.public void paint(java.awt.Graphics2D g2d)
GraphicalElement
g2d
- l'instance de GraphicalElement
à peindrepublic java.lang.String toString()
toString
in class java.lang.Object
public void translate(int tx, int ty)
tx
- la coordonnée en abscisse du vecteur de translationty
- la coordonnée en y du vecteur de translationpublic int getX()
public int getY()