sk.baka.ambient.views.gesturelist.keypad
Class KeypadController

java.lang.Object
  extended by sk.baka.ambient.views.KeyEventHandler
      extended by sk.baka.ambient.views.gesturelist.keypad.AbstractKeypadHandler
          extended by sk.baka.ambient.views.gesturelist.keypad.KeypadController
All Implemented Interfaces:
android.view.KeyEvent.Callback

public final class KeypadController
extends AbstractKeypadHandler

Controls the GesturesListView component via the keypad.

Author:
Martin Vysny

Field Summary
 
Fields inherited from class sk.baka.ambient.views.gesturelist.keypad.AbstractKeypadHandler
owner
 
Fields inherited from class sk.baka.ambient.views.KeyEventHandler
keyDownHandled
 
Constructor Summary
KeypadController(GesturesListView ownerView)
          Creates new controller instance.
 
Method Summary
 void copy(Interval i)
          Copies given interval into the clipboard.
 java.util.List<TrackMetadataBean> getClipboard()
          Returns the contents of the clipboard as a list of tracks.
 boolean isActivatedByKey(int keyCode, android.view.KeyEvent event)
          Checks if this handler is activated by given key press.
 boolean isStarted()
          Checks if this handler is started.
protected  boolean onKey(int keyCode, int count, android.view.KeyEvent event)
          Invoked on key press.
 void selectionChanged()
          Invoked when the selection is changed in the underlying list view.
 void start()
          Starts this key handler.
 void stop()
          Stops this key handler.
 
Methods inherited from class sk.baka.ambient.views.KeyEventHandler
compose, isConfirm, keyUp, moveFocus, onConfirm, onDown, onKey, onKeyDown, onKeyMultiple, onKeyUp, onLeft, onRight, onUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeypadController

public KeypadController(GesturesListView ownerView)
Creates new controller instance.

Parameters:
ownerView - the owning view.
Method Detail

isActivatedByKey

public boolean isActivatedByKey(int keyCode,
                                android.view.KeyEvent event)
Description copied from class: AbstractKeypadHandler
Checks if this handler is activated by given key press.

Specified by:
isActivatedByKey in class AbstractKeypadHandler
Parameters:
keyCode - the key code
event - the event.
Returns:
true if this handler should be activated, false otherwise.

isStarted

public boolean isStarted()
Description copied from class: AbstractKeypadHandler
Checks if this handler is started.

Specified by:
isStarted in class AbstractKeypadHandler
Returns:
true if started, false otherwise.

start

public void start()
Description copied from class: AbstractKeypadHandler
Starts this key handler. The handler should initialize and start listening for keys.

Specified by:
start in class AbstractKeypadHandler

stop

public void stop()
Description copied from class: AbstractKeypadHandler
Stops this key handler. The handler should clean up. No more keys will be received unless AbstractKeypadHandler.start() is invoked again.

Specified by:
stop in class AbstractKeypadHandler

onKey

protected boolean onKey(int keyCode,
                        int count,
                        android.view.KeyEvent event)
Description copied from class: KeyEventHandler
Invoked on key press. By default invokes one of the onUp, onDown... event handlers.

Overrides:
onKey in class KeyEventHandler
Parameters:
keyCode - the key code
count - the key repeat count. 0 is the first key press
event - the event
Returns:
true if the event was handled and is to be suppressed, false otherwise.

selectionChanged

public void selectionChanged()
Description copied from class: AbstractKeypadHandler
Invoked when the selection is changed in the underlying list view.

Overrides:
selectionChanged in class AbstractKeypadHandler

copy

public void copy(Interval i)
Copies given interval into the clipboard. The operation does not block - it may retrieve the tracks in the background

Parameters:
i - the interval to copy.

getClipboard

public java.util.List<TrackMetadataBean> getClipboard()
Returns the contents of the clipboard as a list of tracks.

Returns:
list of tracks, never null, may be empty.


Copyright © 2007-2009. All Rights Reserved.