-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathController.java
More file actions
62 lines (50 loc) · 1.34 KB
/
Controller.java
File metadata and controls
62 lines (50 loc) · 1.34 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
public class Controller {
Model m;
View app;
Controller c;
int range1, range2;
Controller(){
this.m = new Model();
this.app = new View();
//firstLoad(c);
}
public void firstLoad(Controller c){
Thread t1 = new Thread();
t1.start();
m.makeFirstTable();
this.c = c;
app.setController(c);
app.pack(); //Эта команда подбирает оптимальный размер в зависимости от содержимого окна
app.setLocationRelativeTo(null);
app.setVisible(true);
}
public String[][] showTables(){
return m.getSelectAll();
}
public String[][] showQuery1(){
return m.getNamesSurnamesSorted();
}
public String[][] showQuery2(){
return m.getNamesSurnamesCreditInterval(range1, range2);
}
public void modelExecuteStatement(String s){
m.queryMake(s);
}
public void setRanges(int r1, int r2){
this.range1 = r1;
this.range2 = r2;
}
public Model getModel(){
return m;
}
public View getView(){
return app;
}
public Controller getController(){
return c;
}
public static void main(String []argv){
final Controller c = new Controller();
c.firstLoad(c);
}
}