Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.stanford.genetics.treeview
Class ContainerFocusTracker  view ContainerFocusTracker download ContainerFocusTracker.java

java.lang.Object
  extended byedu.stanford.genetics.treeview.ContainerFocusTracker
All Implemented Interfaces:
java.awt.event.ContainerListener, java.util.EventListener, java.awt.event.FocusListener

public class ContainerFocusTracker
extends java.lang.Object
implements java.awt.event.FocusListener, java.awt.event.ContainerListener

Note: I, Alok, didn't write this class. Class for Containers which won't take the keyboard focus. Because of what appears to be a bug in Java 1.1, when you move the focus on to a Frame, or other Container, it keeps the focus, rather than handing it on to an appropriate tabstop inside it. This class collects all focus events for the Container and its contents, and will correct the problem. It also monitors the Container, and keeps track if the focussed component is removed from the container. To use, just create a tracker, passing it the Container you want to deal with.


Field Summary
(package private)  java.awt.Container container
           
(package private) static boolean debug
           
(package private)  java.awt.Component focus
           
(package private) static RCSVersion version
           
 
Constructor Summary
ContainerFocusTracker(java.awt.Container c)
           
 
Method Summary
private  void addComponent(java.awt.Component c)
           
private  void addContainer(java.awt.Container container)
           
 void componentAdded(java.awt.event.ContainerEvent e)
          This method is called when a component is added to the container.
 void componentRemoved(java.awt.event.ContainerEvent e)
          This method is called when a component is removed from the container.
 void focusGained(java.awt.event.FocusEvent e)
          This method is called when a component gains the keyboard focus.
 void focusLost(java.awt.event.FocusEvent e)
          This method is invoked when a component loses the keyboard focus.
private  void removeComponent(java.awt.Component c)
           
private  void removeContainer(java.awt.Container container)
           
private  boolean switchFocus(java.awt.Container container)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

static RCSVersion version

container

java.awt.Container container

focus

java.awt.Component focus

debug

static final boolean debug
See Also:
Constant Field Values
Constructor Detail

ContainerFocusTracker

public ContainerFocusTracker(java.awt.Container c)
Method Detail

componentAdded

public void componentAdded(java.awt.event.ContainerEvent e)
Description copied from interface: java.awt.event.ContainerListener
This method is called when a component is added to the container.

Specified by:
componentAdded in interface java.awt.event.ContainerListener

componentRemoved

public void componentRemoved(java.awt.event.ContainerEvent e)
Description copied from interface: java.awt.event.ContainerListener
This method is called when a component is removed from the container.

Specified by:
componentRemoved in interface java.awt.event.ContainerListener

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Description copied from interface: java.awt.event.FocusListener
This method is called when a component gains the keyboard focus.

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Description copied from interface: java.awt.event.FocusListener
This method is invoked when a component loses the keyboard focus.

Specified by:
focusLost in interface java.awt.event.FocusListener

switchFocus

private boolean switchFocus(java.awt.Container container)

addComponent

private void addComponent(java.awt.Component c)

addContainer

private void addContainer(java.awt.Container container)

removeComponent

private void removeComponent(java.awt.Component c)

removeContainer

private void removeContainer(java.awt.Container container)