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

Print this page




  60     public static PaintEventDispatcher getPaintEventDispatcher() {
  61         synchronized(PaintEventDispatcher.class) {
  62             if (dispatcher == null) {
  63                 dispatcher = new PaintEventDispatcher();
  64             }
  65             return dispatcher;
  66         }
  67     }
  68 
  69     /**
  70      * Creates and returns the <code>PaintEvent</code> that should be
  71      * dispatched for the specified component.  If this returns null
  72      * no <code>PaintEvent</code> is dispatched.
  73      * <p>
  74      * <b>WARNING:</b> This is invoked from the native thread, be careful
  75      * what methods you end up invoking here.
  76      */
  77     public PaintEvent createPaintEvent(Component target, int x, int y, int w,
  78                                        int h) {
  79 
  80         return new PaintEvent((Component)target, PaintEvent.PAINT,
  81                               new Rectangle(x, y, w, h));
  82     }
  83 
  84     /**
  85      * Returns true if a native background erase should be done for
  86      * the specified Component.
  87      */
  88     public boolean shouldDoNativeBackgroundErase(Component c) {
  89         return true;
  90     }
  91 
  92     /**
  93      * This method is invoked from the toolkit thread when the surface
  94      * data of the component needs to be replaced. The method run() of
  95      * the Runnable argument performs surface data replacing, run()
  96      * should be invoked on the EDT of this component's AppContext.
  97      * Returns true if the Runnable has been enqueued to be invoked
  98      * on the EDT.
  99      * (Fix 6255371.)
 100      */


  60     public static PaintEventDispatcher getPaintEventDispatcher() {
  61         synchronized(PaintEventDispatcher.class) {
  62             if (dispatcher == null) {
  63                 dispatcher = new PaintEventDispatcher();
  64             }
  65             return dispatcher;
  66         }
  67     }
  68 
  69     /**
  70      * Creates and returns the <code>PaintEvent</code> that should be
  71      * dispatched for the specified component.  If this returns null
  72      * no <code>PaintEvent</code> is dispatched.
  73      * <p>
  74      * <b>WARNING:</b> This is invoked from the native thread, be careful
  75      * what methods you end up invoking here.
  76      */
  77     public PaintEvent createPaintEvent(Component target, int x, int y, int w,
  78                                        int h) {
  79 
  80         return new PaintEvent(target, PaintEvent.PAINT,
  81                               new Rectangle(x, y, w, h));
  82     }
  83 
  84     /**
  85      * Returns true if a native background erase should be done for
  86      * the specified Component.
  87      */
  88     public boolean shouldDoNativeBackgroundErase(Component c) {
  89         return true;
  90     }
  91 
  92     /**
  93      * This method is invoked from the toolkit thread when the surface
  94      * data of the component needs to be replaced. The method run() of
  95      * the Runnable argument performs surface data replacing, run()
  96      * should be invoked on the EDT of this component's AppContext.
  97      * Returns true if the Runnable has been enqueued to be invoked
  98      * on the EDT.
  99      * (Fix 6255371.)
 100      */