de.matthiasmann.twl
Interface Widget.RenderOffscreen

All Known Subinterfaces:
Widget.OffscreenMouseAdjustments
Enclosing class:
Widget

public static interface Widget.RenderOffscreen

When this interface is installed in a Widget then the widget tries to render into an offscreen surface.


Method Summary
 int[] getEffectExtraArea(Widget widget)
          Returns the extra area around the widget needed for the effect.
 boolean needPainting(GUI gui, Widget widget, OffscreenSurface surface)
          Called before offscreen rendering is started.
 void offscreenRenderingFailed(Widget widget)
          Called when OffscreenRenderer#startOffscreenRendering(de.matthiasmann.twl.renderer.OffscreenSurface, int, int, int, int) failed.
 void paintOffscreenSurface(GUI gui, Widget widget, OffscreenSurface surface)
          This method is called after the widget has been sucessfully rendered into an offscreen surface.
 

Method Detail

paintOffscreenSurface

void paintOffscreenSurface(GUI gui,
                           Widget widget,
                           OffscreenSurface surface)
This method is called after the widget has been sucessfully rendered into an offscreen surface.

Parameters:
gui - the GUI instance
widget - the widget
surface - the resulting offscreen surface

offscreenRenderingFailed

void offscreenRenderingFailed(Widget widget)
Called when OffscreenRenderer#startOffscreenRendering(de.matthiasmann.twl.renderer.OffscreenSurface, int, int, int, int) failed. At the moment this method is called the RenderOffscreen instance has already been removed from the widget.

Parameters:
widget - the widget

getEffectExtraArea

int[] getEffectExtraArea(Widget widget)
Returns the extra area around the widget needed for the effect.

All returned values must be >= 0.

The returned object can be reused on the next call and should not be stored by the caller.

Parameters:
widget - the widget
Returns:
the extra area in top, left, right, bottom order or null

needPainting

boolean needPainting(GUI gui,
                     Widget widget,
                     OffscreenSurface surface)
Called before offscreen rendering is started.

NOTE: when this function returns false none of the paint methods of that widget are called which might effect some widgets.

If you are unsure it is always safer to return true.

Parameters:
gui - the GUI instance
widget - the widget
surface - the previous offscreen surface - never null
Returns:
true if the surface needs to be updated, false if no new rendering should be done