Packageorg.aswing
Classpublic class FocusManager

FocusManager manages all the when a component should receive focus, i.e if it can.



Public Methods
 MethodDefined by
  
FocusManager(theStage:Stage)
FocusManager
  
focusNext():void
Focuses the Component after the current focus owner.
FocusManager
  
Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.
FocusManager
  
Focuses the Component before the current focus owner.
FocusManager
  
Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.
FocusManager
  
Returns the active Window.
FocusManager
  
Returns the default FocusTraversalPolicy.
FocusManager
  
Returns the focus owner.
FocusManager
  
getManager(theStage:Stage):FocusManager
[static] Returns the current FocusManager instance
FocusManager
  
FocusManager
  
Returns the previous focused component.
FocusManager
  
init(theStage:Stage):void
Init the focus manager, it will only start works when it is inited.
FocusManager
  
[static] Returns the default value for defaultTraversalEnabled.
FocusManager
  
Returns whether or not to use default value for traversal enabled.
FocusManager
  
Returns traversal by keys pressing is enabled or not.
FocusManager
  
isTraversing():Boolean
Returns if the focus is traversing by keys.
FocusManager
  
FocusManager
  
setActiveWindow(newActiveWindow:JWindow):void
Sets the active Window.
FocusManager
  
Sets the default FocusTraversalPolicy.
FocusManager
  
[static] The default to disables or enables the traversal by keys pressing.
FocusManager
  
setFocusOwner(newFocusOwner:Component):void
Sets the focus owner.
FocusManager
  
setManager(theStage:Stage, newManager:FocusManager):void
[static] Sets the current FocusManager instance.
FocusManager
  
setTraversalAsDefault(b:Boolean):void
Sets whether or not to use default value for traversal enabled.
FocusManager
  
setTraversalEnabled(b:Boolean):void
Disables or enables the traversal by keys pressing.
FocusManager
  
setTraversing(b:Boolean):void
Sets if the focus is traversing by keys.
FocusManager
  
uninit():void
Un-init this focus manager.
FocusManager
Constructor detail
FocusManager()constructor
public function FocusManager(theStage:Stage)Parameters
theStage:Stage
Method detail
focusNext()method
public function focusNext():void

Focuses the Component after the current focus owner.

See also

focusNextOfComponent()method 
public function focusNextOfComponent(aComponent:Component):void

Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.

Parameters
aComponent:Component — the Component that is the basis for the focus traversal operation

See also

focusPrevious()method 
public function focusPrevious():void

Focuses the Component before the current focus owner.

See also

focusPreviousOfComponent()method 
public function focusPreviousOfComponent(aComponent:Component):void

Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.

Parameters
aComponent:Component — the Component that is the basis for the focus traversal operation

See also

getActiveWindow()method 
public function getActiveWindow():JWindow

Returns the active Window. The active Window is always either the focused Window, or the first Window that is an owner of the focused Window.

Returns
JWindow — the active Window

See also

getDefaultFocusTraversalPolicy()method 
public function getDefaultFocusTraversalPolicy():FocusTraversalPolicy

Returns the default FocusTraversalPolicy. Top-level components use this value on their creation to initialize their own focus traversal policy by explicit call to Container.setFocusTraversalPolicy.

Returns
FocusTraversalPolicy — the default FocusTraversalPolicy. null will never be returned.

See also

getFocusOwner()method 
public function getFocusOwner():Component

Returns the focus owner.

Returns
Component — the focus owner.

See also

getManager()method 
public static function getManager(theStage:Stage):FocusManager

Returns the current FocusManager instance

Parameters
theStage:Stage

Returns
FocusManager — this the current FocusManager instance

See also

getPopupsVector()method 
public function getPopupsVector():Vector

Returns
Vector
getPreviousFocusedComponent()method 
public function getPreviousFocusedComponent():Component

Returns the previous focused component.

Returns
Component — the previous focused component.
init()method 
public function init(theStage:Stage):void

Init the focus manager, it will only start works when it is inited. By default, it will be inited when a component is added to stage automatically.

Parameters
theStage:Stage
isDefaultTraversalEnabled()method 
public static function isDefaultTraversalEnabled():Boolean

Returns the default value for defaultTraversalEnabled.

Returns
Boolean

See also

isTraversalAsDefault()method 
public function isTraversalAsDefault():Boolean

Returns whether or not to use default value for traversal enabled.

Returns
Boolean

See also

isTraversalEnabled()method 
public function isTraversalEnabled():Boolean

Returns traversal by keys pressing is enabled or not. If isTraversalAsDefault() returns true, this will returns isDefaultTraversalEnabled

If this method called, TAB... keys will or not effect the focus traverse with this focus system.

And component will or not fire any Key events when there are focused and key pressed.

Returns
Boolean

See also

isTraversing()method 
public function isTraversing():Boolean

Returns if the focus is traversing by keys.

Once when focus traversed by FocusTraversalKeys this is turned on, true will be returned. Once when Mouse is down, this will be turned off, false will be returned.

Returns
Boolean — true if the focus is traversing by FocusTraversalKeys, otherwise returns false.

See also

moveFocusRectUpperTo()method 
public function moveFocusRectUpperTo(c:Component):SpriteParameters
c:Component

Returns
Sprite
setActiveWindow()method 
public function setActiveWindow(newActiveWindow:JWindow):void

Sets the active Window. The active Window is always either the focused Window, or the first Window that is an owner of the focused Window.

This method does not actually change the active Window . It merely stores the value to be subsequently returned by getActiveWindow(). Use Component.requestFocus() or Component.requestFocusInWindow() or JWindow.setActive()to change the active Window. Parameters

newActiveWindow:JWindow — the active Window

See also

setDefaultFocusTraversalPolicy()method 
public function setDefaultFocusTraversalPolicy(newDefaultPolicy:FocusTraversalPolicy):void

Sets the default FocusTraversalPolicy. Top-level components use this value on their creation to initialize their own focus traversal policy by explicit call to Container.setFocusTraversalPolicy. Note: this call doesn't affect already created components as they have their policy initialized. Only new components will use this policy as their default policy.

Parameters
newDefaultPolicy:FocusTraversalPolicy — the new, default FocusTraversalPolicy, if it is null, nothing will be done

See also

setDefaultTraversalEnabled()method 
public static function setDefaultTraversalEnabled(b:Boolean):void

The default to disables or enables the traversal by keys pressing.

Parameters
b:Boolean

See also

setFocusOwner()method 
public function setFocusOwner(newFocusOwner:Component):void

Sets the focus owner. The operation will be cancelled if the Component is not focusable.

This method does not actually set the focus to the specified Component. It merely stores the value to be subsequently returned by getFocusOwner(). Use Component.requestFocus() or Component.requestFocusInWindow() to change the focus owner. Parameters

newFocusOwner:Component — the focus owner

See also

setManager()method 
public static function setManager(theStage:Stage, newManager:FocusManager):void

Sets the current FocusManager instance. If null is specified, then the current FocusManager is replaced with a new instance of FocusManager.

Parameters
theStage:Stage — the new FocusManager
 
newManager:FocusManager

See also

setTraversalAsDefault()method 
public function setTraversalAsDefault(b:Boolean):void

Sets whether or not to use default value for traversal enabled.

Parameters
b:Boolean

See also

setTraversalEnabled()method 
public function setTraversalEnabled(b:Boolean):void

Disables or enables the traversal by keys pressing. This will call setTraversalAsDefault(false)

If this method called, TAB... keys will or not effect the focus traverse with this focus system.

And component will or not fire any Key events when there are focused and key pressed.

Parameters
b:Boolean

See also

setTraversing()method 
public function setTraversing(b:Boolean):void

Sets if the focus is traversing by keys.

By default, the traversing property will only be set true when TRAVERSAL_KEYS down. If your component need view focus rect, you should set it to true when your component's managed key down. Parameters

b:Boolean — true tag traversing to be true, false tag traversing to be false

See also

uninit()method 
public function uninit():void

Un-init this focus manager.