|
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.cell.Utilities
Useful utilities for use with Cell Renderers and Editors
Field Summary | |
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 |
DEFAULT_CLIP_ARROW_SIZE
Default size of clip arrows used by cell renderers. |
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 | |
Utilities()
|
Method Summary | |
static com.klg.jclass.cell.JCKeyModifier[] |
addKey(com.klg.jclass.cell.JCKeyModifier[] keys,
com.klg.jclass.cell.JCKeyModifier new_key)
|
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 |
drawBorder(Graphics gc,
int type,
int size,
int x,
int y,
int width,
int height,
Color bg,
Color plain)
Draws a border |
static void |
drawBorder(Graphics gc,
int type,
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 |
drawClipArrows(Graphics gc,
com.klg.jclass.cell.JCCellInfo info,
Dimension preferredSize,
int size,
boolean drawOutline)
Draws horizontal and vertical clip arrows if requested to do so by the JCCellInfo object. |
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. |
static Rectangle |
getWholeCell(com.klg.jclass.cell.JCCellInfo info,
Rectangle drawing_area)
Creates a Rectangle to allow drawing over the whole cell instead of being positioned inside the borders and margins. |
static void |
restoreFromInsideBorders(Graphics gc,
com.klg.jclass.cell.JCCellInfo info,
Rectangle drawing_area)
Reverses any changes made by the translateToInsideBorders()
method call. |
static void |
restoreFromWholeCell(Graphics gc,
com.klg.jclass.cell.JCCellInfo info,
Rectangle drawing_area)
Reverses any changes made by the translateToWholeCell()
method call. |
static void |
translateToInsideBorders(Graphics gc,
com.klg.jclass.cell.JCCellInfo info,
Rectangle drawing_area)
Translates the Graphics object to allow drawing inside the borders instead of being positioned inside the borders and margins. |
static void |
translateToWholeCell(Graphics gc,
com.klg.jclass.cell.JCCellInfo info,
Rectangle drawing_area)
Translates the Graphics object to allow drawing over the whole cell instead of being positioned inside the borders and margins. |
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 int DEFAULT_CLIP_ARROW_SIZE
Constructor Detail |
public Utilities()
Method Detail |
public static Rectangle getWholeCell(com.klg.jclass.cell.JCCellInfo info, Rectangle drawing_area)
translateToWholeCell(java.awt.Graphics, com.klg.jclass.cell.JCCellInfo, java.awt.Rectangle)
public static void translateToWholeCell(Graphics gc, com.klg.jclass.cell.JCCellInfo info, Rectangle drawing_area)
restoreFromWholeCell(java.awt.Graphics, com.klg.jclass.cell.JCCellInfo, java.awt.Rectangle)
public static void restoreFromWholeCell(Graphics gc, com.klg.jclass.cell.JCCellInfo info, Rectangle drawing_area)
translateToWholeCell()
method call.
translateToWholeCell(java.awt.Graphics, com.klg.jclass.cell.JCCellInfo, java.awt.Rectangle)
public static void translateToInsideBorders(Graphics gc, com.klg.jclass.cell.JCCellInfo info, Rectangle drawing_area)
drawing_area
- rectangle representing current drawing area.
Will be modified to to the new extended drawing
width and height, but the x and y will not be changed
accordingly.restoreFromInsideBorders(java.awt.Graphics, com.klg.jclass.cell.JCCellInfo, java.awt.Rectangle)
public static void restoreFromInsideBorders(Graphics gc, com.klg.jclass.cell.JCCellInfo info, Rectangle drawing_area)
translateToInsideBorders()
method call.
drawing_area
- rectangle representing current drawing area.
Will be modified to to the new reduced drawing
width and height, but the x and y will not be changed
accordingly.translateToInsideBorders(java.awt.Graphics, com.klg.jclass.cell.JCCellInfo, java.awt.Rectangle)
public static void drawTopLines(Graphics g, int size, int x, int y, int w, int h, Color color)
public static void drawBottomLines(Graphics g, int size, int x, int y, int w, int h, Color color)
public 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)
public static Color darker(Color color)
public static void drawBorder(Graphics gc, int type, int size, int x, int y, int width, int height, Color bg, Color plain)
type
- (see next draw()
definition for full disclosure)size
- the shadow thicknessbg
- the background colorplain
- the color used to draw the sides of PLAIN shadowspublic static void drawBorder(Graphics gc, int type, int size, int x, int y, int width, int height, Color bright, Color dark, Color plain)
type
- 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 thicknessbright
- bright shadow colordark
- dark shadow colorplain
- the color used to draw the sides of PLAIN shadowspublic static void drawClipArrows(Graphics gc, com.klg.jclass.cell.JCCellInfo info, Dimension preferredSize, int size, boolean drawOutline)
gc
- The graphics contextinfo
- The JCCellInfo object for this cellpreferredSize
- The size that determines whether arrows are neededsize
- The number of pixels along a side of the arrowdrawOutline
- Should an outline be drawn, as well as a plygon filledpublic static com.klg.jclass.cell.JCKeyModifier[] addKey(com.klg.jclass.cell.JCKeyModifier[] keys, com.klg.jclass.cell.JCKeyModifier new_key)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |