|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.win.swing.LySwingUtils
public class LySwingUtils
Utility class for Swing viewers.
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Constructor Summary | |
---|---|
LySwingUtils()
|
Method Summary | |
---|---|
static void |
drawDotLine(java.awt.Graphics g,
int x1,
int y1,
int x2,
int y2)
Draws a dotline in the given graphics context using the given coordinates. |
static void |
drawFocus(java.awt.Graphics g,
int x1,
int y1,
int width,
int height)
Draws a focus rectangle in the given graphics context using the given coordinates. |
static void |
drawTube(java.awt.Graphics g,
int x1,
int y1,
int x2,
int y2,
int width,
java.awt.Color color)
Draws a tube-style line in the given graphics context from the point (x1,y1) to (x2,y2) using the specified color with the specified width. |
static void |
fillBackground(java.awt.Graphics gc,
int width,
int height,
java.awt.Image bgImage)
Draws a background using a texture image. |
static void |
fillShadowRect(java.awt.Graphics gc,
int x,
int y,
int width,
int height)
Draws a filled rectangle with a shadow aspect. |
static java.awt.Color |
getDarkerColor(java.awt.Color color,
int value)
Returns a new color that is value% darker. |
static int |
getFontCharWidth(java.awt.Component comp,
java.awt.Font font)
Returns the average width of a character for a given font. |
static java.awt.Color |
getLighterColor(java.awt.Color color,
int value)
Returns a new color that is value% lighter. |
static int |
getOddNumber(int n)
Returns the odd number directly superior to the specified number. |
static java.awt.Point[] |
getPolygon(int x1,
int y1,
int x2,
int y2,
int width)
Returns the polygon where (x1,y1) and (x2,y2) are centers of two opposite sides of the specified width. |
static void |
snapshot(java.awt.Component comp,
java.lang.String file)
Takes a snapshot of the given component. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LySwingUtils()
Method Detail |
---|
public static java.awt.Color getDarkerColor(java.awt.Color color, int value)
color
- the current colorvalue
- the darkness percentage
public static java.awt.Color getLighterColor(java.awt.Color color, int value)
color
- the current colorvalue
- the lightness percentage
public static void drawTube(java.awt.Graphics g, int x1, int y1, int x2, int y2, int width, java.awt.Color color)
g
- the graphics contextx1
- the x coordinate of the starting pointy1
- the y coordinate of the starting pointx2
- the x coordinate of the ending pointy2
- the y coordinate of the ending pointwidth
- the width of the linecolor
- color of the drawn tubepublic static java.awt.Point[] getPolygon(int x1, int y1, int x2, int y2, int width)
x1
- the x coordinate of the first pointy1
- the y coordinate of the first pointx2
- the x coordinate of the second pointy2
- the y coordinate of the second pointwidth
- the width of the polygon
public static void drawFocus(java.awt.Graphics g, int x1, int y1, int width, int height)
g
- the graphics contextx1
- the x coordinate of the left border of the pointy1
- the y coordinate of the right border of the pointwidth
- the width of the rectangleheight
- the height of the rectanglepublic static void drawDotLine(java.awt.Graphics g, int x1, int y1, int x2, int y2)
g
- the graphics contextx1
- the x coordinate of the starting pointy1
- the y coordinate of the starting pointx2
- the x coordinate of the ending pointy2
- the y coordinate of the ending pointpublic static int getOddNumber(int n)
n
- the number
public static void fillShadowRect(java.awt.Graphics gc, int x, int y, int width, int height)
gc
- the Graphic Contextx
- position on the X axisy
- position on the Y axiswidth
- Widthheight
- Heightpublic static void fillBackground(java.awt.Graphics gc, int width, int height, java.awt.Image bgImage)
gc
- the Graphic Contextwidth
- width of the visible part of the graphicsheight
- height of the visible part of the graphicsbgImage
- the image to be used to draw the backgroundpublic static void snapshot(java.awt.Component comp, java.lang.String file)
comp
- the componentfile
- the destination filepublic static int getFontCharWidth(java.awt.Component comp, java.awt.Font font)
comp
- the component used to compute widthfont
- the font
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |