01: /* FlashDefault.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Sep 7, 2007 9:04:13 AM , Created by jumperchen
10: }}IS_NOTE
11:
12: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zkmax.zul.render;
20:
21: import java.io.IOException;
22: import java.io.Writer;
23:
24: import org.zkoss.zk.ui.Component;
25: import org.zkoss.zk.ui.render.ComponentRenderer;
26: import org.zkoss.zk.ui.render.SmartWriter;
27: import org.zkoss.zul.Flash;
28:
29: /*
30: * {@link Flash}'s default mold.
31: *
32: * @author jumperchen
33: *
34: * @since 3.0.0
35: */
36: public class FlashDefault implements ComponentRenderer {
37:
38: public void render(Component comp, Writer out) throws IOException {
39: final SmartWriter wh = new SmartWriter(out);
40: final Flash self = (Flash) comp;
41: final String uuid = self.getUuid();
42: wh.write("<div id=\"").write(uuid).write("\" ");
43: wh.write(self.getOuterAttrs()).write(
44: " z.type=\"zul.flash.Flash\">");
45: wh.write("<object id=\"").write(uuid).write("!obj\" width=\"");
46: wh.write(self.getWidth()).write("\" height=\"").write(
47: self.getHeight()).write("\">");
48: wh.write("<param name=\"movie\" value=\"").write(self.getSrc())
49: .write("\"></param>");
50: wh
51: .write("<param name=\"wmode\" value=\"transparent\"></param>");
52: wh.write("<embed id=\"").write(uuid).write("!emb\" src=\"");
53: wh
54: .write(self.getSrc())
55: .write(
56: "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"");
57: wh.write(self.getWidth()).write("\" height=\"").write(
58: self.getHeight()).write("\">");
59: wh.write("</embed></object></div>");
60: }
61: }
|