-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplay.java
46 lines (38 loc) · 1.41 KB
/
Display.java
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
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.*;
public class Display extends JFrame {
private StatusPane statusPane;
private MenuPane menuPane;
private SimulationPane simulationPane;
private static final int FRAME_WIDTH = CONSTANTS.FRAME_WIDTH;
private static final int FRAME_HEIGHT= CONSTANTS.FRAME_HEIGHT;
public Display() {
super("Medialab Simulator");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.pack();
this.setPreferredSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT));
this.setMinimumSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT));
this.setMaximumSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT));
this.setResizable(false);
this.setLocationRelativeTo(null);
this.setVisible(true);
}
public void putContent() {
JPanel wrapPane= new JPanel();
wrapPane.setLayout(new BorderLayout());
wrapPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
this.add(wrapPane);
statusPane = new StatusPane();
simulationPane = new SimulationPane();
wrapPane.add(statusPane, BorderLayout.NORTH);
wrapPane.add(simulationPane, BorderLayout.CENTER);
menuPane = new MenuPane();
wrapPane.add(menuPane, BorderLayout.SOUTH);
}
public void refresh() {
statusPane.refresh();
simulationPane.refresh();
}
}