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: * WMLFrameUI defines a default WML "application" window.
17: *
18: * @author Robin Sharp
19: */
20:
21: public class WMLFrameUI extends WMLContainerUI implements SFrameUI {
22: /**
23: * Render the UI on the PrintWriter
24: */
25: public void update(PrintWriter out, SComponent c) {
26: if (!c.isVisible())
27: return;
28:
29: SFrame frame = (SFrame) c;
30:
31: out.println("");
32: out.println("<?xml version=\"1.0\"?>");
33: out
34: .print("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" ");
35: out.println("\"http://www.wapforum.org/DTD/wml_1.1.xml\">");
36: out.println("");
37: out.println("<wml>");
38:
39: for (int index = 0; index < frame.getComponentCount(); index++) {
40: frame.getComponent(index).paint(out);
41: }
42:
43: out.println("</wml>");
44: }
45:
46: }
|