001: /* Flash.java
002:
003: {{IS_NOTE
004: Purpose: ZK Flash Component
005:
006: Description:
007:
008: History:
009: Jul 17, 2007 , Created by jeffliu
010: }}IS_NOTE
011:
012: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
013:
014: {{IS_RIGHT
015: This program is distributed under GPL Version 2.0 in the hope that
016: it will be useful, but WITHOUT ANY WARRANTY.
017: }}IS_RIGHT
018: */
019:
020: package org.zkoss.zul;
021:
022: import org.zkoss.lang.Objects;
023: import org.zkoss.zk.ui.HtmlBasedComponent;
024:
025: /**
026: * A generic flash component.
027: *
028: * <p>Non XUL extension.
029: *
030: * @author Jeff
031: * @since 3.0.0
032: */
033: public class Flash extends HtmlBasedComponent {
034:
035: private static final long serialVersionUID = 1L;
036:
037: private String _src = "";
038:
039: private boolean _autoPlay = true;
040:
041: private boolean _loop = true;
042:
043: private String _wmode = "transparent";
044:
045: private String _bgcolor = "";
046:
047: /**
048: * Gets the background color of Flash movie
049: * @return the background color of Flash movie,[ hexadecimal RGB value]
050: */
051: public String getBgcolor() {
052: return _bgcolor;
053: }
054:
055: /**
056: * Sets the background color of Flash movie
057: * @param bgcolor [ hexadecimal RGB value]
058: */
059: public void setBgcolor(String bgcolor) {
060: if (!Objects.equals(_bgcolor, bgcolor)) {
061: _bgcolor = bgcolor;
062: smartUpdate("z:bgcolor", bgcolor);
063: }
064: }
065:
066: /**
067: * Returns true if the Flash movie plays repeatly
068: * @return true if the Flash movie plays repeatly
069: */
070: public boolean isLoop() {
071: return _loop;
072: }
073:
074: /**
075: * Sets whether the Flash movie plays repeatly
076: * @param loop
077: */
078: public void setLoop(boolean loop) {
079: if (_loop != loop) {
080: _loop = loop;
081: smartUpdate("z:loop", loop);
082: }
083: }
084:
085: /**
086: * Return true if the Flash movie starts playing automatically
087: * @return true if the Flash movie starts playing automatically
088: */
089: public boolean isAutoPlay() {
090: return _autoPlay;
091: }
092:
093: /**
094: * Sets wether the song Flash movie playing automatically
095: * @param play
096: */
097: public void setAutoPlay(boolean play) {
098: if (_autoPlay != play) {
099: _autoPlay = play;
100: smartUpdate("z:play", play);
101: }
102: }
103:
104: /**
105: * Returns the Window mode property of the Flash movie
106: * @return the Window mode property of the Flash movie
107: */
108: public String getWmode() {
109: return _wmode;
110: }
111:
112: /**
113: * Sets the Window Mode property of the Flash movie
114: * for transparency, layering, and positioning in the browser.
115: * @param wmode Possible values: window, opaque, transparent.
116: */
117: public void setWode(String wmode) {
118: if (!Objects.equals(_wmode, wmode)) {
119: _wmode = wmode;
120: }
121: }
122:
123: /**
124: * Gets the source path of Flash movie
125: * @return the source path of Flash movie
126: */
127: public String getSrc() {
128: return _src;
129: }
130:
131: /**
132: * Sets the source path of Flash movie
133: * and redraw the component
134: * @param src
135: */
136: public void setSrc(String src) {
137: if (!Objects.equals(_src, src)) {
138: _src = src;
139: invalidate();
140: }
141:
142: }
143:
144: }
|