src/macosx/classes/sun/lwawt/LWComponentPeer.java

Print this page




 422     }
 423 
 424 
 425     // Just a helper method
 426     public final LWGraphicsConfig getLWGC() {
 427         return (LWGraphicsConfig) getGraphicsConfiguration();
 428     }
 429 
 430     /*
 431      * Overridden in LWWindowPeer to replace its surface
 432      * data and back buffer.
 433      */
 434     @Override
 435     public boolean updateGraphicsData(GraphicsConfiguration gc) {
 436         // TODO: not implemented
 437 //        throw new RuntimeException("Has not been implemented yet.");
 438         return false;
 439     }
 440 
 441     @Override
 442     public final Graphics getGraphics() {
 443         final Graphics g = getOnscreenGraphics();
 444         if (g != null) {
 445             synchronized (getPeerTreeLock()){
 446                 applyConstrain(g);
 447             }
 448         }
 449         return g;
 450     }
 451 
 452     /*
 453      * Peer Graphics is borrowed from the parent peer, while
 454      * foreground and background colors and font are specific to
 455      * this peer.
 456      */
 457     public final Graphics getOnscreenGraphics() {
 458         final LWWindowPeer wp = getWindowPeerOrSelf();
 459         return wp.getOnscreenGraphics(getForeground(), getBackground(),
 460                                       getFont());
 461 
 462     }




 422     }
 423 
 424 
 425     // Just a helper method
 426     public final LWGraphicsConfig getLWGC() {
 427         return (LWGraphicsConfig) getGraphicsConfiguration();
 428     }
 429 
 430     /*
 431      * Overridden in LWWindowPeer to replace its surface
 432      * data and back buffer.
 433      */
 434     @Override
 435     public boolean updateGraphicsData(GraphicsConfiguration gc) {
 436         // TODO: not implemented
 437 //        throw new RuntimeException("Has not been implemented yet.");
 438         return false;
 439     }
 440 
 441     @Override
 442     public Graphics getGraphics() {
 443         final Graphics g = getOnscreenGraphics();
 444         if (g != null) {
 445             synchronized (getPeerTreeLock()){
 446                 applyConstrain(g);
 447             }
 448         }
 449         return g;
 450     }
 451 
 452     /*
 453      * Peer Graphics is borrowed from the parent peer, while
 454      * foreground and background colors and font are specific to
 455      * this peer.
 456      */
 457     public final Graphics getOnscreenGraphics() {
 458         final LWWindowPeer wp = getWindowPeerOrSelf();
 459         return wp.getOnscreenGraphics(getForeground(), getBackground(),
 460                                       getFont());
 461 
 462     }