Class AbsolutePanel

public class AbsolutePanel
extends ComplexPanel

// Superclass of RootPanel
An absolute panel positions all of its children absolutely, allowing them to overlap.

Note that this panel will not automatically resize itself to allow enough room for its absolutely-positioned children. It must be explicitly sized in order to make room for them.

Constructors

AbsolutePanel()Creates an empty absolute panel.

Methods

add(Widget)Adds a child widget to this panel.
add(Widget, int, int)Adds a widget to the panel at the specified position.
getWidgetLeft(Widget)Gets the left position of the specified widget within the panel.
getWidgetTop(Widget)Gets the top position of the specified widget within the panel.
setWidgetPosition(Widget, int, int)Sets the position of the specified child widget.

Constructor Detail

AbsolutePanel

public AbsolutePanel()
Creates an empty absolute panel.

Method Detail

add

public void add(Widget w)
Adds a child widget to this panel.

Parameters

w
the child widget to be added

add

public void add(Widget w, int left, int top)
Adds a widget to the panel at the specified position.

Parameters

w
the widget to be added
left
the widget's left position
top
the widget's top position

getWidgetLeft

public int getWidgetLeft(Widget w)
Gets the left position of the specified widget within the panel.

Parameters

w
the widget whose position is to be retrieved

Return Value

the widget's left position

getWidgetTop

public int getWidgetTop(Widget w)
Gets the top position of the specified widget within the panel.

Parameters

w
the widget whose position is to be retrieved

Return Value

the widget's top position

setWidgetPosition

public void setWidgetPosition(Widget w, int left, int top)
Sets the position of the specified child widget. Setting a position of (-1, -1) will cause the child widget to be positioned statically.

Parameters

w
the child widget to be positioned
left
the widget's left position
top
the widget's top position