src/share/classes/sun/awt/SunToolkit.java

Print this page




1053         if (bimage == null) {
1054             return null;
1055         }
1056         Raster raster = bimage.getRaster();
1057         DataBuffer buffer = raster.getDataBuffer();
1058         return (DataBufferInt)buffer;
1059     }
1060 
1061     protected EventQueue getSystemEventQueueImpl() {
1062         return getSystemEventQueueImplPP();
1063     }
1064 
1065     // Package private implementation
1066     static EventQueue getSystemEventQueueImplPP() {
1067         return getSystemEventQueueImplPP(AppContext.getAppContext());
1068     }
1069 
1070     public static EventQueue getSystemEventQueueImplPP(AppContext appContext) {
1071         EventQueue theEventQueue =
1072             (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);







1073         return theEventQueue;
1074     }
1075 
1076     /**
1077      * Give native peers the ability to query the native container
1078      * given a native component (eg the direct parent may be lightweight).
1079      */
1080     public static Container getNativeContainer(Component c) {
1081         return Toolkit.getNativeContainer(c);
1082     }
1083 
1084     /**
1085      * Gives native peers the ability to query the closest HW component.
1086      * If the given component is heavyweight, then it returns this. Otherwise,
1087      * it goes one level up in the hierarchy and tests next component.
1088      */
1089     public static Component getHeavyweightComponent(Component c) {
1090         while (c != null && AWTAccessor.getComponentAccessor().isLightweight(c)) {
1091             c = AWTAccessor.getComponentAccessor().getParent(c);
1092         }




1053         if (bimage == null) {
1054             return null;
1055         }
1056         Raster raster = bimage.getRaster();
1057         DataBuffer buffer = raster.getDataBuffer();
1058         return (DataBufferInt)buffer;
1059     }
1060 
1061     protected EventQueue getSystemEventQueueImpl() {
1062         return getSystemEventQueueImplPP();
1063     }
1064 
1065     // Package private implementation
1066     static EventQueue getSystemEventQueueImplPP() {
1067         return getSystemEventQueueImplPP(AppContext.getAppContext());
1068     }
1069 
1070     public static EventQueue getSystemEventQueueImplPP(AppContext appContext) {
1071         EventQueue theEventQueue =
1072             (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
1073         // Sometimes EventQueue stored in AppContext may be null, (e.g. for the
1074         // static fields of an applet after refresh of the webpage). Let's use
1075         // the EventQueue from the default AppContext in this case.
1076         if (theEventQueue == null) {
1077             theEventQueue = (EventQueue)(AppContext.getAppContext()).get(
1078                 AppContext.EVENT_QUEUE_KEY);
1079         }
1080         return theEventQueue;
1081     }
1082 
1083     /**
1084      * Give native peers the ability to query the native container
1085      * given a native component (eg the direct parent may be lightweight).
1086      */
1087     public static Container getNativeContainer(Component c) {
1088         return Toolkit.getNativeContainer(c);
1089     }
1090 
1091     /**
1092      * Gives native peers the ability to query the closest HW component.
1093      * If the given component is heavyweight, then it returns this. Otherwise,
1094      * it goes one level up in the hierarchy and tests next component.
1095      */
1096     public static Component getHeavyweightComponent(Component c) {
1097         while (c != null && AWTAccessor.getComponentAccessor().isLightweight(c)) {
1098             c = AWTAccessor.getComponentAccessor().getParent(c);
1099         }