org.zaval.lw
Interface LwDesktop
- All Superinterfaces:
- Layoutable, LayoutContainer, LwComponent, LwContainer, Validationable
- All Known Implementing Classes:
- J2SEDesktop
- public interface LwDesktop
- extends LwContainer
This interface is top-level container for all other lightweight components. The main
purpose of the interface to provide abstraction level that binds the library with a
concrete GUI implementation. Every lightweight component is bound with a desktop
container. Use the LwToolkit.getDesktop method to get a desktop for the
specified lightweight component. The desktop consists of layers. Layer is a special
light weight container that is a child component of the desktop. It is impossible
to add a none-layer component to the desktop. Use the getRootLayer method
to get the root layer. The layer should be used if you want to add a light weight
component on the desktop surface. The other available layer is the windows layer. The
layer provides functionality to work with internal frames. The top-level layer is a popup
menu layer.
|
Method Summary |
void |
activate(boolean b)
Invoked whenever the desktop has been activated or de-activated. |
java.awt.Image |
createImage(int w,
int h)
Creates an off-screen image to be used for double buffering with the specified width
and height. |
java.awt.Rectangle |
getDA()
Gets the dirty area of the component. |
java.awt.Graphics |
getGraphics()
Gets a graphics context for this desktop. |
LwLayer |
getLayer(java.lang.Object id)
Gets the layer by the specified id. |
java.lang.Object |
getNCanvas()
Gets the native component where the desktop layer "lives". |
java.lang.Object |
getProperty(int id)
Gets the value for the specified property. |
LwLayer |
getRootLayer()
Gets the root layer that should be used to add a light weight component on the desktop
surface. |
void |
setProperty(int id,
java.lang.Object value)
Sets the value for the specified property. |
| Methods inherited from interface org.zaval.lw.LwComponent |
canHaveFocus, getBackground, getLwComponentAt, getLwParent, getOrigin, getViewMan, getVisiblePart, isEnabled, isOpaque, paint, repaint, repaint, repaint, setBackground, setEnabled, setInsets, setLwParent, setOpaque, setViewMan, setVisible, update |
| Methods inherited from interface org.zaval.lw.Layoutable |
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize |
getNCanvas
public java.lang.Object getNCanvas()
- Gets the native component where the desktop layer "lives". For example, in a case the
J2SE LwVCL version the method returns a java.awt.Panel instance as the native component.
- Returns:
- a native component.
getRootLayer
public LwLayer getRootLayer()
- Gets the root layer that should be used to add a light weight component on the desktop
surface.
- Returns:
- a root layer.
getLayer
public LwLayer getLayer(java.lang.Object id)
- Gets the layer by the specified id. There are two layers available by the "root" and "win" IDs.
- Parameters:
id - the specified id.- Returns:
- a layer.
getGraphics
public java.awt.Graphics getGraphics()
- Gets a graphics context for this desktop. This is adaptive method and it is used to bind
native GUI implementation with the components of the library.
- Returns:
- a graphics context.
createImage
public java.awt.Image createImage(int w,
int h)
- Creates an off-screen image to be used for double buffering with the specified width
and height. This is adaptive method and it is used to bind native GUI implementation with the
components of the library.
- Parameters:
w - the specified image width.h - the specified image height.- Returns:
- an off-screen image.
getProperty
public java.lang.Object getProperty(int id)
- Gets the value for the specified property.
- Parameters:
id - the specified property id.- Returns:
- a value of the property.
setProperty
public void setProperty(int id,
java.lang.Object value)
- Sets the value for the specified property.
- Parameters:
id - the specified property id.value - the specified property value.
getDA
public java.awt.Rectangle getDA()
- Gets the dirty area of the component. The method is used to store and update
the desktop dirty area (this is the area that should be updated).
- Returns:
- a dirty area.
activate
public void activate(boolean b)
- Invoked whenever the desktop has been activated or de-activated.
- Parameters:
b - the flag specifies if the desktop has been activated or de-activated.
The argument value is true if the desktop has been activated.
|