|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--opale.m2d.ker.Object2D | +--opale.m2d.ker.Point2D
Cette classe permet de satisfaire la convention appliquée dans OPALE, selon laquelle les classes de base des objets géométriques
s'appelent Nom et les classes graphiques GNom. Elles héritent de
Object2D
et implémentent l'interface
Transformable
.
Field Summary | |
protected double |
x
|
protected double |
y
|
Constructor Summary | |
Point2D()
Constructeur par défaut. |
|
Point2D(OIJ rep)
Initialise le point avec les coordonnées (0; 0) et un repère OIJ donné. |
|
Point2D(OIJ rep,
double x,
double y)
Construit et initialise le point avec les coordonnées x et y, et un repère donné. |
|
Point2D(Point2D p)
Le constructeur de copie. |
Method Summary | |
void |
changeOIJ(OIJ rep)
Effectue un changement de repere du point. |
java.lang.Object |
clone()
Crée un nouvel objet de même classe et de même contenu. |
boolean |
equals(java.lang.Object obj)
Cette méthode teste si le point est égal à un objet passé en argument. |
double |
getX()
Renvoie la coordonnée x du point. |
double |
getY()
Renvoie la coordonnée y du point. |
void |
homothetie(Point2D A,
double k)
|
int |
readKeyWord(java.lang.String word,
RFile f,
Pack2D p)
Interpret a keyword read in a file. |
void |
rotate(double theta)
Rotate l'objet graphique de l'angle theta autour de l'origine |
void |
rotate(double oriX,
double oriY,
double theta)
Rotate l'objet graphique de l'angle theta autour d'un point |
void |
setLocation(double x,
double y)
Fixe les coordonnées du point. |
void |
setLocation(Point2D p)
Fixe les coordonnées du point. |
java.lang.String |
toString()
Returns a string representation of this object. |
void |
transform(AffineTransform2D t)
Transforms the object by a general transform AffineTransform . |
void |
translate(double dx,
double dy)
Translate l'objet graphique du vecteur(dx, dy). |
void |
writeFileMore(WFile f,
Pack2D p)
Wrtie complementary information in a file. |
Methods inherited from class opale.m2d.ker.Object2D |
getOIJ, readFile, setOIJ, writeFile, xmax |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double x
protected double y
Constructor Detail |
public Point2D()
public Point2D(OIJ rep)
OIJ
- rep, le repère.public Point2D(OIJ rep, double x, double y)
OIJ
- rep, le repère.double
- x, y les coordonnées.public Point2D(Point2D p)
Point2D
- le point à copier.Method Detail |
public final double getX()
public final double getY()
public final void setLocation(double x, double y)
double
- x, double y, les nouvelles coordonnées du point.public final void setLocation(Point2D p)
Point2D
- p, les nouvelles coordonnées du point.public void translate(double dx, double dy)
Transformable
translate
in interface Transformable
opale.m2d.ker.Transformable
double
- dx,dy, coordonées du vecteur de translation.public void rotate(double theta)
Transformable
rotate
in interface Transformable
opale.m2d.ker.Transformable
double
- theta, l'angle de rotation en radianpublic void rotate(double oriX, double oriY, double theta)
Transformable
rotate
in interface Transformable
opale.m2d.ker.Transformable
double
- oriX, double oriY, le centre de la rotationdouble
- theta, l'angle de rotation en radianpublic void transform(AffineTransform2D t)
Transformable
AffineTransform
.transform
in interface Transformable
opale.m2d.ker.Transformable
AffineTransform,
- the transformpublic void homothetie(Point2D A, double k)
public void changeOIJ(OIJ rep)
changeOIJ
in class Object2D
OIJ
- rep, le nouveau repere.public java.lang.Object clone()
clone
in class Object2D
OutOfMemoryError
- s'il n'y a pas assez de mémoire.Cloneable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object
- obj un objet à comparer avec le point.true
si l'objet à comparer est une instance de Point2D et
est égal au point courant; false
sinon.public java.lang.String toString()
Object2D
toString
in class Object2D
public void writeFileMore(WFile f, Pack2D p)
Object2D
writeFileMore
in class Object2D
opale.m2d.ker.Object2D
WFile
- f, the file in writing .public int readKeyWord(java.lang.String word, RFile f, Pack2D p) throws java.io.IOException, MalformedFileException
Object2D
readKeyWord
in class Object2D
opale.m2d.ker.Object2D
String
- word, the keyword.RFile
- f, the file in reading.Pack2D
- p, instance of Pack2D
that contains the requiered objects.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |