| java.lang.Object com.sun.midp.chameleon.CGraphicsUtil
CGraphicsUtil | public class CGraphicsUtil (Code) | | Chameleon graphics utility class. This class is a collection of
commonly used graphics routines. These routines can be used by
layer implementations as well as widgets themselves.
|
Method Summary | |
public static void | draw1ColorBorder(Graphics g, int x, int y, int w, int h, int borderWidth, int borderColor) Draws a border of borderWidth at location
x, y with dimensions width, height . | public static void | draw2ColorBorder(Graphics g, int x, int y, int w, int h, boolean hasFocus, int darkBorder, int lightBorder, int borderWidth) Draws a border of borderWidth at location
x, y with dimensions width, height . | public static void | draw3pcsBackground(Graphics g, int x, int y, int w, Image[] image) Draws the button background of the size specified (x, y, w). | public static void | draw9pcsBackground(Graphics g, int x, int y, int w, int h, Image[] image) Draws the button background of the size specified (x, y, w, h). | public static void | drawDropShadowBox(Graphics g, int x, int y, int w, int h, int borderColor, int shadowColor, int color) Draws a drop shadow box with a border of border of
borderColor , a drop shadow of
shadowColor , and a filled area of color
at location x, y with dimensions
width, height . | public static void | drawLeft_RightBorder(Graphics g, Image imgLeft, Image imgRight, int start, int end, int x1, int x2) Fill width from start to end
with imgTop at y1 coordinate and
with imgBottom at y2 coordinate. | public static void | drawTop_BottomBorder(Graphics g, Image imgTop, Image imgBottom, int start, int end, int y1, int y2) Fill width from start to end
with imgTop at y1 coordinate and
with imgBottom at y2 coordinate. | public static void | paintBackground(Graphics g, Image bgImage, boolean tileBG, int bgColor, int width, int height) Paints the background according to image or color
requested. |
draw1ColorBorder | public static void draw1ColorBorder(Graphics g, int x, int y, int w, int h, int borderWidth, int borderColor)(Code) | | Draws a border of borderWidth at location
x, y with dimensions width, height .
The border is drawn with one color.
IMPL_NOTE: update params
Parameters: g - The graphics context to be used for rendering button Parameters: x - The x coordinate of the button's background top left corner Parameters: y - The y coordinate of the button's background top left corner Parameters: w - The width of the button's background Parameters: h - The height of the button's background Parameters: borderWidth - The width of the border line. Parameters: borderColor - The color for the border line. |
draw2ColorBorder | public static void draw2ColorBorder(Graphics g, int x, int y, int w, int h, boolean hasFocus, int darkBorder, int lightBorder, int borderWidth)(Code) | | Draws a border of borderWidth at location
x, y with dimensions width, height .
The border is drawn out of two colors.
IMPL_NOTE: update params
Parameters: g - The graphics context to be used for rendering button Parameters: x - The x coordinate of the button's background top left corner Parameters: y - The y coordinate of the button's background top left corner Parameters: w - The width of the button's background Parameters: h - The height of the button's background Parameters: hasFocus - The flag indicating the item has input focus. Parameters: darkBorder - The color of the dark border. Parameters: lightBorder - The color of the light border. Parameters: borderWidth - The wodth of the border line. |
draw3pcsBackground | public static void draw3pcsBackground(Graphics g, int x, int y, int w, Image[] image)(Code) | | Draws the button background of the size specified (x, y, w).
Different background can be drawn when the ImageItem has and
does not have focus.
IMPL_NOTE: update params
Parameters: g - The graphics context to be used for rendering button Parameters: x - The x coordinate of the button's background top left corner Parameters: y - The y coordinate of the button's background top left corner Parameters: w - The width of the button's background Parameters: image - Array of background images to render. |
draw9pcsBackground | public static void draw9pcsBackground(Graphics g, int x, int y, int w, int h, Image[] image)(Code) | | Draws the button background of the size specified (x, y, w, h).
Different background can be drawn when the ImageItem has and
does not have focus.
IMPL_NOTE: update params
Parameters: g - The graphics context to be used for rendering button Parameters: x - The x coordinate of the button's background top left corner Parameters: y - The y coordinate of the button's background top left corner Parameters: w - The width of the button's background Parameters: h - The height of the button's background Parameters: image - Array of background images to render. |
drawDropShadowBox | public static void drawDropShadowBox(Graphics g, int x, int y, int w, int h, int borderColor, int shadowColor, int color)(Code) | | Draws a drop shadow box with a border of border of
borderColor , a drop shadow of
shadowColor , and a filled area of color
at location x, y with dimensions
width, height .
IMPL_NOTE: update params
Parameters: g - The graphics context to be used for rendering button Parameters: x - The x coordinate of the button's background top left corner Parameters: y - The y coordinate of the button's background top left corner Parameters: w - The width of the button's background Parameters: h - The height of the button's background Parameters: borderColor - The border color. Parameters: shadowColor - The shadow color. Parameters: color - The drawing color. |
drawLeft_RightBorder | public static void drawLeft_RightBorder(Graphics g, Image imgLeft, Image imgRight, int start, int end, int x1, int x2)(Code) | | Fill width from start to end
with imgTop at y1 coordinate and
with imgBottom at y2 coordinate.
Parameters: g - The Graphics context to paint to Parameters: imgLeft - The left image. Parameters: imgRight - The right image. Parameters: start - start y co-ordinate of ImageItem Parameters: end - end y co-ordinate of ImageItem Parameters: x1 - x co-ordinate of Left ImageItem Parameters: x2 - x co-ordinate of Right ImageItem |
drawTop_BottomBorder | public static void drawTop_BottomBorder(Graphics g, Image imgTop, Image imgBottom, int start, int end, int y1, int y2)(Code) | | Fill width from start to end
with imgTop at y1 coordinate and
with imgBottom at y2 coordinate.
Parameters: g - The Graphics context to paint to Parameters: imgTop - The top image. Parameters: imgBottom - The bottom image. Parameters: start - start x co-ordinate of ImageItem Parameters: end - end x co-ordinate of ImageItem Parameters: y1 - y co-ordinate of Top ImageItem Parameters: y2 - y co-ordinate of Bottom ImageItem |
paintBackground | public static void paintBackground(Graphics g, Image bgImage, boolean tileBG, int bgColor, int width, int height)(Code) | | Paints the background according to image or color
requested.
Parameters: g - The graphics context to be used for rendering button. Parameters: bgImage - The background image to render or null. Parameters: tileBG - Flag to indicate the background image should betiled. Parameters: bgColor - The background color to paint if bgImage is null. Parameters: width - The width of the background. Parameters: height - The height of the background. |
|
|