public class Rectangle
extends java.lang.Object
Constructor and Description |
---|
Rectangle(int x,
int y,
java.awt.Color drawColor,
java.awt.Color fillColor,
int size)
Crée un nouvel élément carré.
|
Rectangle(int x,
int y,
java.awt.Color drawColor,
java.awt.Color fillColor,
int width,
int height)
Crée un nouvel élément rectangulaire.
|
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 Rectangle(int x, int y, java.awt.Color drawColor, java.awt.Color fillColor, int width, int height)
drawColor
- la couleur de tracé.fillColor
- la couleur de remplissage (si null, alors le rectangle n'est pas rempli).width
- la taille de le rectangle selon x en pixels.height
- la taille de le rectangle selon y en pixels.public Rectangle(int x, int y, java.awt.Color drawColor, java.awt.Color fillColor, int size)
drawColor
- la couleur de tracé.fillColor
- la couleur de remplissage (si null, alors le rectangle n'est pas rempli).size
- la taille du carré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()