classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Added getVolatileOffscreenBuffer to javax.swing.Repain


From: Roman Kennke
Subject: [cp-patches] FYI: Added getVolatileOffscreenBuffer to javax.swing.RepaintManager
Date: Fri, 13 May 2005 14:03:47 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204

I added a missing method to javax.swing.RepaintManager.

2005-05-13  Roman Kennke  <address@hidden>

       * javax/swing/RepaintManager.java:
       (getVolatileOffscreenBuffer): Added methods.


/Roman

Index: javax/swing/RepaintManager.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/RepaintManager.java,v
retrieving revision 1.10
diff -u -r1.10 RepaintManager.java
--- javax/swing/RepaintManager.java     26 Apr 2005 18:56:19 -0000      1.10
+++ javax/swing/RepaintManager.java     13 May 2005 12:01:45 -0000
@@ -489,6 +489,31 @@
   }
 
   /**
+   * Creates and returns a volatile offscreen buffer for the specified
+   * component that can be used as a double buffer. The returned image
+   * is a address@hidden VolatileImage}. Its size will be <code>(proposedWidth,
+   * proposedHeight)</code> except when the maximum double buffer size
+   * has been set in this RepaintManager.
+   *
+   * @param comp the Component for which to create a volatile buffer
+   * @param proposedWidth the proposed width of the buffer
+   * @param proposedHeight the proposed height of the buffer
+   *
+   * @since 1.4
+   *
+   * @see address@hidden VolatileImage}
+   */
+  public Image getVolatileOffscreenBuffer(Component comp, int proposedWidth,
+                                          int proposedHeight)
+  {
+    int maxWidth = doubleBufferMaximumSize.width;
+    int maxHeight = doubleBufferMaximumSize.height;
+    return comp.createVolatileImage(Math.min(maxWidth, proposedWidth),
+                                    Math.min(maxHeight, proposedHeight));
+  }
+  
+
+  /**
    * Get the value of the address@hidden #doubleBufferMaximumSize} property.
    *
    * @return The current value of the property

reply via email to

[Prev in Thread] Current Thread [Next in Thread]