src/macosx/classes/com/apple/laf/ScreenPopupFactory.java

Print this page




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.apple.laf;
  27 
  28 import java.awt.*;
  29 import java.security.PrivilegedAction;
  30 
  31 import javax.swing.*;
  32 
  33 import sun.lwawt.macosx.CPlatformWindow;
  34 
  35 class ScreenPopupFactory extends PopupFactory {
  36     static {
  37         java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui"));




  38     }


  39 
  40     static final Float TRANSLUCENT = new Float(248f/255f);
  41     static final Float OPAQUE = new Float(1.0f);
  42 
  43     boolean fIsActive = true;
  44 
  45     // Only popups generated with the Aqua LaF turned on will be translucent with shadows
  46     void setActive(final boolean b) {
  47         fIsActive = b;
  48     }
  49 
  50     private static Window getWindow(final Component c) {
  51         Component w = c;
  52         while(!(w instanceof Window) && (w!=null)) {
  53             w = w.getParent();
  54         }
  55         return (Window)w;
  56     }
  57 
  58     /*




   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.apple.laf;
  27 
  28 import java.awt.*;


  29 import javax.swing.*;
  30 
  31 import sun.lwawt.macosx.CPlatformWindow;
  32 
  33 class ScreenPopupFactory extends PopupFactory {
  34     static {
  35         java.security.AccessController.doPrivileged(
  36             new java.security.PrivilegedAction<Void>() {
  37                 public Void run() {
  38                     System.loadLibrary("osxui");
  39                     return null;
  40                 }
  41             });
  42     }
  43 
  44     static final Float TRANSLUCENT = new Float(248f/255f);
  45     static final Float OPAQUE = new Float(1.0f);
  46 
  47     boolean fIsActive = true;
  48 
  49     // Only popups generated with the Aqua LaF turned on will be translucent with shadows
  50     void setActive(final boolean b) {
  51         fIsActive = b;
  52     }
  53 
  54     private static Window getWindow(final Component c) {
  55         Component w = c;
  56         while(!(w instanceof Window) && (w!=null)) {
  57             w = w.getParent();
  58         }
  59         return (Window)w;
  60     }
  61 
  62     /*