-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI.java
52 lines (41 loc) · 1.51 KB
/
GUI.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
package calhacks;
import objectdraw.*;
import Acme.*;
/**
* GUI class for four year plan
*/
public class GUI extends WindowController {
private static int boxHeight;
private static int boxWidth;
public static final int LEFT_PADDING = 60, BOTTOM_PADDING = 60;
public static final int TOP_PADDING = BOTTOM_PADDING * 2;
//private static int // y coord for text to be stated
//private static int //x coord for text to be stated
/* Contains the schedule to be displayed. */
private Schedule _schedule;
public static final int WINDOW_WIDTH = 1280, WINDOW_HEIGHT = 720;
/**
* Constructor for a GUI
* @param args command line arguments; pass them in from main
* @param width width of the window
* @param height height of the window
*/
public GUI(String[] args, Schedule schedule) {
_schedule = schedule;
new Acme.MainFrame(this, args, WINDOW_WIDTH, WINDOW_HEIGHT);
//year planner starter pack
boxHeight = WINDOW_HEIGHT - TOP_PADDING - BOTTOM_PADDING;
boxWidth = (WINDOW_WIDTH / Schedule.NUM_TERMS) * 2 - LEFT_PADDING;
YearPlanner mainbox = new YearPlanner(LEFT_PADDING, TOP_PADDING,
boxWidth, boxHeight, canvas, schedule);
new Text("Four Year Planner", WINDOW_WIDTH / 2,
TOP_PADDING / 2 , canvas);
}
/**
* Runs on click of the mouse inside the GUI
* @param point point in the windows at which the mouse clicked
*/
public void onMouseClick(Location point) {
System.out.println("YOOOOOO");
}
}