org.apache.tapestry.contrib.services.impl
Class RoundedCornerGenerator
java.lang.Object
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
.
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 |
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
RoundedCornerGenerator
public RoundedCornerGenerator()
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.