com.bramosystems.oss.player.core.client.skin
Class MediaSeekBar

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.bramosystems.oss.player.core.client.skin.MediaSeekBar
All Implemented Interfaces:
HasSeekChangeHandlers, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
CSSSeekBar, ImageSeekBar

public abstract class MediaSeekBar
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.dom.client.MouseUpHandler, HasSeekChangeHandlers

Abstract base class for seek bar implementations.

Provides means of controlling loading and playing progress indicators during media loading and playback respectively.

Author:
Sikirulai Braheem

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
protected  com.google.gwt.user.client.ui.AbsolutePanel seekTrack
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
MediaSeekBar(int height)
          Constructs MediaSeekBar of the specified height.
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addSeekChangeHandler(SeekChangeHandler handler)
          Adds the specified handler to the player.
 double getLoadingProgress()
          Returns the progress of the media loading operation
 double getPlayingProgress()
          Returns the progress of the media playback operation
protected  void initSeekBar(com.google.gwt.user.client.ui.Widget loadingWidget, com.google.gwt.user.client.ui.Widget playingWidget)
          Initialize the seek bar with the widgets that will be used to indicate media loading and playback progress respectively.
protected  void initWidget(com.google.gwt.user.client.ui.Widget widget)
          Overridden to prevent subclasses from changing the wrapped widget.
 void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
           
 void setLoadingProgress(double loadingProgress)
          Set the progress of the media loading operation.
 void setPlayingProgress(double playingProgress)
          Set the progress of the media playback operation.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Field Detail

seekTrack

protected com.google.gwt.user.client.ui.AbsolutePanel seekTrack
Constructor Detail

MediaSeekBar

public MediaSeekBar(int height)
Constructs MediaSeekBar of the specified height.

Parameters:
height - the height of the seek bar in pixels
Method Detail

initWidget

protected void initWidget(com.google.gwt.user.client.ui.Widget widget)
Overridden to prevent subclasses from changing the wrapped widget. Subclasses should call initSeekBar instead.

Overrides:
initWidget in class com.google.gwt.user.client.ui.Composite
See Also:
initSeekBar(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.ui.Widget)

initSeekBar

protected final void initSeekBar(com.google.gwt.user.client.ui.Widget loadingWidget,
                                 com.google.gwt.user.client.ui.Widget playingWidget)
Initialize the seek bar with the widgets that will be used to indicate media loading and playback progress respectively.

Subclasses should call this method before calling any Widget methods on this object.

Parameters:
loadingWidget - loading progress indicator widget
playingWidget - playback progress indicator widget

setLoadingProgress

public final void setLoadingProgress(double loadingProgress)
Set the progress of the media loading operation.

Parameters:
loadingProgress - progress should be between 0 (the minimum) and 1 (the maximum). Any value outside the range will be ignored.

getLoadingProgress

public final double getLoadingProgress()
Returns the progress of the media loading operation

Returns:
the progress of the loading operation between 0 (the minimum) and 1 (the maximum)
Since:
1.1

getPlayingProgress

public final double getPlayingProgress()
Returns the progress of the media playback operation

Returns:
the progress of the playback operation between 0 (the minimum) and 1 (the maximum)
Since:
1.1

setPlayingProgress

public final void setPlayingProgress(double playingProgress)
Set the progress of the media playback operation.

Parameters:
playingProgress - progress should be between 0 (the minimum) and 1 (the maximum). Any value outside the range will be ignored.

onMouseUp

public void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
Specified by:
onMouseUp in interface com.google.gwt.event.dom.client.MouseUpHandler

addSeekChangeHandler

public final com.google.gwt.event.shared.HandlerRegistration addSeekChangeHandler(SeekChangeHandler handler)
Adds the specified handler to the player. The handler is called whenever the state of the seek bar changes.

Specified by:
addSeekChangeHandler in interface HasSeekChangeHandlers
Parameters:
handler - the handler
Returns:
the HandlerRegistration used to remove the handler
See Also:
SeekChangeHandler


Copyright © 2009-2011. All Rights Reserved.