src/solaris/classes/sun/awt/X11/XPanelPeer.java

Print this page




 106         synchronized(target.getTreeLock()) {
 107             int n = cont.getComponentCount();
 108             for(int i=0; i < n; i++) {
 109                 Component comp = cont.getComponent(i);
 110                 Color color = comp.getForeground();
 111                 if (color == null || color.equals(c)) {
 112                     ComponentPeer cpeer = comp.getPeer();
 113                     if (cpeer != null) {
 114                         cpeer.setForeground(c);
 115                     }
 116                     if (cpeer instanceof LightweightPeer
 117                         && comp instanceof Container)
 118                     {
 119                         setForegroundForHierarchy((Container) comp, c);
 120                     }
 121                 }
 122             }
 123         }
 124     }
 125 
 126     /**
 127      * DEPRECATED:  Replaced by getInsets().
 128      */
 129     public Insets insets() {
 130         return getInsets();
 131     }
 132 
 133     public void dispose() {
 134         if (embedder != null) {
 135             embedder.deinstall();
 136         }
 137         super.dispose();
 138     }
 139 
 140     protected boolean shouldFocusOnClick() {
 141         // Return false if this container has children so in that case it won't
 142         // be focused. Return true otherwise.
 143         return ((Container)target).getComponentCount() == 0;
 144     }
 145 }


 106         synchronized(target.getTreeLock()) {
 107             int n = cont.getComponentCount();
 108             for(int i=0; i < n; i++) {
 109                 Component comp = cont.getComponent(i);
 110                 Color color = comp.getForeground();
 111                 if (color == null || color.equals(c)) {
 112                     ComponentPeer cpeer = comp.getPeer();
 113                     if (cpeer != null) {
 114                         cpeer.setForeground(c);
 115                     }
 116                     if (cpeer instanceof LightweightPeer
 117                         && comp instanceof Container)
 118                     {
 119                         setForegroundForHierarchy((Container) comp, c);
 120                     }
 121                 }
 122             }
 123         }
 124     }
 125 







 126     public void dispose() {
 127         if (embedder != null) {
 128             embedder.deinstall();
 129         }
 130         super.dispose();
 131     }
 132 
 133     protected boolean shouldFocusOnClick() {
 134         // Return false if this container has children so in that case it won't
 135         // be focused. Return true otherwise.
 136         return ((Container)target).getComponentCount() == 0;
 137     }
 138 }