01: package net.ar.webonswing.petstore;
02:
03: import javax.swing.*;
04:
05: import net.ar.webonswing.petstore.model.*;
06: import net.ar.webonswing.ui.*;
07:
08: public class Border extends JPanel {
09: protected JComponent body;
10: protected Customer customer;
11: private Cart cart;
12: private ApplicationFrame frame;
13: protected Header header;
14: protected CategoriesPanel navigation;
15:
16: public Border() {
17: }
18:
19: public Border(JComponent aBody, Customer aCustomer, Cart aCart,
20: ApplicationFrame aFrame) {
21: customer = aCustomer;
22: body = aBody;
23: cart = aCart;
24: frame = aFrame;
25:
26: init();
27: }
28:
29: protected void init() {
30: header = new Header(customer, cart, frame);
31: header.setLayout(ApplicationFrame.getCurrentSkin()
32: .getCurrentPropagateTemplateFor("Header"));
33:
34: navigation = new CategoriesPanel(
35: frame.getDao().getCategories(),
36: LabelUIContributor.class, true);
37: navigation.setLayout(ApplicationFrame.getCurrentSkin()
38: .getCurrentPropagateTemplateFor("Navigation"));
39:
40: add(header).setName("header");
41: add(body).setName("body");
42: add(navigation).setName("navigation");
43: setLayout(ApplicationFrame.getCurrentSkin()
44: .getCurrentPropagateTemplateFor("Border.main"));
45: }
46:
47: public JComponent getBody() {
48: return body;
49: }
50:
51: public void setBody(JComponent aBody) {
52: this .body = aBody;
53: }
54:
55: public Header getHeader() {
56: return header;
57: }
58:
59: public void setHeader(Header aHeader) {
60: this .header = aHeader;
61: }
62:
63: public CategoriesPanel getNavigation() {
64: return navigation;
65: }
66:
67: public void setNavigation(CategoriesPanel aNavigation) {
68: this.navigation = aNavigation;
69: }
70: }
|