< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XWindow.java

Print this page




 322             return false;
 323         }
 324         Container parent = AWTAccessor.getComponentAccessor().getParent(win.target);
 325         while (parent != null && parent != target) {
 326             parent = AWTAccessor.getComponentAccessor().getParent(parent);
 327         }
 328         return (parent == target);
 329     }
 330 
 331     public Object getTarget() {
 332         return target;
 333     }
 334     public Component getEventSource() {
 335         return target;
 336     }
 337 
 338     public ColorModel getColorModel(int transparency) {
 339         return graphicsConfig.getColorModel (transparency);
 340     }
 341 

 342     public ColorModel getColorModel() {
 343         if (graphicsConfig != null) {
 344             return graphicsConfig.getColorModel ();
 345         }
 346         else {
 347             return XToolkit.getStaticColorModel();
 348         }
 349     }
 350 
 351     Graphics getGraphics(SurfaceData surfData, Color afore, Color aback, Font afont) {
 352         if (surfData == null) return null;
 353 
 354         Component target = this.target;
 355 
 356         /* Fix for bug 4746122. Color and Font shouldn't be null */
 357         Color bgColor = aback;
 358         if (bgColor == null) {
 359             bgColor = SystemColor.window;
 360         }
 361         Color fgColor = afore;
 362         if (fgColor == null) {
 363             fgColor = SystemColor.windowText;
 364         }
 365         Font font = afont;
 366         if (font == null) {
 367             font = XWindow.getDefaultFont();




 322             return false;
 323         }
 324         Container parent = AWTAccessor.getComponentAccessor().getParent(win.target);
 325         while (parent != null && parent != target) {
 326             parent = AWTAccessor.getComponentAccessor().getParent(parent);
 327         }
 328         return (parent == target);
 329     }
 330 
 331     public Object getTarget() {
 332         return target;
 333     }
 334     public Component getEventSource() {
 335         return target;
 336     }
 337 
 338     public ColorModel getColorModel(int transparency) {
 339         return graphicsConfig.getColorModel (transparency);
 340     }
 341 
 342     @Override
 343     public ColorModel getColorModel() {
 344         if (graphicsConfig != null) {
 345             return graphicsConfig.getColorModel ();
 346         }
 347         else {
 348             return Toolkit.getDefaultToolkit().getColorModel();
 349         }
 350     }
 351 
 352     Graphics getGraphics(SurfaceData surfData, Color afore, Color aback, Font afont) {
 353         if (surfData == null) return null;
 354 
 355         Component target = this.target;
 356 
 357         /* Fix for bug 4746122. Color and Font shouldn't be null */
 358         Color bgColor = aback;
 359         if (bgColor == null) {
 360             bgColor = SystemColor.window;
 361         }
 362         Color fgColor = afore;
 363         if (fgColor == null) {
 364             fgColor = SystemColor.windowText;
 365         }
 366         Font font = afont;
 367         if (font == null) {
 368             font = XWindow.getDefaultFont();


< prev index next >