26 lines
832 B
Java
26 lines
832 B
Java
|
public class Observer implements MouseMotionListener, MouseListener {
|
||
|
public Observer() {}
|
||
|
|
||
|
void mouseClicked(MouseEvent evenement) {}
|
||
|
void mouseEntered(MouseEvent evenement) {}
|
||
|
void mouseExited(MouseEvent evenement) {}
|
||
|
void mouseMoved(MouseEvent evenement) {}
|
||
|
|
||
|
void mousePressed(MouseEvent evenement) {
|
||
|
Rectangle rect = (Rectangle)evenement.getSource();
|
||
|
rect.SetX(evenement.getX());
|
||
|
rect.SetY(evenement.getY());
|
||
|
rect.ShouldDraw(true);
|
||
|
}
|
||
|
|
||
|
void mouseReleased(MouseEvent evenement) {
|
||
|
Rectangle rect = (Rectangle)evenement.getSource();
|
||
|
rect.ShouldDraw(false);
|
||
|
}
|
||
|
|
||
|
void mouseDragged(MouseEvent evenement) {
|
||
|
Rectangle rect = (Rectangle)evenement.getSource();
|
||
|
rect.SetSX(evenement.getX());
|
||
|
rect.SetSY(evenement.getY());
|
||
|
}
|
||
|
}
|