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, Component, Scope, 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 HtmlBasedComponent.getExtraCtrl().
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children
 
Field Summary
protected  java.lang.String _src
           
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
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.
 Audio getContent()
          Returns the content set by setContent(org.zkoss.sound.Audio).
 java.lang.Object getExtraCtrl()
          Returns the client control for this component.
 java.lang.String getSrc()
          Returns the src.
 boolean isAutostart()
          Returns whether to auto start playing the audio.
protected  boolean isChildable()
          Default: not childable.
 boolean isLoop()
          Returns whether to play the audio repeatedly.
 void pause()
          Pauses the audio at the cient.
 void play()
          Plays the audio at the client.
protected  void renderProperties(ContentRenderer renderer)
          Renders the content of this component, excluding the enclosing tags and children.
 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(Audio audio)
          Sets the content directly.
 void setLoop(boolean loop)
          Sets whether to play the audio repeatedly.
 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
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
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 WrongValueException
Sets the alignment: one of top, texttop, middle, absmiddle, bottom, absbottom, baseline, left, right and center.

Throws:
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 WrongValueException
Sets the width of the border.

Throws:
WrongValueException

getSrc

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

Default: null.


setSrc

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

Calling this method implies setContent(null). In other words, the last invocation of setSrc(java.lang.String) overrides the previous setContent(org.zkoss.sound.Audio), if any.

See Also:
setContent(org.zkoss.sound.Audio)

isAutostart

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

Default: false;


setAutostart

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


isLoop

public boolean isLoop()
Returns whether to play the audio repeatedly.

Default: false;

Since:
3.6.1

setLoop

public void setLoop(boolean loop)
Sets whether to play the audio repeatedly.

Since:
3.6.1

setContent

public void setContent(Audio audio)
Sets the content directly.

Default: null.

Calling this method implies setSrc(null). In other words, the last invocation of setContent(org.zkoss.sound.Audio) overrides the previous setSrc(java.lang.String), if any.

Parameters:
audio - the audio to display.
See Also:
setSrc(java.lang.String)

getContent

public 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).


renderProperties

protected void renderProperties(ContentRenderer renderer)
                         throws java.io.IOException
Description copied from class: HtmlBasedComponent
Renders the content of this component, excluding the enclosing tags and children.

See also ZK Client-side Reference: Property Rendering

Overrides:
renderProperties in class XulElement
Throws:
java.io.IOException

isChildable

protected boolean isChildable()
Default: not childable.

Overrides:
isChildable in class AbstractComponent

getExtraCtrl

public java.lang.Object getExtraCtrl()
Description copied from class: HtmlBasedComponent
Returns the client control for this component. It is used only by component developers.

Default: creates an instance of HtmlBasedComponent.ExtraCtrl.

Specified by:
getExtraCtrl in interface ComponentCtrl
Overrides:
getExtraCtrl in class HtmlBasedComponent
Returns:
null if no special handling required. If the component requires some special controls, it could return an object that implements one or several interfaces in the org.zkoss.zk.ui.ext.render package. For example, Cropper.
See Also:
ComponentCtrl.getExtraCtrl()


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo