|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.swing.JCBorder
The class contains static methods to draw shadows around a specified area. The most useful methods contained here are the various draw() methods.
The key difference between this static class and the Swing border classes is the ability to draw borders anywhere, not just around the outside of a component.
Field Summary | |
static String[] |
border_strings
String names of the border styles. |
static int[] |
border_values
Style value that corresponds to the list of String names. |
static int |
CONTROL_IN
Border drawn with MS-Windows style control shadows. |
static int |
CONTROL_OUT
Border drawn with MS-Windows style control shadows. |
static int |
ETCHED_IN
Border drawn with double line; border appears inset. |
static int |
ETCHED_OUT
Border drawn with double line; border appears raised. |
static int |
FRAME_IN
Border drawn with 1-pixel shadow-in at edge; border appears framed. |
static int |
FRAME_OUT
Border drawn with 1-pixel shadow-out at edge; border appears framed. |
static int |
IN
Border drawn appears inset. |
static int |
NONE
No border. |
static int |
NUM_BORDER_STYLES
Number of different border styles. |
static int |
OUT
Border drawn appears raised. |
static int |
PLAIN
Border drawn in foreground color. |
Constructor Summary | |
JCBorder()
|
Method Summary | |
static Color |
brighter(Color color)
Calculates the color even when it is saturated, for example, when it is black or white. |
static Color |
darker(Color color)
Calculates the color even when it is saturated, for example, when it is black or white. |
static void |
draw(Graphics gc,
int style,
int size,
int x,
int y,
int width,
int height,
Color bg,
Color plain)
Draws a border. |
static void |
draw(Graphics gc,
int style,
int size,
int x,
int y,
int width,
int height,
Color bright,
Color dark,
Color plain)
Draws a border. |
static void |
drawBottomLines(Graphics g,
int size,
int x,
int y,
int w,
int h,
Color color)
Draws the bottom and right lines. |
static void |
drawNormal(Graphics g,
int size,
int x,
int y,
int w,
int h,
Color top,
Color bottom)
|
static void |
drawTopLines(Graphics g,
int size,
int x,
int y,
int w,
int h,
Color color)
Draws the top and left lines. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NONE
public static final int ETCHED_IN
public static final int ETCHED_OUT
public static final int IN
public static final int OUT
public static final int PLAIN
public static final int FRAME_IN
public static final int FRAME_OUT
public static final int CONTROL_IN
public static final int CONTROL_OUT
public static final int NUM_BORDER_STYLES
public static final String[] border_strings
public static final int[] border_values
border_strings
Constructor Detail |
public JCBorder()
Method Detail |
public static void drawTopLines(Graphics g, int size, int x, int y, int w, int h, Color color)
g
- The graphics context used to drawsize
- The number of lines to drawx
- The x position to start drawingy
- The y position to start drawingw
- The width of the horizontal linesh
- The height of the vertical linescolor
- The line colorpublic static void drawBottomLines(Graphics g, int size, int x, int y, int w, int h, Color color)
g
- The graphics context used to drawsize
- The number of lines to drawx
- The x position to start drawingy
- The y position to start drawingw
- The width of the horizontal linesh
- The height of the vertical linescolor
- The line colorpublic static void drawNormal(Graphics g, int size, int x, int y, int w, int h, Color top, Color bottom)
public static Color brighter(Color color)
color
- The color to make brighter
public static Color darker(Color color)
color
- The color to make darker
public static void draw(Graphics gc, int style, int size, int x, int y, int width, int height, Color bg, Color plain)
gc
- The graphics context used to drawstyle
- One of the following members:
ETCHED_IN double line; border appears inset
ETCHED_OUT double line; border appears raised
FRAME_IN 1-pixel shadow-in at edge; border appears framed
FRAME_OUT 1-pixel shadow-out at edge; border appears framed
IN border appears inset
OUT border appears raised
CONTROL_IN MS-Windows control shadows
CONTROL_OUT MS-Windows control shadows
PLAIN border drawn in foreground color
NONE no border drawn
size
- the shadow thicknessx
- The x position of the rectangle in which to drawy
- The y position of the rectangle in which to drawwidth
- The width of the rectangle in which to drawheight
- The height of the rectangle in which to drawbg
- The background colorplain
- The color used to draw the sides of PLAIN
shadowspublic static void draw(Graphics gc, int style, int size, int x, int y, int width, int height, Color bright, Color dark, Color plain)
gc
- The graphics context used to drawstyle
- One of the following members:
ETCHED_IN double line; border appears inset
ETCHED_OUT double line; border appears raised
FRAME_IN 1-pixel shadow-in at edge; border appears framed
FRAME_OUT 1-pixel shadow-out at edge; border appears framed
IN border appears inset
OUT border appears raised
CONTROL_IN MS-Windows control shadows
CONTROL_OUT MS-Windows control shadows
PLAIN border drawn in foreground color
NONE no border drawn
size
- the shadow thicknessx
- The x position of the rectangle in which to drawy
- The y position of the rectangle in which to drawwidth
- The width of the rectangle in which to drawheight
- The height of the rectangle in which to drawbright
- Bright shadow colordark
- Dark shadow colorplain
- The color used to draw the sides of PLAIN
shadows
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |