org.zaval.lw
Class LwPaintManImpl
java.lang.Object
|
+--org.zaval.lw.LwPaintManager
|
+--org.zaval.lw.LwPaintManImpl
- All Implemented Interfaces:
- LwManager
- Direct Known Subclasses:
- J2SEPaintManImpl
- public class LwPaintManImpl
- extends LwPaintManager
This class is implementation of the LwPaintManager for the library.
The implementation supports:
- Double buffering.
- Light weight component views painting.
|
Constructor Summary |
LwPaintManImpl()
Constructs the paint manager. |
LwPaintManImpl(boolean isBuffered)
Constructs the paint manager with the specified options. |
|
Method Summary |
void |
dispose()
Disposes the manager. |
protected void |
paintComponent(java.awt.Graphics g,
LwComponent c,
LwComponent parent)
The method is called to paint the specified component. |
protected void |
paintDesktop(java.awt.Graphics g,
LwDesktop d)
The method initiates painting process for the specified root light weight component
using the graphics. |
protected void |
paintOnTop(java.awt.Graphics g,
LwContainer c)
The method is called whenever the specified container and its child components has been
rendered. |
protected void |
updateComponent(java.awt.Graphics g,
LwComponent c,
LwComponent p)
The method is called to update the specified component. |
void |
useDoubleBuffer(boolean b)
Enables or disables double buffering. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_BUFFER_SIZE
protected java.awt.Dimension MAX_BUFFER_SIZE
buffer
protected java.awt.Image buffer
isBuffered
protected boolean isBuffered
LwPaintManImpl
public LwPaintManImpl()
- Constructs the paint manager.
LwPaintManImpl
public LwPaintManImpl(boolean isBuffered)
- Constructs the paint manager with the specified options.
- Parameters:
isBuffered - the flag indicates if the double buffering should be applied.
useDoubleBuffer
public void useDoubleBuffer(boolean b)
- Enables or disables double buffering. The double buffering is used to increase painting
performance but it needs memory.
- Parameters:
b - true to enable double buffering; false
otherwise.
dispose
public void dispose()
- Description copied from interface:
LwManager
- Disposes the manager. The method is supposed to be used for disposing different manager related structures
to free system resources. The method is invoked by LwVCL core when the manager ends its "live".
- Overrides:
dispose in class LwPaintManager
paintDesktop
protected void paintDesktop(java.awt.Graphics g,
LwDesktop d)
- The method initiates painting process for the specified root light weight component
using the graphics. The method has to be used with a light weight root component
implementation to start painting process. The method is overridden to support double
buffering.
- Overrides:
paintDesktop in class LwPaintManager
- Parameters:
g - the specified graphics.d - the specified root lightweight component.
updateComponent
protected void updateComponent(java.awt.Graphics g,
LwComponent c,
LwComponent p)
- The method is called to update the specified component. The updating process
can be occurred with the following two ways:
-
If the component has a view manager and the manager defines a background
view, than the view will be used to fill the component background.
-
If the component has not any view manager or the manager doesn't define a
background view, than the method fills the component with its background
color.
After that the method calls update method of the component.
- Overrides:
updateComponent in class LwPaintManager
- Parameters:
g - the specified graphics.c - the specified lightweight component to be updated.p - the specified parent component that has been rendered before.
paintComponent
protected void paintComponent(java.awt.Graphics g,
LwComponent c,
LwComponent parent)
- The method is called to paint the specified component. The method uses
the border and face views that can be provided with a view manager of
the specified component to paint the component.
- Overrides:
paintComponent in class LwPaintManager
- Parameters:
g - the specified graphics.c - the specified lightweight component to be painted.parent - the specified parent component that has been rendered before.
paintOnTop
protected void paintOnTop(java.awt.Graphics g,
LwContainer c)
- Description copied from class:
LwPaintManager
- The method is called whenever the specified container and its child components has been
rendered. Probably the method will be redesigned.
- Overrides:
paintOnTop in class LwPaintManager
- Following copied from class:
org.zaval.lw.LwPaintManager
- Parameters:
g - the specified graphics.c - the specified lightweight container.
|