public abstract class RenderPolicy extends Object
A render policy is associated to a single desktop.
A render policy provides a method to render the desktop on the display. This method is used by the desktop in order to perform the initial rendering of the complete widget hierarchy.
A render policy also provides a method to handle render requests targeting specific widgets of the desktop. The goal of this method is to render only a part of the widget hierarchy considering that an old representation of the desktop is already visible on the display. The most naive implementation would be to render the whole hierarchy of the desktop.
Constructor and Description |
---|
RenderPolicy(Desktop desktop)
Creates a render policy.
|
Modifier and Type | Method and Description |
---|---|
Desktop |
getDesktop()
Returns the desktop managed by this render policy.
|
abstract void |
renderDesktop()
Renders the desktop on the display.
|
abstract void |
requestRender(Widget widget,
int x,
int y,
int width,
int height)
Requests a rendering of the given widget on the display.
|
public RenderPolicy(Desktop desktop)
desktop
- the desktop to render.public Desktop getDesktop()
public abstract void renderDesktop()
This method should be called in the MicroUI thread as the rendering of the widget is performed synchronously.
public abstract void requestRender(Widget widget, int x, int y, int width, int height)
This method returns immediately and the rendering of the widget is performed asynchronously in the MicroUI thread.
The given bounds are relative to the widget.
widget
- the widget to render.x
- the x coordinate of the area to render.y
- the y coordinate of the area to render.width
- the width of the area to render.height
- the height of the area to render.