de.enough.polish.video.control
Class VolumeControlItem

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

public class VolumeControlItem
extends Gauge
implements VideoCallback, ItemStateListener

A gauge to set the volume of a video in a VideoItem

Author:
Andre Schmidt

Field Summary
static int MAX_VOLUME
          The maximum volume to set
static int STEPS
          The steps to set the volume
 
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
VolumeControlItem(VideoContainer item)
          Constructs a new VolumeControlItem
VolumeControlItem(VideoContainer item, Style style)
          Constructs a new VolumeControlItem with a style
 
Method Summary
 void itemStateChanged(Item item)
          Called when internal state of an Item has been changed by the user.
 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 setVolume(int percent)
          Sets the volume to display, must be in percent
 
Methods inherited from class de.enough.polish.ui.Gauge
animate, createCssSelector, getMaxValue, getValue, handleKeyPressed, handlePointerDragged, handlePointerPressed, hideNotify, initContent, isInteractive, paintContent, setImage, setMaxValue, setStyle, setStyle, setValue, showNotify
 
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
 

Field Detail

MAX_VOLUME

public static final int MAX_VOLUME
The maximum volume to set

See Also:
Constant Field Values

STEPS

public static final int STEPS
The steps to set the volume

See Also:
Constant Field Values
Constructor Detail

VolumeControlItem

public VolumeControlItem(VideoContainer item)
Constructs a new VolumeControlItem

Parameters:
item - the VideoItem to control

VolumeControlItem

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

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

setVolume

public void setVolume(int percent)
Sets the volume to display, must be in percent

Parameters:
percent - the volume in percent

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

itemStateChanged

public void itemStateChanged(Item item)
Description copied from interface: ItemStateListener
Called when internal state of an Item has been changed by the user. This happens when the user:

It is up to the device to decide when it considers a new value to have been entered into an Item. For example, implementations of text editing within a TextField vary greatly from device to device.

In general, it is not expected that the listener will be called after every change is made. However, if an item's value has been changed, the listener will be called to notify the application of the change before it is called for a change on another item, and before a command is delivered to the Form's CommandListener. For implementations that have the concept of an input focus, the listener should be called no later than when the focus moves away from an item whose state has been changed. The listener should be called only if the item's value has actually been changed.

The listener is not called if the application changes the value of an interactive item.

Specified by:
itemStateChanged in interface ItemStateListener
Parameters:
item - the item that was changed

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