OOP2

LendingController.java

1
import java.util.List;
2
import java.util.ArrayList;
3
import javax.swing.JCheckBox;
4
import javax.swing.JButton;
5
import javax.swing.JComponent;
6
/**
7
 * @author Maarten Vangeneugden - 1438256
8
 */
9
public class LendingController {
10
11
	private List<Article> articles;
12
	private List<Client> clients;
13
	private Window window;
14
	private List<JComponent> components;
15
16
	public LendingController(List<Article> articles, List<Client> clients, Window window) { 
17
		this.articles = articles;
18
		this.clients = clients;
19
		this.window = window;
20
		this.components = new ArrayList<>();
21
		//this.components.add(this.window.createButton("Sluiten", "", "closeWindow", this));
22
		this.createWindow();
23
	}
24
25
	private void createWindow() {
26
		String[] clientNames = new String[this.clients.size()];
27
		for(int i=0; i<clientNames.length; i++) {
28
			clientNames[i] = this.clients.get(i).getName();
29
		}
30
31
		this.components.add(this.window.addComboBox(clientNames));
32
	}
33
		
34
	public void closeWindow() {
35
36
	}
37
38
	public void setArticles(List<Article> articles) {
39
		this.articles = articles;
40
	}
41
42
	public List<Article> getArticles() {	
43
		return articles;
44
	}
45
46
	public void setClients(List<Client> clients) {
47
		this.clients = clients;
48
	}
49
50
	public List<Client> getClients() {	
51
		return clients;
52
	}
53
54
	public void setWindow(Window window) {
55
		this.window = window;
56
	}
57
58
	public Window getWindow() {	
59
		return window;
60
	}
61
62
}
63