-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptionsFrame.java
More file actions
76 lines (67 loc) · 1.87 KB
/
OptionsFrame.java
File metadata and controls
76 lines (67 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
/**
* Fenetre qui permet de modifier les options du jeu.
*
* @author Jean Guibert, Romain Bressan, Thomas Hennequin-Parey
*/
public class OptionsFrame extends JFrame
{
/**
* Panel de modification des options.
*/
Options oPan;
/**
* Zone qui permet de revenir vers le menu
*/
public Rectangle zoneMenu;
/**
* Controller de l'application. Pour pouvoir changer de fenetre.
*/
public Controller cont;
/**
* Constructeur de OptionsFrame.
*
* @param control
* Controller de l'application. Pour pouvoir changer de fenetre.
*/
public OptionsFrame(Controller control)
{
this.setTitle("Black Ball - Options");
this.setSize(Fenetre.WIDTH, Fenetre.HEIGHT);
this.setLocationRelativeTo(null);
this.setBackground(Color.BLACK);
this.setLayout(null);
this.cont = control;
oPan = new Options();
oPan.setSize(new Dimension(Fenetre.WIDTH, Fenetre.HEIGHT));
this.getContentPane().add(oPan);
zoneMenu = new Rectangle((int) 668, (int) 57, (int) 119, (int) 45);
/* Listeners */
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent ev)
{
Controller.exit(0);
}
}
);
addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent ev)
{
final Point p = ev.getPoint();
if (zoneMenu.contains(p))
cont.retourMenu(Controller.FEN_OPT);
}
}
);
}
}