01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf.html;
06:
07: import java.awt.*;
08: import java.util.*;
09: import java.io.*;
10:
11: import com.javelin.swinglets.*;
12: import com.javelin.swinglets.plaf.*;
13:
14: /**
15: * HTMLAppletUI defines a look and feel for default HTML.
16: *
17: * @author Robin Sharp
18: */
19:
20: public class HTMLObjectUI extends HTMLComponentUI {
21: /**
22: * Render the UI on the PrintWriter
23: */
24: public void update(PrintWriter out, SComponent c) {
25: if (!c.isVisible())
26: return;
27:
28: SObject object = (SObject) c;
29:
30: out.print("<OBJECT BORDER=0 ");
31:
32: HTMLUtility.setName(out, object);
33:
34: if (object.getClassId() != null)
35: HTMLUtility.setTag(out, "classid", object.getClassId());
36:
37: if (object.getCodeBase() != null)
38: HTMLUtility.setTag(out, "codebase", object.getCodeBase());
39:
40: if (object.getCodeType() != null)
41: HTMLUtility.setTag(out, "codetype", object.getCodeType());
42:
43: if (object.getData() != null)
44: HTMLUtility.setTag(out, "data", object.getData());
45:
46: if (object.getDataType() != null)
47: HTMLUtility.setTag(out, "type", object.getDataType());
48:
49: if (object.getArchive() != null)
50: HTMLUtility.setTag(out, "archive", object.getArchive());
51:
52: if (object.getStandbyMessage() != null)
53: HTMLUtility.setTag(out, "standby", object
54: .getStandbyMessage());
55:
56: if (object.isDeclaredOnly())
57: out.print(" declare");
58:
59: if (object.getParamCount() > 0) {
60: out.println();
61: for (Enumeration keys = object.getParamKeys(); keys
62: .hasMoreElements();) {
63: String key = keys.nextElement().toString();
64: out.print(" <PARAM NAME=\"");
65: out.print(key);
66: out.print("\" VALUE=\"");
67: out.print(object.getParam(key));
68: out.println("\" >");
69: }
70: }
71:
72: if (object.getSize().height > 0 && object.getSize().width > 0) {
73: out.print(" HEIGHT=");
74: out.print(object.getSize().height);
75: out.print(" WIDTH=");
76: out.print(object.getSize().width);
77: }
78:
79: updateEvent(out, c);
80:
81: out.println(" >");
82: }
83:
84: }
|