org.zkoss.zul
Class Audio

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Audio
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Audio
extends XulElement

An audio clip.

An extension to XUL.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class Audio.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Field Summary
protected  java.lang.String _src
           
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Audio()
           
Audio(java.lang.String src)
           
 
Method Summary
 java.lang.String getAlign()
          Returns the alignment.
 java.lang.String getBorder()
          Returns the width of the border.
 org.zkoss.sound.Audio getContent()
          Returns the content set by setContent(org.zkoss.sound.Audio).
 java.lang.String getOuterAttrs()
           
 java.lang.String getSrc()
          Returns the src.
 boolean isAutostart()
          Returns whether to auto start playing the audio.
 boolean isChildable()
          Default: not childable.
protected  java.lang.Object newExtraCtrl()
           
 void pause()
          Pauses the audio at the cient.
 void play()
          Plays the audio at the client.
 void setAlign(java.lang.String align)
          Sets the alignment: one of top, texttop, middle, absmiddle, bottom, absbottom, baseline, left, right and center.
 void setAutostart(boolean autostart)
          Sets whether to auto start playing the audio.
 void setBorder(java.lang.String border)
          Sets the width of the border.
 void setContent(org.zkoss.sound.Audio audio)
          Sets the content directly.
 void setSrc(java.lang.String src)
          Sets the src.
 void stop()
          Stops the audio at the cient.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_src

protected java.lang.String _src
Constructor Detail

Audio

public Audio()

Audio

public Audio(java.lang.String src)
Method Detail

play

public void play()
Plays the audio at the client.


stop

public void stop()
Stops the audio at the cient.


pause

public void pause()
Pauses the audio at the cient.


getAlign

public java.lang.String getAlign()
Returns the alignment.

Default: null (use browser default).


setAlign

public void setAlign(java.lang.String align)
              throws org.zkoss.zk.ui.WrongValueException
Sets the alignment: one of top, texttop, middle, absmiddle, bottom, absbottom, baseline, left, right and center.

Throws:
org.zkoss.zk.ui.WrongValueException

getBorder

public java.lang.String getBorder()
Returns the width of the border.

Default: null (use browser default).


setBorder

public void setBorder(java.lang.String border)
               throws org.zkoss.zk.ui.WrongValueException
Sets the width of the border.

Throws:
org.zkoss.zk.ui.WrongValueException

getSrc

public java.lang.String getSrc()
Returns the src.

Default: null.


setSrc

public void setSrc(java.lang.String src)
Sets the src.

If setContent(org.zkoss.sound.Audio) is ever called with non-null, it takes heigher priority than this method.


isAutostart

public final boolean isAutostart()
Returns whether to auto start playing the audio.

Default: false;


setAutostart

public final void setAutostart(boolean autostart)
Sets whether to auto start playing the audio.


setContent

public void setContent(org.zkoss.sound.Audio audio)
Sets the content directly. Default: null.

Parameters:
audio - the audio to display. If not null, it has higher priority than getSrc().

getContent

public org.zkoss.sound.Audio getContent()
Returns the content set by setContent(org.zkoss.sound.Audio).

Note: it won't fetch what is set thru by setSrc(java.lang.String). It simply returns what is passed to setContent(org.zkoss.sound.Audio).


getOuterAttrs

public java.lang.String getOuterAttrs()
Overrides:
getOuterAttrs in class XulElement

isChildable

public boolean isChildable()
Default: not childable.

Specified by:
isChildable in interface org.zkoss.zk.ui.Component
Overrides:
isChildable in class org.zkoss.zk.ui.AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class org.zkoss.zk.ui.HtmlBasedComponent


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.