org.zaval.awt.gdp
Class LibraryAdapter
java.lang.Object
|
+--org.zaval.awt.gdp.LibraryAdapter
- Direct Known Subclasses:
- JLibraryAdapter
- public class LibraryAdapter
- extends java.lang.Object
This class is used with the controllers set of the package as a midleware layer.
The class includes set of methods that is a specific for a GUI library for that the
package is going to be used.
Use getLibraryAdapter
method to get current adapter and
setLibraryAdapter
method to set the adapter. The package provides
following two adapters:
-
LibraryAdapter to be used with Java AWT library. The adapter is set as default.
-
JLibraryAdapter to be used with Java Swing library.
Method Summary |
void |
drawRectOnComponent(java.awt.Component c,
int x,
int y,
int w,
int h,
java.awt.Color col)
Draws the specified rectangle for the component using the given color. |
static LibraryAdapter |
getLibraryAdapter()
Gets the current adapter. |
java.awt.Container |
getRootContainer(java.awt.Component target)
Returns a top-level parent component for the specified child component. |
java.awt.Container |
makeDgnContainer()
Makes and returns the special container component that supposed to be used with
DgnController class as a designer container. |
static void |
setLibraryAdapter(LibraryAdapter a)
Sets the specified adapter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LibraryAdapter
public LibraryAdapter()
setLibraryAdapter
public static void setLibraryAdapter(LibraryAdapter a)
-
Sets the specified adapter.
- Parameters:
a
- the specified adapter.
getLibraryAdapter
public static LibraryAdapter getLibraryAdapter()
-
Gets the current adapter.
- Returns:
- a current adapter.
drawRectOnComponent
public void drawRectOnComponent(java.awt.Component c,
int x,
int y,
int w,
int h,
java.awt.Color col)
-
Draws the specified rectangle for the component using the given color.
This method allows to render rectangle over the specified area and the area can be out of
the component bounds.
- Parameters:
c
- the specified component.x
- the x coordinate of the left-top corner of the rendered rectangle.y
- the y coordinate of the left-top corner of the rendered rectangle.w
- the width of the rendered rectangle.h
- the height of the rendered rectangle.col
- the color of the rendered rectangle.
makeDgnContainer
public java.awt.Container makeDgnContainer()
-
Makes and returns the special container component that supposed to be used with
DgnController class as a designer container.
- Returns:
- a designer container.
getRootContainer
public java.awt.Container getRootContainer(java.awt.Component target)
-
Returns a top-level parent component for the specified child component.
- Parameters:
target
- the specified child component.- Returns:
- a top-level parent container.
Copyright © Zaval Creative Engineering Group, 2000-2005
http://www.zaval.org