glass.eclipse.theme.utils
Class CGraphicUtils

java.lang.Object
  extended by glass.eclipse.theme.utils.CGraphicUtils

public class CGraphicUtils
extends java.lang.Object

CGraphicUtils.java Thomas Hilbert 20.09.2009


Constructor Summary
CGraphicUtils()
           
 
Method Summary
static java.awt.image.BufferedImage addPhotoBorder(java.awt.image.BufferedImage src, int outer, int inner, java.awt.Color colOuter, java.awt.Color colInner)
          Adds a two colored border to the given image.
static java.awt.image.BufferedImage CreateThumb(java.awt.image.BufferedImage img, int thumbSize)
          Creates a thumb of the specified image with the given thumb size.
static java.awt.image.BufferedImage getScaledInstance(java.awt.image.BufferedImage img, int destw, int desth, java.lang.Object hint)
          Gets a scaled instance of the source image.
static java.awt.Shape MergeClipShapes(java.awt.Shape destination, java.awt.Shape currentClip)
          Merges the specified shapes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CGraphicUtils

public CGraphicUtils()
Method Detail

getScaledInstance

public static java.awt.image.BufferedImage getScaledInstance(java.awt.image.BufferedImage img,
                                                             int destw,
                                                             int desth,
                                                             java.lang.Object hint)
Gets a scaled instance of the source image. Uses Graphics2D for scaling.

Parameters:
img -
destw - Target width, -1 if width should be in correct aspect ratio to target height.
desth - Target height, -1 if height should be in correct aspect ratio to target width.
hint - See RenderingHints.VALUE_INTERPOLATION_XXX
Returns:

addPhotoBorder

public static java.awt.image.BufferedImage addPhotoBorder(java.awt.image.BufferedImage src,
                                                          int outer,
                                                          int inner,
                                                          java.awt.Color colOuter,
                                                          java.awt.Color colInner)
Adds a two colored border to the given image.

Parameters:
src -
outer -
inner -
colOuter -
colInner -
Returns:

CreateThumb

public static java.awt.image.BufferedImage CreateThumb(java.awt.image.BufferedImage img,
                                                       int thumbSize)
Creates a thumb of the specified image with the given thumb size.

Parameters:
img -
thumbSize -
Returns:

MergeClipShapes

public static java.awt.Shape MergeClipShapes(java.awt.Shape destination,
                                             java.awt.Shape currentClip)
Merges the specified shapes. In other words, returns the intersection of destination and currentClip

Parameters:
destination -
currentClip -
Returns: