ScrollablePopupLayerpublic class ScrollablePopupLayer extends PopupLayer implements ScrollListenerA "Popup" layer is a special kind of layer which can
also have commands associated with it. When a popup
layer is added to a MIDPWindow, its commands (if it has any)
can be accessed through the soft button bar. If a popup layer
does have commands associated with it, any commands on the
current displayable/item are no longer accessible. If
the popup layer does not have its own commands, any
existing commands from the displayable/item remain.
NOTE: For now, a PopupLayer is also always visible,
that is isVisible() always returns true. To control the
visibility of a PopupLayer, you add it and remove it
from a MIDPWindow. IMPL_NOTE: determine if a relationship between
PopupLayer and MIDPWindow can allow non visible popup layers. |
Fields Summary |
---|
protected ScrollIndLayer | scrollIndThe scroll indicator layer to notify of scroll settings
in case not all content can fit on the menu. |
Constructors Summary |
---|
public ScrollablePopupLayer()Construct a new PopupLayer. By default, setSupportsInput()
is set to true.
super((Image)null, -1);
| public ScrollablePopupLayer(Image bgImage, int bgColor)Construct a new PopupLayer, given a background image.
By default, setSupportsInput() is set to true, and so
is setVisible().
super(bgImage, bgColor);
| public ScrollablePopupLayer(Image[] bgImage, int bgColor)Construct a new PopupLayer, given a 9 pc background image.
By default, setSupportsInput() is set to true, and so
is setVisible().
super(bgImage, bgColor);
|
Methods Summary |
---|
public void | addDirtyRegion()Add this layer's entire area to be marked for repaint. Any pending
dirty regions will be cleared and the entire layer will be painted
on the next repaint.
TODO: need to be removed as soon as removeLayer algorithm
takes into account layers interaction
super.addDirtyRegion();
if (scrollInd != null) {
scrollInd.addDirtyRegion();
}
| public void | scrollContent(int scrollType, int thumbPosition)Scrolling the contents according to the scrolling parameters.
| public void | setScrollInd(ScrollIndLayer newScrollInd)
if (scrollInd != newScrollInd ||
scrollInd != null && scrollInd.scrollable != this ||
scrollInd != null && scrollInd.listener != this) {
if (scrollInd != null) {
scrollInd.setScrollable(null);
scrollInd.setListener(null);
}
if (owner != null) {
owner.removeLayer(scrollInd);
}
scrollInd = newScrollInd;
if (scrollInd != null) {
scrollInd.setScrollable(this);
scrollInd.setListener(this);
}
}
updateScrollIndicator();
| public void | update(CLayer[] layers)Update bounds of layer
super.update(layers);
if (scrollInd != null) {
scrollInd.update(layers);
if (scrollInd.isVisible()) {
bounds[W] -= scrollInd.bounds[W];
}
}
| public void | updateScrollIndicator()Updates the scroll indicator.
if (scrollInd != null && owner != null) {
if (scrollInd.isVisible()) {
owner.addLayer(scrollInd);
} else {
owner.removeLayer(scrollInd);
}
}
|
|