de.enough.polish.video.control
Class SeekControlItem

java.lang.Object
  extended by de.enough.polish.ui.Item
      extended by de.enough.polish.ui.Gauge
          extended by de.enough.polish.video.control.SeekControlItem
All Implemented Interfaces:
Animatable, ImageConsumer, UiElement, VideoCallback

public class SeekControlItem
extends Gauge
implements VideoCallback

A Gauge to display and control the current playback position of a video in a VideoItem.

Author:
Andre Schmidt

Field Summary
 
Fields inherited from class de.enough.polish.ui.Gauge
CONTINUOUS_IDLE, CONTINUOUS_RUNNING, INCREMENTAL_IDLE, INCREMENTAL_UPDATING, INDEFINITE
 
Fields inherited from class de.enough.polish.ui.Item
_bbField, appearanceMode, availableHeight, availableWidth, availContentHeight, availContentWidth, background, backgroundHeight, backgroundWidth, backgroundYOffset, bgBorder, border, BUTTON, colSpan, commands, completeBackground, completeBackgroundPadding, completeBorder, contentHeight, contentWidth, contentX, contentXAdjustment, contentY, contentYAdjustment, cssSelector, defaultCommand, focusedStyle, HORIZONTAL, HYPERLINK, ignoreRepaintRequests, includeLabel, INTERACTIVE, internalHeight, internalWidth, internalX, internalY, isContentVisible, isFocused, isInlineLabel, isInvisible, isLayoutCenter, isLayoutExpand, isLayoutRight, isPressed, isShown, isStyleInitialised, itemCommandListener, itemHeight, itemWidth, label, labelStyle, landscapeStyle, layout, LAYOUT_2, LAYOUT_BOTTOM, LAYOUT_CENTER, LAYOUT_DEFAULT, LAYOUT_EXPAND, LAYOUT_LEFT, LAYOUT_NEWLINE_AFTER, LAYOUT_NEWLINE_BEFORE, LAYOUT_RIGHT, LAYOUT_SHRINK, LAYOUT_TOP, LAYOUT_VCENTER, LAYOUT_VEXPAND, LAYOUT_VSHRINK, marginBottom, marginLeft, marginRight, marginTop, maximumHeight, maximumWidth, minimumHeight, minimumWidth, NO_POSITION_SET, opacity, opacityPaintNormally, opacityRgbData, paddingBottom, paddingHorizontal, paddingLeft, paddingRight, paddingTop, paddingVertical, parent, PLAIN, portraitStyle, preferredHeight, preferredWidth, preserveViewType, relativeX, relativeY, rowSpan, screen, setView, style, TRANSPARENT, useSingleRow, VERTICAL, view, xAdjustment, yAdjustment
 
Constructor Summary
SeekControlItem(VideoContainer item)
          Constructs a new SeekControlItem
SeekControlItem(VideoContainer item, Style style)
          Constructs a new SeekControlItem with a style
 
Method Summary
 boolean animate()
          Animates this item.
protected  boolean handleKeyPressed(int keyCode, int gameAction)
          Handles the key-pressed event.
protected  void hideNotify()
          Called by the system to notify the item that it is now completely invisible, when it previously had been at least partially visible.
 void onSnapshot(byte[] data, String encoding)
          Called when a capture is done
 void onVideoClose()
          Called when a video is destroyed
 void onVideoError(Exception e)
          Called when an error occures
 void onVideoPartReady(VideoSource source)
           
 void onVideoPause()
          Called when the video is paused
 void onVideoPlay()
          Called when the video is played
 void onVideoReady()
          Called when a video is fully prepared
 void onVideoStop()
          Called when the video is stopped
 void paintContent(int x, int y, int leftBorder, int rightBorder, Graphics g)
          Paints the content of this item.
protected  void showNotify()
          Called by the system to notify the item that it is now at least partially visible, when it previously had been completely invisible.
 
Methods inherited from class de.enough.polish.ui.Gauge
createCssSelector, getMaxValue, getValue, handlePointerDragged, handlePointerPressed, initContent, isInteractive, setImage, setMaxValue, setStyle, setStyle, setValue
 
Methods inherited from class de.enough.polish.ui.Item
addCommand, addCommand, addCommand, addCommands, addRelativeToBackgroundRegion, addRelativeToBackgroundRegion, addRelativeToContentRegion, addRepaintArea, animate, containsCommand, defocus, destroy, fireEvent, focus, getAbsoluteX, getAbsoluteY, getAppearanceMode, getAttribute, getAttributes, getAvailableContentHeight, getAvailableContentWidth, getAvailableHeight, getAvailableWidth, getBackgroundHeight, getBackgroundWidth, getBackgroundX, getBackgroundY, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getContentHeight, getContentWidth, getContentX, getContentY, getDefaultCommand, getFocusedStyle, getInternalHeight, getInternalWidth, getInternalX, getInternalY, getItemAreaHeight, getItemAt, getItemCommandListener, getItemCommands, getItemHeight, getItemHeight, getItemStateListener, getItemWidth, getItemWidth, getLabel, getLabelItem, getLayout, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMinimumHeight, getMinimumWidth, getParent, getPreferredHeight, getPreferredWidth, getScreen, getStyle, getUiEventListener, getView, getView, handleCommand, handleCommand, handleGesture, handleGestureHold, handleGestureSwipeLeft, handleGestureSwipeRight, handleKeyReleased, handleKeyRepeated, handlePointerReleased, handlePointerTouchDown, handlePointerTouchUp, init, initStyle, isInContentArea, isInContentWithPaddingArea, isInItemArea, isInItemArea, isInitialized, isLayoutBottom, isLayoutCenter, isLayoutExpand, isLayoutLeft, isLayoutNewlineAfter, isLayoutNewlineBefore, isLayoutRight, isLayoutShrink, isLayoutTop, isLayoutVerticalCenter, isLayoutVerticalExpand, isLayoutVerticalShrink, isPresed, isVisible, notifyItemPressedEnd, notifyItemPressedStart, notifyStateChanged, notifyUnvisited, notifyVisited, onScreenSizeChanged, paint, paintBackground, paintBackgroundAndBorder, paintBorder, paintCommands, paintFilter, releaseResources, removeAttribute, removeCommand, repaint, repaint, repaintFully, requestInit, setAbsoluteY, setAppearanceMode, setAttribute, setBackground, setBorder, setContentHeight, setContentWidth, setDefaultCommand, setDefaultCommand, setInitialized, setItemCommandListener, setItemCommandListener, setItemHeight, setItemStateListener, setItemTransition, setLabel, setLayout, setParent, setParent, setPreferredSize, setUiEventListener, setView, setVisible, show, showCommands, toImage, toRgbImage, toString, updateInternalArea
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SeekControlItem

public SeekControlItem(VideoContainer item)
Constructs a new SeekControlItem

Parameters:
item - the VideoItem to control

SeekControlItem

public SeekControlItem(VideoContainer item,
                       Style style)
Constructs a new SeekControlItem with a style

Parameters:
item - the VideoItem to control
style - the style
Method Detail

onVideoReady

public void onVideoReady()
Description copied from interface: VideoCallback
Called when a video is fully prepared

Specified by:
onVideoReady in interface VideoCallback

onVideoPartReady

public void onVideoPartReady(VideoSource source)

onVideoError

public void onVideoError(Exception e)
Description copied from interface: VideoCallback
Called when an error occures

Specified by:
onVideoError in interface VideoCallback

onVideoPause

public void onVideoPause()
Description copied from interface: VideoCallback
Called when the video is paused

Specified by:
onVideoPause in interface VideoCallback

onVideoPlay

public void onVideoPlay()
Description copied from interface: VideoCallback
Called when the video is played

Specified by:
onVideoPlay in interface VideoCallback

onVideoStop

public void onVideoStop()
Description copied from interface: VideoCallback
Called when the video is stopped

Specified by:
onVideoStop in interface VideoCallback

onVideoClose

public void onVideoClose()
Description copied from interface: VideoCallback
Called when a video is destroyed

Specified by:
onVideoClose in interface VideoCallback

handleKeyPressed

protected boolean handleKeyPressed(int keyCode,
                                   int gameAction)
Description copied from class: Item
Handles the key-pressed event. Please note, that implementation should first try to handle the given key-code, before the game-action is processed. The default implementation just handles the FIRE game-action when a default-command and an item-command-listener have been registered.

Overrides:
handleKeyPressed in class Gauge
Parameters:
keyCode - the code of the pressed key, e.g. Canvas.KEY_NUM2
gameAction - the corresponding game-action, e.g. Canvas.UP
Returns:
true when the key has been handled / recognized

animate

public boolean animate()
Description copied from class: Item
Animates this item. Subclasses can override this method to create animations. The default implementation returns false

Overrides:
animate in class Gauge
Returns:
true when this item has been animated.
See Also:
Item.animate(long, ClippingRegion)

paintContent

public void paintContent(int x,
                         int y,
                         int leftBorder,
                         int rightBorder,
                         Graphics g)
Description copied from class: Item
Paints the content of this item. The background has already been painted and the border will be added after this method returns.

Overrides:
paintContent in class Gauge
Parameters:
x - the left start position
y - the upper start position
leftBorder - the left border, nothing must be painted left of this position
rightBorder - the right border, nothing must be painted right of this position
g - the Graphics on which this item should be painted.

showNotify

protected void showNotify()
Description copied from class: Item
Called by the system to notify the item that it is now at least partially visible, when it previously had been completely invisible. The item may receive paint() calls after showNotify() has been called.

The default implementation of this method sets the isShown field to true and calls showNotify on style elements.

Overrides:
showNotify in class Gauge

hideNotify

protected void hideNotify()
Description copied from class: Item
Called by the system to notify the item that it is now completely invisible, when it previously had been at least partially visible. No further paint() calls will be made on this item until after a showNotify() has been called again.

The default implementation of this method sets the isShown field to false and calls hideNotify on style elements.

Overrides:
hideNotify in class Gauge

onSnapshot

public void onSnapshot(byte[] data,
                       String encoding)
Description copied from interface: VideoCallback
Called when a capture is done

Specified by:
onSnapshot in interface VideoCallback
Parameters:
data - the resulting data of the capture