codeblockutil
Class GraphicsManager

java.lang.Object
  extended by codeblockutil.GraphicsManager

public class GraphicsManager
extends java.lang.Object

GraphicsManager maintains graphics context information that maybe useful for many aspects of graphics rendering. This means that many of the fields are computer dependent and are placed here so they are only calculated once.


Field Summary
static java.awt.GraphicsConfiguration gc
           
 
Constructor Summary
GraphicsManager()
           
 
Method Summary
static java.awt.image.BufferedImage getGCCompatibleImage(int width, int height)
          Functionally equivalent to gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT) but allows reusing released images.
static void recycleGCCompatibleImage(java.awt.image.BufferedImage img)
          Add an image to the recycled images list (or if img = null, does nothing).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gc

public static java.awt.GraphicsConfiguration gc
Constructor Detail

GraphicsManager

public GraphicsManager()
Method Detail

getGCCompatibleImage

public static java.awt.image.BufferedImage getGCCompatibleImage(int width,
                                                                int height)
Functionally equivalent to gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT) but allows reusing released images.


recycleGCCompatibleImage

public static void recycleGCCompatibleImage(java.awt.image.BufferedImage img)
Add an image to the recycled images list (or if img = null, does nothing). Note: the passed variable should be immediately set to null to avoid aliasing bugs.