standup.utils
Class GraphicsUtils

java.lang.Object
  extended by standup.utils.GraphicsUtils

public class GraphicsUtils
extends Object

Provides various static methods for dealing with BufferedImages, i.e. scaling, handling transparency, etc.

Some of them are used by the SymbolRenderers.

Author:
Ruli Manurung

Field Summary
private static GraphicsConfiguration cachedGraphicsConfiguration
           
 
Constructor Summary
GraphicsUtils()
           
 
Method Summary
static BufferedImage copy(BufferedImage source, BufferedImage target)
           
static GraphicsConfiguration getDefaultConfiguration()
           
static BufferedImage getScaledInstance(BufferedImage image, int width, int height)
           
static BufferedImage getScaledInstanceByHeight(BufferedImage image, int height)
           
static boolean hasAlpha(Image image)
           
static Image makeColorTransparent(Image im, Color color)
           
static BufferedImage toBufferedImage(Image image)
           
static BufferedImage toCompatibleImage(BufferedImage image, GraphicsConfiguration gc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedGraphicsConfiguration

private static GraphicsConfiguration cachedGraphicsConfiguration
Constructor Detail

GraphicsUtils

public GraphicsUtils()
Method Detail

makeColorTransparent

public static Image makeColorTransparent(Image im,
                                         Color color)

toBufferedImage

public static BufferedImage toBufferedImage(Image image)

hasAlpha

public static boolean hasAlpha(Image image)

copy

public static BufferedImage copy(BufferedImage source,
                                 BufferedImage target)

getScaledInstance

public static BufferedImage getScaledInstance(BufferedImage image,
                                              int width,
                                              int height)

getScaledInstanceByHeight

public static BufferedImage getScaledInstanceByHeight(BufferedImage image,
                                                      int height)

getDefaultConfiguration

public static GraphicsConfiguration getDefaultConfiguration()

toCompatibleImage

public static BufferedImage toCompatibleImage(BufferedImage image,
                                              GraphicsConfiguration gc)