org.apache.tapestry.contrib.services.impl
Class RoundedCornerGenerator

java.lang.Object
  extended by org.apache.tapestry.contrib.services.impl.RoundedCornerGenerator

public class RoundedCornerGenerator
extends Object

Class responsible for bulk of java2d manipulation work when used in the RoundedCornerService.


Field Summary
static String BOTTOM
           
static String BOTTOM_LEFT
           
static String BOTTOM_RIGHT
           
static String LEFT
           
static String RIGHT
           
static String TOP
           
static String TOP_LEFT
           
static String TOP_RIGHT
           
 
Constructor Summary
RoundedCornerGenerator()
           
 
Method Summary
 BufferedImage buildCorner(String color, String backgroundColor, int width, int height, String angle, int shadowWidth, float endOpacity)
           
 BufferedImage buildShadow(String color, String backgroundColor, int width, int height, float arcWidth, float arcHeight, int shadowWidth, float endOpacity)
           
 BufferedImage buildSideShadow(String side, int size, float opacity)
           
 Color decodeColor(String color)
          Decodes the specified input color string into a compatible awt color object.
 float getStartAngle(String code)
          Matches the incoming string against one of the constants defined; tl, tr, bl, br.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_LEFT

public static final String TOP_LEFT
See Also:
Constant Field Values

TOP_RIGHT

public static final String TOP_RIGHT
See Also:
Constant Field Values

BOTTOM_LEFT

public static final String BOTTOM_LEFT
See Also:
Constant Field Values

BOTTOM_RIGHT

public static final String BOTTOM_RIGHT
See Also:
Constant Field Values

LEFT

public static final String LEFT
See Also:
Constant Field Values

RIGHT

public static final String RIGHT
See Also:
Constant Field Values

TOP

public static final String TOP
See Also:
Constant Field Values

BOTTOM

public static final String BOTTOM
See Also:
Constant Field Values
Constructor Detail

RoundedCornerGenerator

public RoundedCornerGenerator()
Method Detail

buildCorner

public BufferedImage buildCorner(String color,
                                 String backgroundColor,
                                 int width,
                                 int height,
                                 String angle,
                                 int shadowWidth,
                                 float endOpacity)
                          throws Exception
Throws:
Exception

buildShadow

public BufferedImage buildShadow(String color,
                                 String backgroundColor,
                                 int width,
                                 int height,
                                 float arcWidth,
                                 float arcHeight,
                                 int shadowWidth,
                                 float endOpacity)

buildSideShadow

public BufferedImage buildSideShadow(String side,
                                     int size,
                                     float opacity)
                              throws Exception
Throws:
Exception

getStartAngle

public float getStartAngle(String code)
Matches the incoming string against one of the constants defined; tl, tr, bl, br.

Parameters:
code - The code for the angle of the arc to generate, if no match is found the default is TOP_RIGHT - or 0 degrees.
Returns:
The pre-defined 90 degree angle starting degree point.

decodeColor

public Color decodeColor(String color)
Decodes the specified input color string into a compatible awt color object. Valid inputs are any in the css2 color spec or hex strings.

Parameters:
color - The color to match.
Returns:
The decoded color object, may be black if decoding fails.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.