Java Doc for RepaintManager.java in  » 6.0-JDK-Core » swing » javax » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.RepaintManager

All known Subclasses:   javax.swing.BufferStrategyPaintManager,
RepaintManager
public class RepaintManager (Code)
This class manages repaint requests, allowing the number of repaints to be minimized, for example by collapsing multiple requests into a single repaint for members of a component tree.

As of 1.6 RepaintManager handles repaint requests for Swing's top level components (JApplet, JWindow, JFrame and JDialog). Any calls to repaint on one of these will call into the appropriate addDirtyRegion method.
version:
   1.76 05/09/07
author:
   Arnaud Weber


Inner Class :static class PaintManager

Field Summary
final static  booleanHANDLE_TOP_LEVEL_PAINT
     Whether or not the RepaintManager should handle paint requests for top levels.
 booleandoubleBufferingEnabled
    
 DoubleBufferInfostandardDoubleBuffer
    
 Rectangletmp
    
static  booleanvolatileImageBufferEnabled
    

Constructor Summary
public  RepaintManager()
     Create a new RepaintManager instance.

Method Summary
public  voidaddDirtyRegion(JComponent c, int x, int y, int w, int h)
     Add a component in the list of components that should be refreshed. If c already has a dirty region, the rectangle (x,y,w,h) will be unioned with the region that should be redrawn.
public  voidaddDirtyRegion(Window window, int x, int y, int w, int h)
     Adds window to the list of Components that need to be repainted.
public  voidaddDirtyRegion(Applet applet, int x, int y, int w, int h)
     Adds applet to the list of Components that need to be repainted.
public synchronized  voidaddInvalidComponent(JComponent invalidComponent)
     Mark the component as in need of layout and queue a runnable for the event dispatching thread that will validate the components first isValidateRoot() ancestor.
 voidbeginPaint()
     Invoked prior to any paint/copyArea method calls.
 voidcollectDirtyComponents(Map<Component, Rectangle> dirtyComponents, Component dirtyComponent, java.util.List<Component> roots)
    
 voidcopyArea(JComponent c, Graphics g, int x, int y, int w, int h, int deltaX, int deltaY, boolean clip)
     Does a copy area on the specified region.
public static  RepaintManagercurrentManager(Component c)
     Return the RepaintManager for the calling thread given a Component.
static  RepaintManagercurrentManager(AppContext appContext)
     Returns the RepaintManager for the specified AppContext.
public static  RepaintManagercurrentManager(JComponent c)
     Return the RepaintManager for the calling thread given a JComponent.

Note: This method exists for backward binary compatibility with earlier versions of the Swing library.

 voiddoubleBufferingChanged(JRootPane rootPane)
     Invoked when the doubleBuffered or useTrueDoubleBuffering properties of a JRootPane change.
 voidendPaint()
     Invoked after beginPaint has been invoked.
public  RectanglegetDirtyRegion(JComponent aComponent)
     Return the current dirty region for a component.
public  DimensiongetDoubleBufferMaximumSize()
     Returns the maximum double buffer size.
public  ImagegetOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
     Return the offscreen buffer that should be used as a double buffer with the component c.
public  ImagegetVolatileOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)
     Return a volatile offscreen buffer that should be used as a double buffer with the specified component c.
public  booleanisCompletelyDirty(JComponent aComponent)
     Convenience method that returns true if aComponent will be completely painted during the next paintDirtyRegions().
public  booleanisDoubleBufferingEnabled()
     Returns true if this RepaintManager is double buffered. The default value for this property may vary from platform to platform.
public  voidmarkCompletelyClean(JComponent aComponent)
     Mark a component completely clean.
public  voidmarkCompletelyDirty(JComponent aComponent)
     Mark a component completely dirty.
 voidnativeAddDirtyRegion(AppContext appContext, Container c, int x, int y, int w, int h)
    
 voidnativeQueueSurfaceDataRunnable(AppContext appContext, Component c, Runnable r)
    
 voidpaint(JComponent paintingComponent, JComponent bufferComponent, Graphics g, int x, int y, int w, int h)
    
public  voidpaintDirtyRegions()
     Paint all of the components that have been marked dirty.
public synchronized  voidremoveInvalidComponent(JComponent component)
     Remove a component from the list of invalid components.
 voidresetDoubleBuffer()
     This resets the double buffer.
 voidresetVolatileDoubleBuffer(GraphicsConfiguration gc)
     This resets the volatile double buffer.
 voidscheduleHeavyWeightPaints()
    
public static  voidsetCurrentManager(RepaintManager aRepaintManager)
     Set the RepaintManager that should be used for the calling thread.
public  voidsetDoubleBufferMaximumSize(Dimension d)
     Set the maximum double buffer size.
public  voidsetDoubleBufferingEnabled(boolean aFlag)
     Enables or disables double buffering in this RepaintManager.
 voidsetPaintManager(PaintManager paintManager)
     Sets the PaintManager that is used to handle all double buffered painting.
Parameters:
  paintManager - The PaintManager to use.
 booleanshow(Container c, int x, int y, int w, int h)
     If possible this will show a previously rendered portion of a Component.
public synchronized  StringtoString()
     Returns a string that displays and identifies this object's properties.
 booleanuseVolatileDoubleBuffer()
     Returns true if we should use the Image returned from getVolatileOffscreenBuffer to do double buffering.
public  voidvalidateInvalidComponents()
     Validate all of the components that have been marked invalid.

Field Detail
HANDLE_TOP_LEVEL_PAINT
final static boolean HANDLE_TOP_LEVEL_PAINT(Code)
Whether or not the RepaintManager should handle paint requests for top levels.



doubleBufferingEnabled
boolean doubleBufferingEnabled(Code)



standardDoubleBuffer
DoubleBufferInfo standardDoubleBuffer(Code)



tmp
Rectangle tmp(Code)



volatileImageBufferEnabled
static boolean volatileImageBufferEnabled(Code)




Constructor Detail
RepaintManager
public RepaintManager()(Code)
Create a new RepaintManager instance. You rarely call this constructor. directly. To get the default RepaintManager, use RepaintManager.currentManager(JComponent) (normally "this").




Method Detail
addDirtyRegion
public void addDirtyRegion(JComponent c, int x, int y, int w, int h)(Code)
Add a component in the list of components that should be refreshed. If c already has a dirty region, the rectangle (x,y,w,h) will be unioned with the region that should be redrawn.
Parameters:
  c - Component to repaint, null results in nothing happening.
Parameters:
  x - X coordinate of the region to repaint
Parameters:
  y - Y coordinate of the region to repaint
Parameters:
  w - Width of the region to repaint
Parameters:
  h - Height of the region to repaint
See Also:   JComponent.repaint



addDirtyRegion
public void addDirtyRegion(Window window, int x, int y, int w, int h)(Code)
Adds window to the list of Components that need to be repainted.
Parameters:
  window - Window to repaint, null results in nothing happening.
Parameters:
  x - X coordinate of the region to repaint
Parameters:
  y - Y coordinate of the region to repaint
Parameters:
  w - Width of the region to repaint
Parameters:
  h - Height of the region to repaint
See Also:   JFrame.repaint
See Also:   JWindow.repaint
See Also:   JDialog.repaint
since:
   1.6



addDirtyRegion
public void addDirtyRegion(Applet applet, int x, int y, int w, int h)(Code)
Adds applet to the list of Components that need to be repainted.
Parameters:
  applet - Applet to repaint, null results in nothing happening.
Parameters:
  x - X coordinate of the region to repaint
Parameters:
  y - Y coordinate of the region to repaint
Parameters:
  w - Width of the region to repaint
Parameters:
  h - Height of the region to repaint
See Also:   JApplet.repaint
since:
   1.6



addInvalidComponent
public synchronized void addInvalidComponent(JComponent invalidComponent)(Code)
Mark the component as in need of layout and queue a runnable for the event dispatching thread that will validate the components first isValidateRoot() ancestor.
See Also:   JComponent.isValidateRoot
See Also:   RepaintManager.removeInvalidComponent



beginPaint
void beginPaint()(Code)
Invoked prior to any paint/copyArea method calls. This will be followed by an invocation of endPaint. WARNING: Callers of this method need to wrap the call in a try/finally, otherwise if an exception is thrown during the course of painting the RepaintManager may be left in a state in which the screen is not updated, eg:
 repaintManager.beginPaint();
 try {
 repaintManager.paint(...);
 } finally {
 repaintManager.endPaint();
 }
 



collectDirtyComponents
void collectDirtyComponents(Map<Component, Rectangle> dirtyComponents, Component dirtyComponent, java.util.List<Component> roots)(Code)



copyArea
void copyArea(JComponent c, Graphics g, int x, int y, int w, int h, int deltaX, int deltaY, boolean clip)(Code)
Does a copy area on the specified region.
Parameters:
  clip - Whether or not the copyArea needs to be clipped to theComponent's bounds.



currentManager
public static RepaintManager currentManager(Component c)(Code)
Return the RepaintManager for the calling thread given a Component.
Parameters:
  c - a Component -- unused in the default implementation, but couldbe used by an overridden version to return a different RepaintManagerdepending on the Component the RepaintManager object



currentManager
static RepaintManager currentManager(AppContext appContext)(Code)
Returns the RepaintManager for the specified AppContext. If a RepaintManager has not been created for the specified AppContext this will return null.



currentManager
public static RepaintManager currentManager(JComponent c)(Code)
Return the RepaintManager for the calling thread given a JComponent.

Note: This method exists for backward binary compatibility with earlier versions of the Swing library. It simply returns the result returned by RepaintManager.currentManager(Component) .
Parameters:
  c - a JComponent -- unused the RepaintManager object




doubleBufferingChanged
void doubleBufferingChanged(JRootPane rootPane)(Code)
Invoked when the doubleBuffered or useTrueDoubleBuffering properties of a JRootPane change. This may come in on any thread.



endPaint
void endPaint()(Code)
Invoked after beginPaint has been invoked.



getDirtyRegion
public Rectangle getDirtyRegion(JComponent aComponent)(Code)
Return the current dirty region for a component. Return an empty rectangle if the component is not dirty.



getDoubleBufferMaximumSize
public Dimension getDoubleBufferMaximumSize()(Code)
Returns the maximum double buffer size. a Dimension object representing the maximum size



getOffscreenBuffer
public Image getOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)(Code)
Return the offscreen buffer that should be used as a double buffer with the component c. By default there is a double buffer per RepaintManager. The buffer might be smaller than (proposedWidth,proposedHeight) This happens when the maximum double buffer size as been set for the receiving repaint manager.



getVolatileOffscreenBuffer
public Image getVolatileOffscreenBuffer(Component c, int proposedWidth, int proposedHeight)(Code)
Return a volatile offscreen buffer that should be used as a double buffer with the specified component c. The image returned will be an instance of VolatileImage, or null if a VolatileImage object could not be instantiated. This buffer might be smaller than (proposedWidth,proposedHeight). This happens when the maximum double buffer size has been set for this repaint manager.
See Also:   java.awt.image.VolatileImage
since:
   1.4



isCompletelyDirty
public boolean isCompletelyDirty(JComponent aComponent)(Code)
Convenience method that returns true if aComponent will be completely painted during the next paintDirtyRegions(). If computing dirty regions is expensive for your component, use this method and avoid computing dirty region if it return true.



isDoubleBufferingEnabled
public boolean isDoubleBufferingEnabled()(Code)
Returns true if this RepaintManager is double buffered. The default value for this property may vary from platform to platform. On platforms where native double buffering is supported in the AWT, the default value will be false to avoid unnecessary buffering in Swing. On platforms where native double buffering is not supported, the default value will be true. true if this object is double buffered



markCompletelyClean
public void markCompletelyClean(JComponent aComponent)(Code)
Mark a component completely clean. aComponent will not get painted during the next paintDirtyRegions() call.



markCompletelyDirty
public void markCompletelyDirty(JComponent aComponent)(Code)
Mark a component completely dirty. aComponent will be completely painted during the next paintDirtyRegions() call.



nativeAddDirtyRegion
void nativeAddDirtyRegion(AppContext appContext, Container c, int x, int y, int w, int h)(Code)



nativeQueueSurfaceDataRunnable
void nativeQueueSurfaceDataRunnable(AppContext appContext, Component c, Runnable r)(Code)



paint
void paint(JComponent paintingComponent, JComponent bufferComponent, Graphics g, int x, int y, int w, int h)(Code)
Paints a region of a component
Parameters:
  paintingComponent - Component to paint
Parameters:
  bufferComponent - Component to obtain buffer for
Parameters:
  g - Graphics to paint to
Parameters:
  x - X-coordinate
Parameters:
  y - Y-coordinate
Parameters:
  w - Width
Parameters:
  h - Height



paintDirtyRegions
public void paintDirtyRegions()(Code)
Paint all of the components that have been marked dirty.
See Also:   RepaintManager.addDirtyRegion



removeInvalidComponent
public synchronized void removeInvalidComponent(JComponent component)(Code)
Remove a component from the list of invalid components.
See Also:   RepaintManager.addInvalidComponent



resetDoubleBuffer
void resetDoubleBuffer()(Code)
This resets the double buffer. Actually, it marks the double buffer as invalid, the double buffer will then be recreated on the next invocation of getOffscreenBuffer.



resetVolatileDoubleBuffer
void resetVolatileDoubleBuffer(GraphicsConfiguration gc)(Code)
This resets the volatile double buffer.



scheduleHeavyWeightPaints
void scheduleHeavyWeightPaints()(Code)



setCurrentManager
public static void setCurrentManager(RepaintManager aRepaintManager)(Code)
Set the RepaintManager that should be used for the calling thread. aRepaintManager will become the current RepaintManager for the calling thread's thread group.
Parameters:
  aRepaintManager - the RepaintManager object to use



setDoubleBufferMaximumSize
public void setDoubleBufferMaximumSize(Dimension d)(Code)
Set the maximum double buffer size. *



setDoubleBufferingEnabled
public void setDoubleBufferingEnabled(boolean aFlag)(Code)
Enables or disables double buffering in this RepaintManager. CAUTION: The default value for this property is set for optimal paint performance on the given platform and it is not recommended that programs modify this property directly.
Parameters:
  aFlag - true to activate double buffering
See Also:   RepaintManager.isDoubleBufferingEnabled



setPaintManager
void setPaintManager(PaintManager paintManager)(Code)
Sets the PaintManager that is used to handle all double buffered painting.
Parameters:
  paintManager - The PaintManager to use. Passing in null indicatesthe fallback PaintManager should be used.



show
boolean show(Container c, int x, int y, int w, int h)(Code)
If possible this will show a previously rendered portion of a Component. If successful, this will return true, otherwise false.

WARNING: This method is invoked from the native toolkit thread, be very careful as to what methods this invokes!




toString
public synchronized String toString()(Code)
Returns a string that displays and identifies this object's properties. a String representation of this object



useVolatileDoubleBuffer
boolean useVolatileDoubleBuffer()(Code)
Returns true if we should use the Image returned from getVolatileOffscreenBuffer to do double buffering.



validateInvalidComponents
public void validateInvalidComponents()(Code)
Validate all of the components that have been marked invalid.
See Also:   RepaintManager.addInvalidComponent



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.