01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf.wml;
06:
07: import java.awt.*;
08: import java.awt.event.*;
09: import java.util.*;
10: import java.io.*;
11:
12: import com.javelin.swinglets.*;
13: import com.javelin.swinglets.plaf.*;
14:
15: /**
16: * WMLContainerUI defines a look and feel for default WML.
17: *
18: * @author Robin Sharp
19: */
20:
21: public class WMLContainerUI extends WMLComponentUI implements
22: SContainerUI {
23: /**
24: * Render the UI on the Output
25: */
26: public void updateHeader(Object out, SComponent c) {
27: updateHeader((PrintWriter) out, c);
28: }
29:
30: /**
31: * Render the UI on the Output
32: */
33: public void updateHeader(PrintWriter out, SComponent c) {
34: SContainer container = (SContainer) c;
35:
36: for (int index = 0; index < container.getComponentCount(); index++) {
37: container.getComponent(index).paintHeader(out);
38: }
39: }
40:
41: /**
42: * Render the UI on the Output
43: */
44: public void update(Object out, SComponent c) {
45: update((PrintWriter) out, c);
46: }
47:
48: /**
49: * Render the UI on the Output
50: */
51: public void update(PrintWriter out, SComponent c) {
52: if (!c.isVisible())
53: return;
54:
55: SContainer container = (SContainer) c;
56:
57: if (container.getLayoutManager() == null) {
58: for (int index = 0; index < container.getComponentCount(); index++) {
59: container.getComponent(index).paint(out);
60: }
61: } else {
62: container.getLayoutManager()
63: .layoutContainer(container, out);
64: }
65: }
66:
67: /**
68: * Tell the underlying UI that the container has been changed
69: */
70: public void update(SComponent c, int id, int index) {
71: }
72: }
|