bibliothek.gui.dock.control.focus
Class FocusTracker

java.lang.Object
  extended by bibliothek.gui.dock.control.focus.FocusTracker

public class FocusTracker
extends Object

A focus tracker keeps information about the last focused Component of some Container.

Author:
Benjamin Sigg

Constructor Summary
FocusTracker(Component root)
          Creates a new focus tracker.
 
Method Summary
protected  void add(Component component)
          Adds listeners to component and its children to track the focus.
 void destroy()
          Removes any listeners this FocusTracker added anywhere allowing this FocusTracker to be collected by the garbage collector.
 Component getLastFocused()
          Gets the last component that was focused
protected  void remove(Component component)
          Removes listeners from component and its children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FocusTracker

public FocusTracker(Component root)
Creates a new focus tracker.

Parameters:
root - the root container whose children can be focused
Method Detail

destroy

public void destroy()
Removes any listeners this FocusTracker added anywhere allowing this FocusTracker to be collected by the garbage collector.


getLastFocused

public Component getLastFocused()
Gets the last component that was focused

Returns:
the last component, can be null, will be a child of the root container or the root container itself

add

protected void add(Component component)
Adds listeners to component and its children to track the focus.

Parameters:
component - the component and its children to track

remove

protected void remove(Component component)
Removes listeners from component and its children.

Parameters:
component - the component to remove