Package ej.mwt.render

Class OverlapRenderPolicy


  • public class OverlapRenderPolicy
    extends DefaultRenderPolicy
    This render policy keeps the initial order of the widgets. That means that when a widget is rendered, the widgets after it in the hierarchy and that have an intersection with it, are also rendered.

    When a widget is asked to be rendered, all the widgets that overlap it in the desktop hierarchy are also rendered. A widget is considered to overlap another one if:

    • their bounds intersect,
    • it is after the other one when browsing the hierarchy following a depth-first algorithm.
    • Constructor Detail

      • OverlapRenderPolicy

        public OverlapRenderPolicy​(Desktop desktop)
        Creates an overlap render policy.
        Parameters:
        desktop - the desktop.
    • Method Detail

      • renderWidget

        protected void renderWidget​(Widget widget,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
        Description copied from class: DefaultRenderPolicy
        This method performs the increment render of the widget. Its implementation only renders the widget and not its siblings, but this behavior may be changed by overriding this method.

        The given bounds are relative to the widget.

        Overrides:
        renderWidget in class DefaultRenderPolicy
        Parameters:
        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.