< prev index next >

src/java.desktop/share/classes/java/awt/Container.java

Print this page




  38 import java.io.ObjectInputStream;
  39 import java.io.ObjectOutputStream;
  40 import java.io.ObjectStreamField;
  41 import java.io.PrintStream;
  42 import java.io.PrintWriter;
  43 
  44 import java.lang.ref.WeakReference;
  45 import java.security.AccessController;
  46 
  47 import java.util.ArrayList;
  48 import java.util.EventListener;
  49 import java.util.HashSet;
  50 import java.util.Set;
  51 
  52 import javax.accessibility.*;
  53 
  54 import sun.util.logging.PlatformLogger;
  55 
  56 import sun.awt.AppContext;
  57 import sun.awt.AWTAccessor;
  58 import sun.awt.CausedFocusEvent;
  59 import sun.awt.PeerEvent;
  60 import sun.awt.SunToolkit;
  61 
  62 import sun.awt.dnd.SunDropTargetEvent;
  63 
  64 import sun.java2d.pipe.Region;
  65 
  66 import sun.security.action.GetBooleanAction;
  67 
  68 /**
  69  * A generic Abstract Window Toolkit(AWT) container object is a component
  70  * that can contain other AWT components.
  71  * <p>
  72  * Components added to a container are tracked in a list.  The order
  73  * of the list will define the components' front-to-back stacking order
  74  * within the container.  If no index is specified when adding a
  75  * component to a container, it will be added to the end of the list
  76  * (and hence to the bottom of the stacking order).
  77  * <p>
  78  * <b>Note</b>: For details on the focus subsystem, see


3498 
3499     /**
3500      * Transfers the focus down one focus traversal cycle. If this Container is
3501      * a focus cycle root, then the focus owner is set to this Container's
3502      * default Component to focus, and the current focus cycle root is set to
3503      * this Container. If this Container is not a focus cycle root, then no
3504      * focus traversal operation occurs.
3505      *
3506      * @see       Component#requestFocus()
3507      * @see       #isFocusCycleRoot
3508      * @see       #setFocusCycleRoot
3509      * @since     1.4
3510      */
3511     public void transferFocusDownCycle() {
3512         if (isFocusCycleRoot()) {
3513             KeyboardFocusManager.getCurrentKeyboardFocusManager().
3514                 setGlobalCurrentFocusCycleRootPriv(this);
3515             Component toFocus = getFocusTraversalPolicy().
3516                 getDefaultComponent(this);
3517             if (toFocus != null) {
3518                 toFocus.requestFocus(CausedFocusEvent.Cause.TRAVERSAL_DOWN);
3519             }
3520         }
3521     }
3522 
3523     void preProcessKeyEvent(KeyEvent e) {
3524         Container parent = this.parent;
3525         if (parent != null) {
3526             parent.preProcessKeyEvent(e);
3527         }
3528     }
3529 
3530     void postProcessKeyEvent(KeyEvent e) {
3531         Container parent = this.parent;
3532         if (parent != null) {
3533             parent.postProcessKeyEvent(e);
3534         }
3535     }
3536 
3537     boolean postsOldMouseEvents() {
3538         return true;




  38 import java.io.ObjectInputStream;
  39 import java.io.ObjectOutputStream;
  40 import java.io.ObjectStreamField;
  41 import java.io.PrintStream;
  42 import java.io.PrintWriter;
  43 
  44 import java.lang.ref.WeakReference;
  45 import java.security.AccessController;
  46 
  47 import java.util.ArrayList;
  48 import java.util.EventListener;
  49 import java.util.HashSet;
  50 import java.util.Set;
  51 
  52 import javax.accessibility.*;
  53 
  54 import sun.util.logging.PlatformLogger;
  55 
  56 import sun.awt.AppContext;
  57 import sun.awt.AWTAccessor;

  58 import sun.awt.PeerEvent;
  59 import sun.awt.SunToolkit;
  60 
  61 import sun.awt.dnd.SunDropTargetEvent;
  62 
  63 import sun.java2d.pipe.Region;
  64 
  65 import sun.security.action.GetBooleanAction;
  66 
  67 /**
  68  * A generic Abstract Window Toolkit(AWT) container object is a component
  69  * that can contain other AWT components.
  70  * <p>
  71  * Components added to a container are tracked in a list.  The order
  72  * of the list will define the components' front-to-back stacking order
  73  * within the container.  If no index is specified when adding a
  74  * component to a container, it will be added to the end of the list
  75  * (and hence to the bottom of the stacking order).
  76  * <p>
  77  * <b>Note</b>: For details on the focus subsystem, see


3497 
3498     /**
3499      * Transfers the focus down one focus traversal cycle. If this Container is
3500      * a focus cycle root, then the focus owner is set to this Container's
3501      * default Component to focus, and the current focus cycle root is set to
3502      * this Container. If this Container is not a focus cycle root, then no
3503      * focus traversal operation occurs.
3504      *
3505      * @see       Component#requestFocus()
3506      * @see       #isFocusCycleRoot
3507      * @see       #setFocusCycleRoot
3508      * @since     1.4
3509      */
3510     public void transferFocusDownCycle() {
3511         if (isFocusCycleRoot()) {
3512             KeyboardFocusManager.getCurrentKeyboardFocusManager().
3513                 setGlobalCurrentFocusCycleRootPriv(this);
3514             Component toFocus = getFocusTraversalPolicy().
3515                 getDefaultComponent(this);
3516             if (toFocus != null) {
3517                 toFocus.requestFocus(FocusEvent.Cause.TRAVERSAL_DOWN);
3518             }
3519         }
3520     }
3521 
3522     void preProcessKeyEvent(KeyEvent e) {
3523         Container parent = this.parent;
3524         if (parent != null) {
3525             parent.preProcessKeyEvent(e);
3526         }
3527     }
3528 
3529     void postProcessKeyEvent(KeyEvent e) {
3530         Container parent = this.parent;
3531         if (parent != null) {
3532             parent.postProcessKeyEvent(e);
3533         }
3534     }
3535 
3536     boolean postsOldMouseEvents() {
3537         return true;


< prev index next >