-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLayout.java
144 lines (125 loc) · 4.99 KB
/
Layout.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class Layout {
public static void displayEstelle(){
System.out.println("███████╗███████╗████████╗███████╗██╗ ██╗ ███████╗ C");
System.out.println("██╔════╝██╔════╝╚══██╔══╝██╔════╝██║ ██║ ██╔════╝ i");
System.out.println("█████╗ ███████╗ ██║ █████╗ ██║ ██║ █████╗ n");
System.out.println("██╔══╝ ╚════██║ ██║ ██╔══╝ ██║ ██║ ██╔══╝ e");
System.out.println("███████╗███████║ ██║ ███████╗███████╗███████╗███████╗ m");
System.out.println("╚══════╝╚══════╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚══════╝ a");
System.out.println();
}
public static void exit() throws InterruptedException {
clearScreen();
displayEstelle();
System.out.println("Exiting....");
processBar();
clearScreen();
}
public static void start() throws InterruptedException {
clearScreen();
displayEstelle();
System.out.println("Loading...");
processBar();
clearScreen();
}
public static void processBar() throws InterruptedException {
for(int i = 0; i<50; i++)
{
System.out.print("[");
for(int j = 0; j<50; j++)
{
if(j <= i)
System.out.print("*");
else
System.out.print("-");
}
System.out.print("]");
Thread.sleep(25);
System.out.print("\r");
}
}
public static void process() {
char ani[] = {'|', '/', '-', '\\'};
for(int i = 0; i<20; i++)
{
System.out.print("Processing payment... ["+ ani[i % 4] + "]\r");
try {
Thread.sleep(200);
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void clearScreen() {
System.out.print("\033[H\033[2J");
System.out.flush();
}
public static void print(String[] str) {
for(int i=0; i<str.length; i++) {
System.out.println(i+1 + ". " + str[i]);
System.out.println();
}
}
public static void print(User user) throws NullPointerException {
System.out.println("Name: " + user.getUsername());
System.out.println("Phone number: " + user.getPh_no());
System.out.println("E-mail ID: " + user.getMail_id());
}
public static void print(Ticket[] t) {
for(int i=0; i<t.length; i++) {
System.out.println();
System.out.println("Ticket: "+ (i+1));
Layout.print(t[i].user);
System.out.println();
System.out.println("Movie: " + t[i].getMovieName());
System.out.println("Showtime: " + t[i].getMovieTime());
System.out.println("Date: " + t[i].getMovieDate());
System.out.println("Price: " + t[i].getMoviePrice());
System.out.println("SeatNo: " + t[i].getMovieName());
}
}
public static void print(Ticket t) {
System.out.println();
Layout.print(t.user);
System.out.println();
System.out.println("Movie: " + t.getMovieName());
System.out.println("Showtime: " + t.getMovieTime());
System.out.println("Date: " + t.getMovieDate());
System.out.println("Price: " + t.getMoviePrice());
System.out.println("SeatNo: " + t.getMovieName());
}
public static void print(Movies[] movies) {
for(int i=0; i<movies.length; i++) {
System.out.println(i+1 + ". " + movies[i].movieName);
System.out.println();
System.out.println(movies[i].movieDescription);
System.out.println();
}
}
public static void printST(String[] str) {
for(int i=0; i<str.length; i++) {
System.out.print(str[i] + " ");
}
}
public static void printSeats(String movie) throws IOException {
File f = new File("./seats.txt");
FileReader reader = new FileReader(f);
char c;
int i = 0;
while (reader.ready()) {
i++;
c = (char)reader.read();
if(c == '□') {
System.out.print("*");
}
else {
System.out.print(c);
}
}
reader.close();
}
}