Class Index | File Index

Classes


Class TKSpatialNavigationManager


Extends TKObject.

The spatial navigation manager is a special controller type that sits behind the scenes and handles much of the keyboard interaction in order to provide navigation between navigable elements of the managedController. By default, navigation between navigable elements is automatic and performed based on the location and metrics of each elements. The elements' metrics are those set by CSS and a controller is free to provide custom metrics for elements as it sees fit by implementing the TKController.customMetricsForElement method. Additionally, the automatic navigation can be completely bypassed should the managed controller provide a custom element to navigate to with the TKController.preferredElementToHighlightInDirection method.


Defined in: SpatialNavigationManager.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
TKSpatialNavigationManager.busyControllers
The number of controllers that are currently busy, when for instance performing a transition that should not be interrupted.
 
The managed controller is the controller that the spatial navigation manager queries for navigable elements and any customization of the otherwise automated navigation.
 
The complete list of all elements that can be navigated to within this controller and all of its sub-controllers.
<static>  
TKSpatialNavigationManager.sharedManager
The shared instance of the spatial navigation manager.
<static>  
TKSpatialNavigationManager.soundToPlay
The identifier for the sound to play for the current event loop.
Method Summary
Method Attributes Method Name and Description
 
Highlights a given element if it's part of the navigableElements array.
 
Highlight the top-most element in the list of navigable elements.
 
Indicates whether a given element is navigable at the provided index in the navigableElements array.
Methods borrowed from class TKObject:
addPropertyObserver, callMethodNameAfterDelay, callSuper, notifyPropertyChange, removePropertyObserver
Class Detail
TKSpatialNavigationManager()
Since:
TuneKit 1.0
Field Detail
<static> {int} TKSpatialNavigationManager.busyControllers
The number of controllers that are currently busy, when for instance performing a transition that should not be interrupted. When this variable is more than 0, key handling by the spatial navigation manager is suspended.

managedController
The managed controller is the controller that the spatial navigation manager queries for navigable elements and any customization of the otherwise automated navigation. Developers should not assign this property directly as the navigation controller takes care of that as the user navigates through controllers.

{Array} navigableElements
The complete list of all elements that can be navigated to within this controller and all of its sub-controllers.

<static> {TKSpatialNavigationManager} TKSpatialNavigationManager.sharedManager
The shared instance of the spatial navigation manager. TuneKit automatically creates a single instance of the TKSpatialNavigationManager class as needed, and developers should never have to create an instance themselves, instead using this property to retrieve the shared instance.

<static> {int} TKSpatialNavigationManager.soundToPlay
The identifier for the sound to play for the current event loop.
Method Detail
highlightElement(element)
Highlights a given element if it's part of the navigableElements array. When an element receives highlight, a highlight event is dispatched to that element, while an unhighlight event is dispatched to the element that previously had highlight.
Parameters:
{Element} element
The element to highlight.

highlightTopElement()
Highlight the top-most element in the list of navigable elements.

{bool} isElementAtIndexNavigable(element)
Indicates whether a given element is navigable at the provided index in the navigableElements array.
Parameters:
{Element} element
The index for the element in the navigableElements array.
Returns:
{bool} Whether the element can be navigated to.

Copyright © 2009 Apple Inc. All rights reserved.