|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.lw.LwToolkit
This class provides set of useful static methods for the lightweight library.
Field Summary | |
static int |
ACTION_KEY
|
static java.awt.Color |
BACK_COLOR
The default background color definition. |
static java.awt.Font |
BFONT
The default bold font definition. |
static int |
CANCEL_KEY
|
static java.awt.Color |
darkBlue
The dark blue color definition. |
static java.awt.Color |
FG_COLOR
The default foreground color definition. |
static java.awt.Font |
FONT
The default font definition. |
static java.awt.FontMetrics |
FONT_METRICS
The default font metrics definition. |
static int |
HORIZONTAL
The horizontal alignment constant. |
static int |
NONE
The none vertical and none horizontal alignment constant. |
static int |
PASSFOCUS_KEY
|
static java.awt.Dimension |
PS_SIZE
The default preferred size definition. |
static java.awt.Font |
SFONT
The default small font definition. |
static int |
VERTICAL
The vertical alignment constant. |
Constructor Summary | |
LwToolkit()
|
Method Summary | |
static java.awt.Point |
calcOrigin(int x,
int y,
int w,
int h,
int px,
int py,
LwComponent target)
Calculates and gets origin for the specified area of the component relatively the specified previous origin. |
static java.awt.Point |
calcOrigin(int x,
int y,
int w,
int h,
int px,
int py,
LwComponent target,
java.awt.Insets i)
Calculates and gets origin for the specified area of the component relatively the specified previous origin. |
static java.awt.Point |
calcOrigin(int x,
int y,
int w,
int h,
LwComponent target)
Calculates and gets origin for the specified area of the component. |
static LwDesktop |
createDesktop()
Creates a desktop instance. |
static java.lang.Object |
createObj(java.lang.String className,
java.lang.String argsStr)
|
static void |
drawDotHLine(java.awt.Graphics gr,
int x1,
int x2,
int y1)
Draws the horizontal dotted line between the (x1,y1) and (x2,y1) coordinates. |
static void |
drawDotRect(java.awt.Graphics gr,
int x,
int y,
int w,
int h)
Draws the dotted outline of the specified rectangle using the current color. |
static void |
drawDotVLine(java.awt.Graphics gr,
int y1,
int y2,
int x1)
Draws the vertical dotted line between the (x1,y1) and (x1,y2) coordinates. |
static void |
drawMarker(java.awt.Graphics g,
int x,
int y,
int w,
int h,
java.awt.Color bg,
java.awt.Color fc)
Draws marker for the specified rectangular area, the given background and foreground colors. |
static void |
drawXORLine(LwComponent target,
int x1,
int y1,
int x2,
int y2)
Draws line using XOR mode. |
static void |
drawXORRect(LwComponent target,
int x,
int y,
int w,
int h)
Draws rectangle using XOR mode. |
static void |
fillXORRect(LwComponent target,
int x,
int y,
int w,
int h)
Fills the rectangle using XOR mode. |
static java.awt.Point |
getAbsLocation(int x,
int y,
LwComponent c)
Returns an absolute location for the given relative location of the component. |
static java.awt.Point |
getAbsLocation(LwComponent c)
Returns an absolute location of the component. |
static LwCursorManager |
getCursorManager()
|
static LwDesktop |
getDesktop(LwComponent c)
Gets a desktop container for the specified component. |
static LwComponent |
getDirectChild(LwComponent parent,
LwComponent child)
Returns the immediate child component for the parent and child. |
static int |
getDirectCompAt(int x,
int y,
LwContainer p)
Returns the immediate child component at the specified location of the parent component. |
static LwEventManager |
getEventManager()
|
static LwFocusManager |
getFocusManager()
|
static java.lang.String[] |
getFontList()
Gets the list of available fonts names. |
static java.awt.FontMetrics |
getFontMetrics(java.awt.Font f)
Gets the font metrics for the specified font. |
static java.awt.Graphics |
getGraphics(LwComponent c)
Gets a graphics context for the specified lightweight component. |
static java.awt.Graphics |
getGraphics(LwComponent c,
int x,
int y,
int w,
int h)
Gets a graphics context for the specified area of the lightweight component. |
static java.awt.Image |
getImage(java.lang.String name)
Reads an image by the specified path. |
static int |
getKeyType(int keyCode,
int mask)
Gets the key type for the specified key code and key mask. |
static java.awt.Dimension |
getMaxPreferredSize(LayoutContainer target)
Calculates and gets a maximal preferred size among visible children of the specified container. |
static LwPaintManager |
getPaintManager()
|
static java.util.Properties |
getProperties(java.lang.String name)
Reads a properties file by the specified path and returns it as java.util.Properties instance. |
static java.awt.Point |
getRelLocation(int x,
int y,
LwComponent c)
Returns a relative location for the specified absolute location relatively the light weight component. |
static java.awt.Point |
getRelLocation(int x,
int y,
LwComponent target,
LwComponent c)
Returns a relative location for the specified target location relatively the light weight component. |
static java.lang.String |
getResourcesBase()
|
static java.awt.Dimension |
getScreenSize()
Gets the size of the screen. |
static java.lang.Object |
getStaticObj(java.lang.String key)
Gets the static object by the specified key. |
static LwTooltipMan |
getTooltipManager()
|
static java.lang.String |
getVersion()
Gets the library version. |
static LwView |
getView(java.lang.String key)
Gets a static object by the specified key as LwView class. |
static boolean |
isActionMask(int mask)
Don't touch the method it will be redesigned in the further version. |
static boolean |
isAncestorOf(LwComponent p,
LwComponent c)
Checks if the component is contained in the component hierarchy of this container. |
static void |
loadObjs(java.lang.String key,
java.util.Properties props)
Loads objects by the specified key of the specified properties set into static objects table. |
static void |
startVCL(java.lang.String base)
|
static void |
stopVCL()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HORIZONTAL
public static final int VERTICAL
public static final int NONE
public static final java.awt.Color darkBlue
public static final java.awt.Font FONT
public static final java.awt.Font SFONT
public static final java.awt.Font BFONT
public static final java.awt.FontMetrics FONT_METRICS
public static final java.awt.Color FG_COLOR
public static final java.awt.Color BACK_COLOR
public static final java.awt.Dimension PS_SIZE
public static final int ACTION_KEY
public static final int CANCEL_KEY
public static final int PASSFOCUS_KEY
Constructor Detail |
public LwToolkit()
Method Detail |
public static final LwDesktop createDesktop()
public static java.util.Properties getProperties(java.lang.String name)
name
- the specified path.public static java.awt.Image getImage(java.lang.String name)
name
- the specified path.public static java.awt.FontMetrics getFontMetrics(java.awt.Font f)
f
- the specified font.public static void drawDotHLine(java.awt.Graphics gr, int x1, int x2, int y1)
gr
- the specified context to be used for drawing.x1
- the x coordinate of the start of the line.x2
- the x coordinate of the end of the line.y1
- the y coordinate of the start and end of the line.public static void drawDotVLine(java.awt.Graphics gr, int y1, int y2, int x1)
gr
- the specified context to be used for drawing.y1
- the y coordinate of the start of the line.y2
- the y coordinate of the end of the line.x1
- the x coordinate of the start and end of the line.public static void drawDotRect(java.awt.Graphics gr, int x, int y, int w, int h)
gr
- the specified context to be used for drawing.x
- the x coordinate of the rectangle to be drawn (left top corner).y
- the y coordinate of the rectangle to be drawn (left top corner).w
- the width of the rectangle to be drawn.h
- the height of the rectangle to be drawn.public static final java.awt.Dimension getScreenSize()
public static void drawMarker(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color bg, java.awt.Color fc)
g
- the specified graphics context.x
- the x coordinate of the top-left corner of the rectangular area.y
- the y coordinate of the top-left corner of the rectangular area.w
- the width of the rectangular area.h
- the height of the rectangular area.bg
- the background color.fc
- the foreground color.public static void drawXORLine(LwComponent target, int x1, int y1, int x2, int y2)
target
- the specified component.x1
- the first x coordinate of the line.y1
- the first y coordinate of the line.x2
- the second x coordinate of the line.y2
- the second y coordinate of the line.public static void drawXORRect(LwComponent target, int x, int y, int w, int h)
target
- the specified component.x
- the top-left corner x coordinate of the rectangle.y
- the top-left corner y coordinate of the rectangle.w
- the rectangle width.h
- the rectangle height.public static void fillXORRect(LwComponent target, int x, int y, int w, int h)
target
- the specified component.x
- the top-left corner x coordinate of the rectangle.y
- the top-left corner y coordinate of the rectangle.w
- the rectangle width.h
- the rectangle height.public static boolean isActionMask(int mask)
public static java.lang.String[] getFontList()
public static int getKeyType(int keyCode, int mask)
keyCode
- the specified key code.mask
- the specified key mask.public static java.lang.Object createObj(java.lang.String className, java.lang.String argsStr) throws java.lang.Exception
public static void loadObjs(java.lang.String key, java.util.Properties props) throws java.lang.Exception
key
- the specified key that defines set of objects that should be
loaded.props
- the specified properties.public static java.lang.Object getStaticObj(java.lang.String key)
key
- the specified key.public static LwView getView(java.lang.String key)
key
- the specified key.public static final java.lang.String getVersion()
public static final java.lang.String getResourcesBase()
public static LwDesktop getDesktop(LwComponent c)
c
- the specified component.public static LwComponent getDirectChild(LwComponent parent, LwComponent child)
parent
- the parent component.child
- the child component.public static int getDirectCompAt(int x, int y, LwContainer p)
x
- the x coordinate relatively the parent component.y
- the y coordinate relatively the parent component.p
- the parent component.public static boolean isAncestorOf(LwComponent p, LwComponent c)
p
- the specified parent component.c
- the specified child component.true
if the component is contained in the parent component hierarchy;
otherwise false
.public static java.awt.Point getAbsLocation(int x, int y, LwComponent c)
x
- the x coordinate relatively the component.y
- the y coordinate relatively the component.c
- the lightweight component.public static java.awt.Point getAbsLocation(LwComponent c)
c
- the lightweight component.public static java.awt.Point getRelLocation(int x, int y, LwComponent c)
x
- the x coordinate relatively a native where the component is resided.y
- the y coordinate relatively a native where the component is resided.c
- the lightweight component.public static java.awt.Point getRelLocation(int x, int y, LwComponent target, LwComponent c)
x
- the x coordinate relatively the target component where the component
is resided.y
- the y coordinate relatively the target component where the component
is resided.target
- the target lightweight component.c
- the lightweight component.public static java.awt.Dimension getMaxPreferredSize(LayoutContainer target)
target
- the container.public static java.awt.Point calcOrigin(int x, int y, int w, int h, LwComponent target)
x
- the x coordinate of the component area.y
- the y coordinate of the component area.w
- the width of the component area.h
- the height of the component area.target
- the component.public static java.awt.Point calcOrigin(int x, int y, int w, int h, int px, int py, LwComponent target)
x
- the x coordinate of the component area.y
- the y coordinate of the component area.w
- the width of the component area.h
- the height of the component area.px
- the x coordinate of the previous origin.py
- the y coordinate of the previous origin.target
- the component.public static java.awt.Point calcOrigin(int x, int y, int w, int h, int px, int py, LwComponent target, java.awt.Insets i)
x
- the x coordinate of the component area.y
- the y coordinate of the component area.w
- the width of the component area.h
- the height of the component area.px
- the x coordinate of the previous origin.py
- the y coordinate of the previous origin.target
- the component.i
- the insets.public static java.awt.Graphics getGraphics(LwComponent c)
c
- the lightweight component.public static java.awt.Graphics getGraphics(LwComponent c, int x, int y, int w, int h)
c
- the lightweight component.x
- the x coordinate of the component area.y
- the y coordinate of the component area.w
- the width of the component area.h
- the height of the component area.public static final LwPaintManager getPaintManager()
public static final LwFocusManager getFocusManager()
public static final LwEventManager getEventManager()
public static LwCursorManager getCursorManager()
public static LwTooltipMan getTooltipManager()
public static void startVCL(java.lang.String base)
public static void stopVCL()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |