-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectFrames.java
More file actions
78 lines (68 loc) · 1.96 KB
/
ProjectFrames.java
File metadata and controls
78 lines (68 loc) · 1.96 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.*;
public class ProjectFrames {
protected JFrame frame = new JFrame();
protected Factory factory=null;
protected JPanel topPanel;
protected JPanel frameChooserPanel;
private JPanel northPanel=new JPanel();
protected JScrollPane centerPanel;
// Allows Frames to use the FactoryFacade Class
public ProjectFrames(Factory factory) {
this.factory=factory;
getComponent();
addTopComponent();
}
public void createFrame(Factory factory,JFrame frame){
this.factory=factory;
frame.remove(centerPanel);
getComponent();
addTopComponent();
centerPanel.revalidate();
frame.revalidate();
}
protected void getComponent(){
topPanel=factory.createTopPanel();
centerPanel=(JScrollPane) factory.createCenterPanel();
frameChooserPanel=factory.createFrameChooser();
frame.add(centerPanel,BorderLayout.CENTER);
frame.revalidate();
}
//Adds the top panel components created by getCompoenent()
private void addTopComponent(){
northPanel.setLayout(new GridLayout(2,1));
northPanel.add(topPanel);
northPanel.add(frameChooserPanel);
frame.add(northPanel,BorderLayout.NORTH);
frame.revalidate();
}
//Allows the Frame to return to Main
public final JFrame getFrame() {
return frame;
}
}
/*
class Budget extends ProjectFrames {
// Passes facade object to super which allows Frames to use the
// FactoryFacade Class
public Budget(Factory factory) {
super(factory);
}
}
class Reconciliation extends ProjectFrames {
// Passes facade object to super which allows Frames to use the
// FactoryFacade Class
public Reconciliation(Factory factory) {
super(factory);
}
}
class Charts extends ProjectFrames {
// Passes facade object to super which allows Frames to use the
// FactoryFacade Class
public Charts(Factory factory) {
super(factory);
}
}*/