-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.java
60 lines (46 loc) · 1.33 KB
/
Application.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import Controls.ControlPanel;
import Graphing.Display;
import Graphing.TransformationPlane;
// the entire application essentially
public class Application {
public Application() {
this.initComponents();
}
private void initComponents() {
// frame set-up
JFrame frame = new JFrame("Vortecs Desktop");
frame.setPreferredSize(new Dimension(900, 900));
frame.setMinimumSize(new Dimension(250, 250));
frame.setResizable(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// innerPanel set-up
JPanel innerPanel = new JPanel(new BorderLayout());
Display screen = new Display(new TransformationPlane(), 650, 900);
ControlPanel controls = new ControlPanel(screen);
innerPanel.add(controls, BorderLayout.WEST);
innerPanel.add(screen, BorderLayout.CENTER);
//////////////////////////////////////////////
frame.add(innerPanel);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
new Thread(new Runnable() {
@Override
public void run() {
while(true) {
screen.repaint();
try {
Thread.sleep(333);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}).run();
}
}