Methods Summary |
---|
boolean | equateNLA()Determine if this Item should have a newline after it
return ((item.layout & Item.LAYOUT_NEWLINE_AFTER) ==
Item.LAYOUT_NEWLINE_AFTER);
|
boolean | equateNLB()Determine if this Item should have a newline before it
return ((item.layout & Item.LAYOUT_NEWLINE_BEFORE) ==
Item.LAYOUT_NEWLINE_BEFORE);
|
Display | getCurrentDisplay()Return the current Display instance that this Item is displayed in.
return (item.owner == null) ?
null :
item.owner.getLF().lGetCurrentDisplay();
|
int | getHorizontalPad()Returns the horizontal padding used between label and content
when those are laid out horizontally. Subclasses should override it
if the padding should be other than ScreenSkin.AFTER_LABEL_HORZ_PAD.
return ScreenSkin.PAD_LABEL_HORIZ;
|
protected int | getInnerBounds(int dimension)Used by child classes to get their location and size.
the bounds represent the "outer" bounds of the Item,
i.e. location and size that include the space needed for
painting the border.
The "inner" bounds is the space for the Item to paint into.
(alternatively, it's possible to do setOuterBounds(..) instead
and store in this class both "bounds" for inner bounds, and
"outerBounds" for use from form. It could be more efficient
for painting the item).
// if there should be space left for highlight:
if (dimension == X || dimension == Y) {
return bounds[dimension] + ScreenSkin.PAD_FORM_ITEMS;
} else {
return bounds[dimension] -
ScreenSkin.PAD_FORM_ITEMS -
ScreenSkin.PAD_FORM_ITEMS;
}
|
int | getLayout()Get the effective layout type of this Item
int l = item.layout;
if (l == Item.LAYOUT_DEFAULT) {
return Item.LAYOUT_BOTTOM | Item.LAYOUT_LEFT;
} else {
return l;
}
|
int | getVerticalPad()Returns the vertical padding used between label and content
when those are laid out vertically. Subclasses should override it
if the padding should be other than ScreenSkin.AFTER_LABEL_VERT_PAD
return ScreenSkin.PAD_LABEL_VERT;
|
public final boolean | isRequestedSizesValid()Return whether the cached requested sizes are valid.
return (cachedWidth != INVALID_SIZE);
|
boolean | itemContainsPointer(int x, int y)Returns if the pointer location (x, y, w.r.t. the Form origin)
is within the bounds of the 'clickable' area of this
ItemLFImpl. We exclude non-interactive areas such as the
label.
Most items can use this method. The only case that needs
overriding is the ChoiceGroupPopupLFImpl.
int contentX = bounds[X] + contentBounds[X] + ScreenSkin.PAD_FORM_ITEMS - 2;
int contentY = bounds[Y] + contentBounds[Y] + ScreenSkin.PAD_FORM_ITEMS - 2;
int myX = x - contentX;
int myY = y - contentY;
return (myX >= 0 && myX <= contentBounds[WIDTH] + ScreenSkin.PAD_FORM_ITEMS - 2 &&
myY >= 0 && myY <= contentBounds[HEIGHT] + ScreenSkin.PAD_FORM_ITEMS - 2);
|
public void | lAddCommand(Command cmd, int i)Notifies L&F of a command addition in the corresponding Item.
if (item.owner != null) {
((DisplayableLFImpl)item.owner.getLF()).updateCommandSet();
}
|
void | lCallHideNotify()Called by the system to notify this Item it is being hidden.
The default implementation of this method updates
the 'visible' state
this.visible = false;
|
void | lCallPaint(Graphics g, int w, int h)Paint the content of this Item while LCDUILock is locked.
lDoInternalLayout(labelBounds, contentBounds, w, h);
g.translate(labelBounds[X], labelBounds[Y]);
paintLabel(g, labelBounds[WIDTH]);
g.translate(-labelBounds[X] + contentBounds[X],
-labelBounds[Y] + contentBounds[Y]);
// System.out.println("PRINT lCallPaint lPaintContent= contentBounds[WIDTH] " + contentBounds[WIDTH]);
lPaintContent(g, contentBounds[WIDTH], contentBounds[HEIGHT]);
g.translate(-contentBounds[X], -contentBounds[Y]);
|
void | lCallShowNotify()Called by the system to notify this Item it is being shown
The default implementation of this method updates
the 'visible' state
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_FORM_LAYOUT,
" [I] uCallShowNotify()");
}
this.visible = true;
|
boolean | lCallTraverse(int dir, int viewportWidth, int viewportHeight, int[] visRect_inout)Called by the system
The default implementation of the traverse() method always returns
false.
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_FORM_LAYOUT,
" [I] lCallTraverse()");
}
hasFocus = true;
return false;
|
void | lCallTraverseOut()Called by the system to indicate traversal has left this Item
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_FORM_LAYOUT,
" [I] uCallTraverseOut()");
}
hasFocus = false;
|
public void | lCommitPendingInteraction()Called to commit any pending user interaction for the item
|
void | lDoInternalLayout(int[] labelBounds, int[] contentBounds, int w, int h)Does internal Item layout which includes setting of location
and size of label and content.
if (cachedWidth == INVALID_SIZE || cachedWidth != w) {
if (actualBoundsInvalid[WIDTH] || actualBoundsInvalid[HEIGHT]) {
// Note: It is possible that lDoInternalLayout is called while
// invalidate is being processed. In that case we have to make
// sure that internal layout happens once paint is called after
// invalidate with correct new bounds.
cachedWidth = INVALID_SIZE;
layoutDone = false;
return;
}
lGetLabelSize(labelBounds, w);
lGetContentSize(contentBounds, w);
cachedWidth = w;
}
if (layoutDone) {
return;
}
labelBounds[X] = labelBounds[Y] = 0;
contentBounds[X] = contentBounds[Y] = 0;
int itemWidth, itemHeight;
// empty label
if (labelBounds[HEIGHT] == 0) {
// both label and content are empty
if (contentBounds[HEIGHT] == 0) {
layoutDone = true;
return;
}
itemWidth = contentBounds[WIDTH];
itemHeight = contentBounds[HEIGHT];
// empty content
} else if (contentBounds[HEIGHT] == 0) {
itemWidth = labelBounds[WIDTH];
itemHeight = labelBounds[HEIGHT];
} else { // both labelBounds[HEIGHT] && contentBounds[HEIGHT] != 0
itemWidth = contentBounds[WIDTH];
itemHeight = contentBounds[HEIGHT];
// label and content fit in the width available
if (labelAndContentOnSameLine(labelBounds[HEIGHT]) &&
(labelBounds[WIDTH] + getHorizontalPad() +
contentBounds[WIDTH]) <= w) {
if (contentBounds[HEIGHT] < labelBounds[HEIGHT]) {
contentBounds[Y] =
(labelBounds[HEIGHT] - contentBounds[HEIGHT]) / 2;
itemHeight = labelBounds[HEIGHT];
} else {
labelBounds[Y] =
(contentBounds[HEIGHT] - labelBounds[HEIGHT]) / 2;
itemHeight = contentBounds[HEIGHT];
}
contentBounds[X] =
labelBounds[WIDTH] + getHorizontalPad();
itemWidth = contentBounds[X] + contentBounds[WIDTH];
} else {
// label and content do NOT fit in width available
contentBounds[Y] =
labelBounds[HEIGHT] + getVerticalPad();
itemHeight = contentBounds[Y] + contentBounds[HEIGHT];
if (contentBounds[WIDTH] < labelBounds[WIDTH]) {
switch (item.layout & ImageItem.LAYOUT_CENTER) {
case Item.LAYOUT_CENTER:
contentBounds[X] =
(labelBounds[WIDTH] - contentBounds[WIDTH]) / 2;
break;
case Item.LAYOUT_RIGHT:
contentBounds[X] =
labelBounds[WIDTH] - contentBounds[WIDTH];
break;
default: // Item.LAYOUT_LEFT
break;
}
itemWidth = labelBounds[WIDTH];
} else {
// IMPL_NOTE check with ue what should happen if content is
// wider than label
switch (item.layout & ImageItem.LAYOUT_CENTER) {
case Item.LAYOUT_CENTER:
labelBounds[X] =
(contentBounds[WIDTH] - labelBounds[WIDTH]) / 2;
break;
case Item.LAYOUT_RIGHT:
// we do not right justify the label
// contentBounds[X] =
// contentBounds[WIDTH] - labelBounds[WIDTH];
break;
default: // Item.LAYOUT_LEFT
break;
}
itemWidth = contentBounds[WIDTH];
}
}
}
// find overall ImageItem location inside space provided
int x, y;
switch (item.layout & ImageItem.LAYOUT_CENTER) {
case Item.LAYOUT_CENTER:
x = (w - itemWidth) / 2;
break;
case Item.LAYOUT_RIGHT:
x = w - itemWidth;
break;
default: // Item.LAYOUT_LEFT and Default
x = 0;
}
switch (item.layout & ImageItem.LAYOUT_VCENTER) {
case Item.LAYOUT_VCENTER:
y = (h - itemHeight) / 2;
break;
case Item.LAYOUT_BOTTOM:
y = h - itemHeight;
break;
default: // Item.LAYOUT_TOP and Default
y = 0;
}
if (labelBounds[HEIGHT] > 0) {
labelBounds[X] += x;
labelBounds[Y] += y;
}
if (contentBounds[HEIGHT] > 0) {
contentBounds[X] += x;
contentBounds[Y] += y;
}
layoutDone = true;
|
int | lGetAdornedMinimumHeight()Used by the Form Layout to set the size of this Item
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_FORM_LAYOUT,
" [I] lGetAdornedMinimumHeight() " + this);
}
return lGetMinimumHeight() + 2 * ScreenSkin.PAD_FORM_ITEMS;
|
int | lGetAdornedMinimumWidth()Used by the Form Layout to set the size of this Item
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_FORM_LAYOUT,
" [I] lGetAdornedMinimumWidth() " + this);
}
return lGetMinimumWidth() + 2 * ScreenSkin.PAD_FORM_ITEMS;
|
int | lGetAdornedPreferredHeight(int width)Used by the Form Layout to set the size of this Item
if (width > 2 * ScreenSkin.PAD_FORM_ITEMS) {
width -= 2 * ScreenSkin.PAD_FORM_ITEMS;
} else {
width = -1;
}
return lGetPreferredHeight(width) + 2 * ScreenSkin.PAD_FORM_ITEMS;
|
int | lGetAdornedPreferredWidth(int height)Used by the Form Layout to set the size of this Item
if (height > 2 * ScreenSkin.PAD_FORM_ITEMS) {
height -= 2 * ScreenSkin.PAD_FORM_ITEMS;
} else {
height = -1;
}
return lGetPreferredWidth(height) + 2 * ScreenSkin.PAD_FORM_ITEMS;
|
int | lGetAvailableWidth()Returns the width available for layout by default.
int w = (item.owner != null) ?
((DisplayableLFImpl)item.owner.getLF()).lGetWidth() :
ScreenSkin.WIDTH - 2 * ScreenSkin.PAD_FORM_ITEMS;
return w;
|
void | lGetContentSize(int[] size, int availableWidth)Sets the content size in the passed in array.
Content is calculated based on the availableWidth.
size[WIDTH] and size[HEIGHT] should be set by this method.
Subclasses need to override this method for correct layout.
|
void | lGetLabelSize(int[] size, int availableWidth)Sets the label size in the passed in array.
Content is calculated based on the availableWidth.
size[WIDTH] and size[HEIGHT] should be set by this method.
Subclasses need to override this method for correct layout.
if (item.label == null || item.label.length() == 0) {
size[WIDTH] = size[HEIGHT] = 0;
return;
}
if (availableWidth == -1) {
availableWidth = lGetAvailableWidth();
}
Text.getSizeForWidth(size, availableWidth, item.label,
ScreenSkin.FONT_LABEL, 0);
|
protected int | lGetLockedHeight()Returns the locked height of the Item, or -1 if it's not locked
if (item.lockedHeight == -1) {
return -1;
}
return item.lockedHeight + ScreenSkin.PAD_FORM_ITEMS +
ScreenSkin.PAD_FORM_ITEMS;
|
protected int | lGetLockedWidth()Returns the locked width of the Item, or -1 if it's not locked
if (item.lockedWidth == -1) {
return -1;
}
return item.lockedWidth + ScreenSkin.PAD_FORM_ITEMS +
ScreenSkin.PAD_FORM_ITEMS;
|
public int | lGetMinimumHeight()Get the minimum height of this Item
// minimum height will be reached if we give item the most width
return lGetPreferredHeight(-1);
|
public int | lGetMinimumWidth()Get the minimum width of this Item
// IMPL_NOTE minimum width should be less than preferred
return lGetPreferredWidth(-1);
|
public int | lGetPreferredHeight(int w)Get the preferred height of this Item
if (w == -1) {
w = lGetAvailableWidth();
}
if (cachedWidth == INVALID_SIZE || cachedWidth != w) {
lGetLabelSize(labelBounds, w);
lGetContentSize(contentBounds, w);
cachedWidth = w;
}
// no content
if (contentBounds[HEIGHT] == 0) {
return labelBounds[HEIGHT];
}
// no label
if (labelBounds[HEIGHT] == 0) {
return contentBounds[HEIGHT];
}
if (labelAndContentOnSameLine(labelBounds[HEIGHT]) &&
(labelBounds[WIDTH] + getHorizontalPad() +
contentBounds[WIDTH] <= w)) {
return labelBounds[HEIGHT] < contentBounds[HEIGHT] ?
contentBounds[HEIGHT] : labelBounds[HEIGHT];
}
return labelBounds[HEIGHT] + getVerticalPad() +
contentBounds[HEIGHT];
|
public int | lGetPreferredWidth(int h)Get the preferred width of this Item
int availableWidth = lGetAvailableWidth();
if (cachedWidth == INVALID_SIZE || cachedWidth != availableWidth) {
lGetLabelSize(labelBounds, availableWidth);
lGetContentSize(contentBounds, availableWidth);
cachedWidth = availableWidth;
}
// no content
if (contentBounds[HEIGHT] == 0) {
return labelBounds[WIDTH];
}
// no label
if (labelBounds[HEIGHT] == 0) {
return contentBounds[WIDTH];
}
if (labelAndContentOnSameLine(labelBounds[HEIGHT]) &&
(labelBounds[WIDTH] + getHorizontalPad() +
contentBounds[WIDTH] <= availableWidth)) {
return labelBounds[WIDTH] + getHorizontalPad() +
contentBounds[WIDTH];
}
return (labelBounds[WIDTH] > contentBounds[WIDTH] ?
labelBounds[WIDTH] : contentBounds[WIDTH]);
|
void | lMove(int deltaX, int deltaY)Moves item's location by delta. Both deltaX and deltaY can be
positive and negative.
bounds[X] += deltaX;
bounds[Y] += deltaY;
|
void | lPaintContent(Graphics g, int w, int h)Paints the content area of the Item. This method should be
overridden by the subclasses. Graphics will be translated to
contents origin.
|
public void | lRemoveCommand(Command cmd, int i)Notifies L&F of a command removal in the corresponding Item.
if (item.owner != null) {
((DisplayableLFImpl)item.owner.getLF()).updateCommandSet();
}
|
void | lRequestInvalidate(boolean width, boolean height)Optimized invalidate: the layout manager will do a more efficient
re-layout if only the height was changed.
request the event scheduler to schedule an invalidate event, that
eventually will call uCallInvalidate(this item) of this item's
DisplayableLFImpl
// note: we should also not call invalidate if size has not changed,
// and traversal has not changed.
actualBoundsInvalid[WIDTH] = actualBoundsInvalid[WIDTH] || width;
actualBoundsInvalid[HEIGHT] = actualBoundsInvalid[HEIGHT] || height;
cachedWidth = INVALID_SIZE;
layoutDone = false;
if (item.owner != null) {
((DisplayableLFImpl)item.owner.getLF()).lRequestInvalidate();
}
|
void | lRequestPaint()Called by subclasses to repaint this entire Item's bounds
if (bounds != null) {
// "outer" bounds repaint
lRequestPaint(0, 0, bounds[WIDTH], bounds[HEIGHT]);
}
|
void | lRequestPaint(int x, int y, int w, int h)Called by subclasses to repaint a portion of this Item's bounds
// target[] is recalculated completely, so ne need
// to initialize it beforehand.
if (item.owner != null) {
if (x >= bounds[WIDTH] || y >= bounds[HEIGHT] ||
x + w <= 0 || y + h <= 0 || w <= 0 || h <= 0) {
return;
}
if (x < 0) {
w += x;
target[X] = 0;
} else {
target[X] = x;
}
if (y < 0) {
h += y;
target[Y] = 0;
} else {
target[Y] = y;
}
target[WIDTH] = bounds[WIDTH] - target[X];
if (w < target[WIDTH]) {
target[WIDTH] = w;
}
target[HEIGHT] = bounds[HEIGHT] - target[Y];
if (h < target[HEIGHT]) {
target[HEIGHT] = h;
}
if (item.owner.getLF() instanceof FormLFImpl) {
((FormLFImpl)item.owner.getLF()).lRequestPaintItem(item,
target[X],
target[Y],
target[WIDTH],
target[HEIGHT]);
} else if (item.owner.getLF() instanceof AlertLFImpl) {
// ((AlertLFImpl)item.owner.getLF()).lRequestPaintItem(item,
// x, y, w, h);
// Causes a paint error in Alert
// only a partial painting of the gauge...
((AlertLFImpl)item.owner.getLF()).lRequestPaint();
}
}
|
public void | lSetDefaultCommand(Command cmd, int i)Notifies L&F of the default command change in the corresponding Item.
|
public void | lSetLabel(java.lang.String label)Notifies L&F of a label change in the corresponding Item.
int[] oldBounds = new int[]{labelBounds[X],labelBounds[Y],labelBounds[WIDTH],labelBounds[HEIGHT]};
lGetLabelSize(labelBounds, lGetAvailableWidth());
if (labelBounds[X] == oldBounds[X] && labelBounds[Y] == oldBounds[Y] &&
labelBounds[WIDTH] == oldBounds[WIDTH] && labelBounds[HEIGHT] == oldBounds[HEIGHT]) {
lRequestPaint(labelBounds[X],labelBounds[Y],labelBounds[WIDTH],labelBounds[HEIGHT]);
} else {
lRequestInvalidate(true,true);
}
|
public void | lSetLayout(int layout)Notifies L&F of a layout change in the corresponding Item.
lRequestInvalidate(true, true);
|
void | lSetLocation(int x, int y)Sets item's location.
bounds[X] = x;
bounds[Y] = y;
|
public void | lSetOwner(Screen oldOwner)Notify this itemLF that its owner screen has changed.
Clear internal state if its new owner is null.
if (item.owner == null) {
// Hide it
if (visible) {
// IMPL_NOTE: We are holding LCDUILock and this
// will call into app code on CustomItem.
// Need to schedule an event to do that.
uCallHideNotify();
}
// the deleted item may be added later, so we
// have to invalidate it.
actualBoundsInvalid[X] = true;
actualBoundsInvalid[Y] = true;
actualBoundsInvalid[WIDTH] = true;
actualBoundsInvalid[HEIGHT] = true;
hasFocus = false;
}
|
public void | lSetPreferredSize(int width, int height)Notifies L&F of a preferred size change in the corresponding Item.
// the "preferred size" is in "inner bounds" (contents) terms
if (width == getInnerBounds(WIDTH) &&
height == getInnerBounds(HEIGHT)) {
/* no need to invalidate */
return;
}
lRequestInvalidate(width != getInnerBounds(WIDTH),
height != getInnerBounds(HEIGHT));
|
void | lSetSize(int w, int h)Sets item's size
// System.out.println("set size: w=" + w + " h=" + h);
bounds[WIDTH] = w;
bounds[HEIGHT] = h;
|
boolean | labelAndContentOnSameLine(int labelHeight)Returns true if label and content can be placed on the same line.
If this function returns always false then content will be
always put on a new line in relation to label.
return labelHeight <= ScreenSkin.FONT_LABEL.getHeight();
|
void | paintItem(Graphics g, int[] clip, int trX, int trY)Paint an item - called by Form.
IMPL_NOTE: This function must be called with LCDUILock unlocked.
To be renamed to uPaintItem.
// SYNC NOTE: see uCallPaint()
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_ITEM_PAINT,
" [I] paintItem " + this +
"\t visible=" + visible);
// note: paintItem is called more times than needed.
}
// NOTE: Its possible, that an Item is in an invalid state
// during a requested repaint. Its ok to simply return,
// because it means there is a validation event coming on
// the event thread. When the form re-validates, the Item
// will be given a proper bounds and will be repainted
if (actualBoundsInvalid[X] || actualBoundsInvalid[Y] ||
actualBoundsInvalid[WIDTH] || actualBoundsInvalid[HEIGHT]) {
// I assume the invalid flag is turned to true before
// calling paint.
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_ITEM_PAINT,
" [I] ItemLFImpl: paintItem(..) " +
" BUG: invalid=true");
}
// should have returned here
}
// it cannot be null, since it's initialized in the CTOR, and
// it's never get nullified afterwards:
// if (bounds == null) {
// return;
// }
// "inner" bounds location in screen coordinates
int tX = getInnerBounds(X) + trX;
int tY = getInnerBounds(Y) + trY;
// If we're already beyond the clip, quit looping, as long
// as we're not validating the visibility of Items after a
// scroll (calling show/hideNotify())
if (((tY + getInnerBounds(HEIGHT) < clip[Y]) ||
(tY > (clip[Y] + clip[HEIGHT])))) {
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_ITEM_PAINT,
" [I] ItemLFImpl: paintItem(..) " +
"- cutting the loop");
}
return;
}
// Clip the dirty region to only include the item
// g.clipRect(tX, tY, bounds[WIDTH], bounds[HEIGHT]);
// "inner" bounds
g.clipRect(tX, tY,
getInnerBounds(WIDTH),
getInnerBounds(HEIGHT));
// If the Item is inside the clip, go ahead and paint it
if (g.getClipWidth() > 0 && g.getClipHeight() > 0) {
// Translate into the Item's coordinate space
g.translate(tX, tY);
// need revisit: call showNotify() on the Item first
// We translate the Graphics into the Item's
// coordinate space
uCallPaint(g, getInnerBounds(WIDTH),
getInnerBounds(HEIGHT));
// Its critical to undo any translates
// IMPL_NOTE: If CustomItems are poorly written, they
// will potentially ruin the translate. Harden this code,
// but DO NOT use g.reset() as the translate needs to remain
// for the surrounding layer mechanics.
g.translate(-tX, -tY);
}
// Restore the clip to its original context so
// future clipRect() calls will have the correct intersection
g.setClip(clip[X], clip[Y], clip[WIDTH], clip[HEIGHT]);
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION,
LogChannels.LC_HIGHUI_ITEM_PAINT,
" [I] draw border? hasFocus="+hasFocus);
}
if (drawsTraversalIndicator && hasFocus && (contentBounds[HEIGHT] > 0)) {
g.clipRect(bounds[X] + trX,
bounds[Y] + trY,
bounds[WIDTH],
bounds[HEIGHT]);
paintTraversalIndicator(g, bounds[X] + trX, bounds[Y] + trY);
g.setClip(clip[X], clip[Y], clip[WIDTH], clip[HEIGHT]);
}
|
void | paintLabel(Graphics g, int width)Called by subclasses to paint this Item's label
Text.paint(g, item.label, ScreenSkin.FONT_LABEL,
ScreenSkin.COLOR_FG, 0,
width, labelBounds[HEIGHT], 0, Text.NORMAL, null);
|
void | paintTraversalIndicator(Graphics g, int x, int y)Paint the traversal indicator. The width/height are obtained from
the current traversal item's bounds.
// SYNC NOTE: see uCallPaint()
// ItemLFImpl itemLF = itemLFs[traverseIndex];
// NTS: This may need to special case StringItem?
g.setColor(ScreenSkin.COLOR_TRAVERSE_IND);
g.drawRect(x + contentBounds[X] + ScreenSkin.PAD_FORM_ITEMS - 2,
y + contentBounds[Y] + ScreenSkin.PAD_FORM_ITEMS - 2,
contentBounds[WIDTH] + ScreenSkin.PAD_FORM_ITEMS - 2,
contentBounds[HEIGHT] + ScreenSkin.PAD_FORM_ITEMS - 2);
|
boolean | shouldHExpand()Determine if this Item should horizontally expand
return ((item.layout & Item.LAYOUT_EXPAND) == Item.LAYOUT_EXPAND);
|
boolean | shouldHShrink()Determine if this Item should horizontally shrink
return ((item.layout & Item.LAYOUT_SHRINK) == Item.LAYOUT_SHRINK);
|
boolean | shouldSkipTraverse()Determine if this Item should not be traversed to. By default,
this method will return true only if the owner item has a
default command or a number of item commands associated with it.
return (item.defaultCommand == null && item.numCommands == 0);
|
boolean | shouldVExpand()Determine if this Item should vertically expand
return ((item.layout & Item.LAYOUT_VEXPAND) == Item.LAYOUT_VEXPAND);
|
boolean | shouldVShrink()Determine if this Item should vertically shrink
return ((item.layout & Item.LAYOUT_VSHRINK) == Item.LAYOUT_VSHRINK);
|
void | uCallHideNotify()Called by the system to notify this Item it is being hidden.
This function simply calls lCallHideNotify() after obtaining LCDUILock.
synchronized (Display.LCDUILock) {
lCallHideNotify();
}
|
void | uCallKeyPressed(int keyCode)Called by the system to signal a key press
|
void | uCallKeyReleased(int keyCode)Called by the system to signal a key release
|
void | uCallKeyRepeated(int keyCode)Called by the system to signal a key repeat
|
void | uCallPaint(Graphics g, int w, int h)Paint the content of this Item while LCDUILock is unlocked.
This function simply obtains LCDUILock and calls lCallPaint.
synchronized (Display.LCDUILock) {
lCallPaint(g, w, h);
}
|
void | uCallPointerDragged(int x, int y)Called by the system to signal a pointer drag
|
void | uCallPointerPressed(int x, int y)Called by the system to signal a pointer press
itemWasPressed = true;
|
void | uCallPointerReleased(int x, int y)Called by the system to signal a pointer release
x -= contentBounds[X];
y -= contentBounds[Y];
if ( (x >= 0 && x <= contentBounds[WIDTH] && y >= 0 &&
y <= contentBounds[HEIGHT]) &&
(itemWasPressed && (hasFocus || item.owner.numCommands <= 1))) {
//should check the x,y is in item's content area
uCallKeyPressed(Constants.KEYCODE_SELECT);
}
itemWasPressed = false;
|
public void | uCallScrollChanged(int newViewportX, int newViewportY)Called by the system to indicate the content has been scrolled
inside of the form
// do nothing by default.
|
void | uCallShowNotify()Called by the system to notify this Item it is being shown
This function simply calls lCallShowNotify() after obtaining LCDUILock.
synchronized (Display.LCDUILock) {
lCallShowNotify();
}
|
void | uCallSizeChanged(int w, int h)Called by the system to indicate the size available to this Item
has changed
synchronized (Display.LCDUILock) {
layoutDone = false;
item.lUpdateLockedSize();
}
|
boolean | uCallTraverse(int dir, int viewportWidth, int viewportHeight, int[] visRect_inout)Called by the system
This function simply calls lCallTraverse() after obtaining LCDUILock.
synchronized (Display.LCDUILock) {
return lCallTraverse(dir,
viewportWidth,
viewportHeight,
visRect_inout);
}
|
void | uCallTraverseOut()Called by the system to indicate traversal has left this Item
This function simply calls lCallTraverseOut() after obtaining LCDUILock.
synchronized (Display.LCDUILock) {
lCallTraverseOut();
}
|
void | uRequestPaint()Called by subclasses to repaint this entire Item's bounds
synchronized (Display.LCDUILock) {
lRequestPaint();
}
|