danger.ui
Class AudioPreviewWindow

java.lang.Object
  extended by danger.app.Listener
      extended by danger.ui.View
          extended by danger.ui.Container
              extended by danger.ui.Window
                  extended by danger.ui.DialogWindow
                      extended by danger.ui.AudioPreviewWindow


public class AudioPreviewWindow
extends DialogWindow

Window used to preview an audio clip. You do not instantiate an AudioPreviewWindow directly. Instead, use play(java.lang.String, danger.audio.Tone).


Field Summary
 
Fields inherited from class danger.ui.DialogWindow
APP_ALERT_STYLE, APP_DIALOG_STYLE, BOTTOM_POSITION1, BOTTOM_POSITION2, BOTTOM_POSITION3, m_showToneID, mListener, SHOW_STATE_HIDDEN, SHOW_STATE_SHOWING, SHOW_STATE_VISIBLE, SYSTEM_ALERT_TYPE_ALARM, SYSTEM_ALERT_TYPE_CONTROL, SYSTEM_ALERT_TYPE_GENERAL, SYSTEM_ALERT_TYPE_INCOMING_CALL, SYSTEM_ALERT_TYPE_MISSED_CALL, SYSTEM_ALERT_TYPE_PERSISTENT_CONTROL, SYSTEM_DIALOG_STYLE, SYSTEM_ERROR_STYLE, TOP_POSITION1, TOP_POSITION2
 
Fields inherited from class danger.ui.Window
NO_FULL_SCREEN_MARQUEE, SHOW_FULL_SCREEN_MARQUEE, STATE_AUTO_HIDE_IF_IDLE, STATE_DROP_ORPHANED_EVENTS, STATE_FULLSCREEN, STATE_UNUSED1
 
Fields inherited from class danger.ui.View
DEFAULT_SCROLL_FOCUS_MARGIN, FOCUS_DEFAULT, FOCUS_DOWNWARD, FOCUS_FROM_NOWHERE, FOCUS_LEFTWARD, FOCUS_NONE, FOCUS_RIGHTWARD, FOCUS_UPWARD, HEIGHT_AUTO, HEIGHT_FILL_TO_BOTTOM, HEIGHT_FILL_TO_TOP, HEIGHT_MATCH_CONTROL, HEIGHT_PERCENTAGE, POSITION_ABOVE, POSITION_ALIGN_BASELINE, POSITION_ALIGN_BOTTOM, POSITION_ALIGN_HORIZONTALLY, POSITION_ALIGN_LEFT, POSITION_ALIGN_PARENT_BOTTOM, POSITION_ALIGN_PARENT_RIGHT, POSITION_ALIGN_PARENT_TOP, POSITION_ALIGN_RIGHT, POSITION_ALIGN_TOP, POSITION_ALIGN_VERTICALLY, POSITION_BELOW, POSITION_BELOW_GROUP_BOX_HEADING, POSITION_TO_LEFT, POSITION_TO_RIGHT, PREFER_DIRECTION_NONE, PREFER_HORIZONTAL_DIRECTION, PREFER_VERTICAL_DIRECTION, STATE_AT_AND_SPACE_PAGE, STATE_CAN_FOCUS, STATE_DEBUG_BOUNDS, STATE_ENABLED, STATE_FOCUSED, STATE_MAKE_DING, STATE_PARTIAL_FOCUS_OK, STATE_TRANSPARENT, STATE_VISIBLE, WIDTH_AUTO, WIDTH_FILL_TO_LEFT, WIDTH_FILL_TO_RIGHT, WIDTH_MATCH_CONTROL, WIDTH_PERCENTAGE
 
Method Summary
 boolean eventWidgetDown(int widget, Event event)
          Handle the pressing of a device widget
 void init(byte[] inAudioData, Tone inTone, int inPlayFilter)
          Deprecated. Use play(java.lang.String, danger.audio.Tone) instead.
 void init(File f, int inPlayFilter)
          Deprecated. Use play(java.lang.String, danger.audio.Tone) instead.
 void onDecoded()
          This method is called when this view has been completely decoded from a dialog or screen resource.
protected  void onHide()
          This method is called when this view is hidden, via the method View.hide().
 void onShow()
          This method is called when this view is shown, via the method View.show().
static AudioPreviewWindow play(File f)
          Display UI and play an audio file.
static AudioPreviewWindow play(String inTitle, byte[] inAudioData)
          Display UI and play an audio byte array.
static AudioPreviewWindow play(String inTitle, byte[] inAudioData, int playFilter)
          Display UI and play an audio byte array.
static AudioPreviewWindow play(String inTitle, File f)
          Display UI and play an audio file.
static AudioPreviewWindow play(String inTitle, Tone tone)
          Display UI and play a Tone.
static AudioPreviewWindow play(String inTitle, Tone tone, int playFilter)
          Display UI and play a Tone.
 boolean receiveEvent(Event e)
          Entry point for event processing.
 void setDisplayedSize(int bytes)
          Deprecated. Unused.
 
Methods inherited from class danger.ui.DialogWindow
activateFrameButton, addBottomFrameButton, addBottomFrameButton, addBottomFrameButtons, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addFrameButton, addTopFrameButton, addTopFrameButton, addTopFrameButtons, blocksChooser, calcBottom, convertShortcutKeyToButtonIndex, convertShortcutKeyToButtonIndex, disableBottomRightButtonOnEmptyField, disableButtonOnEmptyField, drawDialogStyleFrame, eventKeyUp, eventShortcut, eventWidgetUp, getCancelButton, getChildWithID, getContentRect, getDefaultFrameButton, getDescendantWithID, getFrameButtonListener, getFrameButtonWithID, getMaxWidth, getNumTopFrameButtons, getShowState, getShowToneID, getSleepScreenImage, getSleepScreenMessageCharSequence, getTitle, getTitleBarHeight, getTitleFont, getTitleSequence, getWidthToFitTitle, getWindowStyle, handleButtonShortcut, handleFrameButtonShortcut, handleShortcutKey, hasVisibleFrameButtons, hide, layoutTopFrameButtons, paint, positionDialog, reflowFrameButtons, removeAllChildren, removeFrameButtonWithID, setAutoCenter, setAutoSize, setAutoSizeHeight, setAutoSizeWidth, setBackEvent, setBorders, setCancelButtonEvent, setCenterTitle, setContentSize, setDefaultFrameButton, setDefaultFrameButton, setDrawBottomFrame, setEventForControlWithID, setEventForFrameButtonWithID, setFocusedChild, setFocusedDescendant, setForceDrawBottomFrame, setFrameButtonShortcut, setFrameButtonShortcut, setHideOnButtonEvent, setHideOnButtonWithID, setHideOnButtonWithPosition, setLayoutBottomFrameButtonsVertically, setListener, setNoDefaultFrameButton, setOverrideMaxWidth, setShowCancel, setShowTone, setShowTone, setSize, setSleepScreenImage, setSleepScreenMessage, setSleepScreenMessage, setTitle, setTitle, setWidthToFitTitle, setWindowStyle, show, show, show, showInternal, snapToChildren, snapToChildren, startShowTone, startShowTone, startShowTone, startShowTone, stopShowTone, updateBottomButtonWidths, updateFrameButtonColors, wantsEndButton, wantsSendButton
 
Methods inherited from class danger.ui.Window
addTranslucentRegion, addTranslucentRegion, adjustActionMenuState, advanceFocus, autoHide, autoHideIfIdle, autoHideIfIdle, blocksAutomaticKeyGuard, blocksBackButton, blocksFloatingControls, blocksKeyGuard, blocksVolumeButtons, centerHorizontal, centerOnScreen, centerUnderTitleBar, centerVertical, disableControlWithID, dropOrphanedEvents, enableControlWithID, forwardQueuedEvents, getApplication, getDefaultFocus, getDefaultListener, getEffectiveWindow, getIDOfChild, getListener, getWindowBelow, hideActiveMenu, hideControlWithID, incrementMaxChildID, invalidate, isActionMenuVisible, isFullScreen, isUnresponsive, onActivate, onDeactivate, onPeriodicPulse, onWindowPaint, receiveMessage, removeTranslucentRegions, reverseFocus, setDefaultFocus, setDefaultListener, setEventArgForControlWithID, setFullScreen, setMaxChildID, setMaxControlID, setPosition, setShowFullScreenMarquee, setTitled, setTitleFormatDate, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTitleFormatText, setTransparent, shouldDropEvent, showControlWithID, startQueueingEvents, wantsMenuTrackball, willPassEventToWindow
 
Methods inherited from class danger.ui.Container
addChild, addChild, addChildAt, addChildAt, addFromContainerResource, addFromContainerResource, addFromContainerResource, addFromDialogResource, addFromDialogResource, advanceFocusInWindow, childCount, childIsOnScreen, disable, enable, eventKeyDown, eventKeyHeld, eventKeyRepeat, eventPeriodicPulse, eventRawKeyDown, eventRawKeyHeld, eventRawKeyRepeat, eventRawKeyUp, eventWidgetHeld, focusedDescendantIsValid, getBottomChild, getBottomChild, getChildAt, getChildIndex, getControlWithID, getFirstChild, getFirstFocusableChild, getFocusableChildInWindow, getFocusedChild, getFocusedLeaf, getInterestingRect, getLastChild, getLastFocusableChild, getLeftMostChild, getNextFocusableChild, getNextFocusableChild, getPageHeight, getPrevFocusableChild, getPrevFocusableChild, getRightMostChild, getRightMostChild, hideAllChildren, isDescendant, keepRectInView, loseFocus, moveChildToIndex, onChildPositionChanged, onChildSizeChanged, onChildVisibilityChanged, pageToEnd, pageToHome, paintChildren, reflowChildren, removeChild, setFocusedChild, setFocusedChild, setFocusedDescendant, setFocusedDescendant, setFocusToFirstDescendant, setFormatDateForControlWithID, setFormatDateForTextControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setListenerForAllControls, setReflowAdjustHeight, setWindow, showAllChildren, snapHeightToChildren, snapHeightToChildren, snapWidthToChildren, snapWidthToChildren, takeFocus, willFocusWithin, willFocusWithin
 
Methods inherited from class danger.ui.View
boundsIntersect, boundsIntersect, canLoseFocus, clear, clear, copyStyle, getAcceptFocus, getBackgroundColor, getBottom, getBounds, getBounds, getData, getFocusTraversalDirection, getFocusTraversalFrom, getFocusTraversalPolicy, getFrame, getFrame, getGlobalBottom, getGlobalLeft, getGlobalRight, getGlobalTop, getHeight, getID, getInterestingRect, getLabelFont, getLabelFont, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getParentContainer, getPartialFocusOK, getRight, getScrollFocusMargin, getSibling, getState, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, globalToLocalH, globalToLocalV, invalidate, invalidate, invalidateIndependentOfOrigin, invalidateIndependentOfOrigin, isEnabled, isFocusable, isFocused, isObscured, isOnScreen, isTransparent, isVisible, isVisibleInHierarchy, isVisibleOnScreen, justSetVisible, localToGlobal, localToGlobal, localToGlobalH, localToGlobalV, localToWindow, moveBy, notifyWhenFocusChanges, notifyWhenObscurityChanges, notifyWhenParentSizeChanges, notifyWhenPositionChanges, notifyWhenSizeChanges, notifyWhenVisibilityChanges, offsetOrigin, offsetOrigin, onAddedToParent, onEnabledStateChanged, onPositionChanged, onRemovedFromParent, onShortcut, onShortcut, onShortcutConsumed, onSizeChanged, onStyleChanged, onSystemFontChanged, onViewFocusChanged, onViewObscurityChanged, onViewPositionChanged, onViewSizeChanged, onViewVisibilityChanged, playLimitSound, receiveEventInternal, resetOrigin, sendEventToWindow, setAcceptFocus, setAtAndSpacePage, setBackground, setBackgroundColor, setBottom, setData, setDebugBounds, setDynamicHeight, setDynamicPosition, setDynamicWidth, setEnabled, setFocusTraversalDirection, setFocusTraversalFrom, setFocusTraversalPolicy, setFrame, setHeight, setKeyedValue, setLabelFont, setLeft, setMakeLimitNoise, setOrigin, setOrigin, setPartialFocusOK, setPreferredDirection, setRight, setScrollFocusMargin, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setVisible, setWidth, showContextMenu, styleIsDefault, swapStyleColors, windowToLocal
 
Methods inherited from class danger.app.Listener
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

onDecoded

public void onDecoded()
Description copied from class: View
This method is called when this view has been completely decoded from a dialog or screen resource. Base implementation does nothing. You will generally override this method and do any initialization before showing the window. Note that it is not safe to access a dialog or screen resource's children in the constructor, since the children have not yet been added. Override this method instead.

Overrides:
onDecoded in class View

init

public void init(byte[] inAudioData,
                 Tone inTone,
                 int inPlayFilter)
Deprecated. Use play(java.lang.String, danger.audio.Tone) instead.


init

public void init(File f,
                 int inPlayFilter)
Deprecated. Use play(java.lang.String, danger.audio.Tone) instead.


play

public static AudioPreviewWindow play(String inTitle,
                                      Tone tone)
Display UI and play a Tone.

Parameters:
inTitle - is the name of the title in the UI.
tone - is a valid Tone

play

public static AudioPreviewWindow play(String inTitle,
                                      Tone tone,
                                      int playFilter)
Display UI and play a Tone.

Parameters:
inTitle - is the name of the title in the UI.
tone - is a valid Tone
playFilter - is one of ToneFilter or combination of bits.

play

public static AudioPreviewWindow play(String inTitle,
                                      byte[] inAudioData)
Display UI and play an audio byte array.

Parameters:
inTitle - is the name of the title in the UI.
inAudioData - is valid audio data as a byte array.

play

public static AudioPreviewWindow play(String inTitle,
                                      byte[] inAudioData,
                                      int playFilter)
Display UI and play an audio byte array.

Parameters:
inTitle - is the name of the title in the UI.
inAudioData - is valid audio data as a byte array.
playFilter - is one of ToneFilter or combination of bits.

play

public static AudioPreviewWindow play(String inTitle,
                                      File f)
Display UI and play an audio file.

Parameters:
inTitle - is the name of the title in the UI.
f - is valid audio data as a File object.

play

public static AudioPreviewWindow play(File f)
Display UI and play an audio file.

Parameters:
f - is valid audio data as a File object.

onShow

public void onShow()
Description copied from class: View
This method is called when this view is shown, via the method View.show(). It is called as the very last thing done by that method, and it is only ever called if the view was not already visible. Overriding this method is the recommended way to get special behavior when a view gets shown. The implementation in this class does nothing.

Overrides:
onShow in class View

onHide

protected void onHide()
Description copied from class: View
This method is called when this view is hidden, via the method View.hide(). It is called as the very last thing done by that method, and it is only ever called if the view was not already hidden. Overriding this method is the recommended way to get special behavior when a view gets hidden . The implementation in this class does nothing.

Overrides:
onHide in class View

receiveEvent

public final boolean receiveEvent(Event e)
Description copied from class: Listener
Entry point for event processing. This method is called from a Dispatcher when it reads an Event in its queue that is targetted at this instance. This base class implementation handles event methods as specified by the eventMethod keyword in .rsrc files. If you override this method, be sure to call super.receiveEvent.

Overrides:
receiveEvent in class DialogWindow
Parameters:
e - non-null; the event to process
Returns:
whether (true) or not (false) this method actually handled the event to completion

eventWidgetDown

public boolean eventWidgetDown(int widget,
                               Event event)
Description copied from class: Container
Handle the pressing of a device widget

Overrides:
eventWidgetDown in class DialogWindow
Parameters:
widget - the widget that went up
Returns:
whether or not the event was consumed

setDisplayedSize

public void setDisplayedSize(int bytes)
Deprecated. Unused.