FileDocCategorySizeDatePackage
ItemLFImpl.javaAPI DocphoneME MR2 API (J2ME)36667Wed May 02 18:00:20 BST 2007javax.microedition.lcdui

ItemLFImpl

public abstract class ItemLFImpl extends Object implements ItemLF
Look and feel implementation for Item based on platform widgets. SYNC NOTE: Only functions with prefix 'uCall' handle locking internally. Its the caller's responsibility to hold LCDUILock around calls to the rest of functions.

Fields Summary
static final int
X
Bounds[] array index to x coordinate.
static final int
Y
Bounds[] array index to y coordinate.
static final int
WIDTH
Bounds[] array index to width.
static final int
HEIGHT
Bounds[] array index to height.
static final int
DEFAULT_LABEL_HEIGHT
The default label height for an item.
Item
item
The owner of this view. Set in the constructor.
int
nativeId
The native MidpItem* of this view. Set by owner screen based on the return value of createNativeResource().
int[]
bounds
This is the size granted to this item by the form layout. An array of 4 elements, describing the x, y, width, height of this Item's bounds in the viewport coordinate space. If it is null, it means the Item is currently not in the viewport. This array is set by this.lSetLocation() and this.lSetSize(), and read by FormLFImpl during layout.
boolean
hasFocus
A flag indicating this Item has the input focus. This is maintained by the Item superclass for easy use by subclass code.
boolean
sizeChanged
A flag indicating the size of this Item has changed in a subsequent layout operation. This variable is set and read by FormLFImpl during layout.
boolean
visibleInViewport
A flag indicating the native resource of this Item is currently (at least partially) visible on the Form it is on. This is maintained by the Item superclass for easy use by subclass code.
boolean[]
actualBoundsInvalid
Flags that are set to true when calling invalidate() on this item. If it is known that one of the dimensions remains the same, then the responding invalid flag will stay false. It will turn to false after it gets laid out. This is set by Item class and read by FormLFImpl during layout.
private int
preferredHeight
Cached preferred height when validRequestedSizes is false.
private int
preferredWidth
Cached preferred width when validRequestedSizes is false.
private int
minimumHeight
Cached minimum height when validRequestedSizes is false.
private int
minimumWidth
Cached minimum width when validRequestedSizes is false.
boolean
supportsNativeScrolling
If set to true rely on native scrolling mechanism of this item and give this item all width and height available. (Used for TextBox and List implementation).
boolean
isNewLine
This flag marks if the last layout performed placed this Item at the beginning of a line. This variable is set and read by FormLFImpl during layout.
int
rowHeight
Marks the height of the row this Item is placed on. Note that the Item may be shorter than the height of the row. This variable is set and read by FormLFImpl during layout.
static final int
INVALID_SIZE
A constant used to indicate that Item sizes have to be recalculated.
int
cachedWidth
Width used for last calculations. If that indicates if the preferredHeight, preferredWidth, minimumHeight, minimumWidth are valid, or need a new query.
Constructors Summary
ItemLFImpl(Item item)
Creates look and feel for the passed in Item.

param
item the Item for which the look & feel should be created

        this.item = item;
        actualBoundsInvalid = new boolean[] {true, true, true, true};
        bounds = new int[] {0, 0, 0, 0};
    
Methods Summary
abstract voidcreateNativeResource(int ownerId)
Create native resource of this Item. After this call, Item.nativeId should have had the created native resource id.

param
ownerId native MidpDisplayable* of the owner screen

protected voidcreateTempNativeResource()
Create a temporary native resource of this Item whose id must be deleted before caller function returns.


        int ownerId = (item.owner == null)
			    ? DisplayableLFImpl.INVALID_NATIVE_ID
			    : ((DisplayableLFImpl)item.owner.getLF()).nativeId;

	createNativeResource(ownerId);
    
private native voiddelete0(int nativeId)
Notify native Item to delete its resource.

param
nativeId native resource id (MidpItem *) of this Item

voiddeleteNativeResource()
Delete native resource of this Item. After this call, Item.nativeId should have been reset to DisplayableLFImpl.INVALID_NATIVE_ID.

	if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    delete0(nativeId);
	    nativeId = DisplayableLFImpl.INVALID_NATIVE_ID;
	}
    
booleanequateNLA()
Determine if this Item should have a newline after it.

return
true if it should have a newline after

        return ((item.layout & Item.LAYOUT_NEWLINE_AFTER) ==
                Item.LAYOUT_NEWLINE_AFTER);
    
booleanequateNLB()
Determine if this Item should have a newline before it.

return
true if it should have a newline before

        return ((item.layout & Item.LAYOUT_NEWLINE_BEFORE) ==
                Item.LAYOUT_NEWLINE_BEFORE);
    
DisplaygetCurrentDisplay()
Return the current Display instance that this Item is displayed in.

return
the Display instance this Item is displayed in

        return (item.owner == null) ? 
	    null : item.owner.getLF().lGetCurrentDisplay();
    
intgetLayout()
Get the effective layout type of this Item.

return
layout The translated layout type.

        int l = item.layout;
        if (l == Item.LAYOUT_DEFAULT) {
	    // the spec requires the default vertical layout to be bottom
            return Item.LAYOUT_BOTTOM | Item.LAYOUT_LEFT;
        } else {
            return l;
        }
    
native intgetMinimumHeight0(int nativeId)
Gets minimum height from the native resource corresponding to this Item.

param
nativeId pointer to the native resource
return
minimum height

native intgetMinimumWidth0(int nativeId)
Gets minimum width from the native resource corresponding to this Item.

param
nativeId pointer to the native resource
return
minimum width

native intgetPreferredHeight0(int nativeId, int w)
Gets preferred height from the native resource corresponding to this Item.

param
nativeId pointer to the native resource
param
w the tentative content width in pixels, or -1 if a tentative width has not been computed
return
preferred height that corresponds to the passed in width

native intgetPreferredWidth0(int nativeId, int h)
Gets preferred width from the native resource corresponding to this Item.

param
nativeId pointer to the native resource
param
h the tentative content height in pixels, or -1 if a tentative height has not been computed
return
preferred width that corresponds to the passed in height

private native voidhide0(int nativeId)
Makes native widget that corresponds to this Item invisible and free native resource. After this call, the nativeId is no longer valid.

param
nativeId native resource id of this Item

voidinitNativeResource()
Initialize native resource - size and location.

    if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    if (!actualBoundsInvalid[WIDTH] && !actualBoundsInvalid[HEIGHT]) {
		setSize0(nativeId, bounds[WIDTH], bounds[HEIGHT]);
	    }
	    if (!actualBoundsInvalid[X] && !actualBoundsInvalid[Y]) {
		setLocation0(nativeId, bounds[X], bounds[Y]); 
	    }
	}
    
public final booleanisRequestedSizesValid()
Return whether the cached requested sizes are valid.

return
true if the cached requested sizes are up to date. false if they have been invalidated.

	    return (cachedWidth != INVALID_SIZE);
    
public voidlAddCommand(Command cmd, int i)
Notifies L&F of a command addition in the corresponding Item.

param
cmd the newly added command
param
i the index of the added command in the Item's commands[] array

        if (item.owner != null) {
            ((DisplayableLFImpl)item.owner.getLF()).updateCommandSet();
        }
    
voidlCallHideNotify()
Sets the visibleInViewport flag to be false. Note the native resource is not hidden, nor deleted.

	this.visibleInViewport = false;
    
voidlCallPaint(Graphics g, int w, int h)
Paint the content of this Item. The default implementation does nothing.

param
g the Graphics object to be used for rendering the item
param
w current width of the item in pixels
param
h current height of the item in pixels

voidlCallShowNotify()
Sets the visibleInViewport flag of this Item to be true. Note that this method has no effect on the native resource.

	this.visibleInViewport = true;
    
voidlCallTraverseOut()
Called by the system to indicate traversal has left this Item.

see
#getInteractionModes
see
#traverse
see
#TRAVERSE_HORIZONTAL
see
#TRAVERSE_VERTICAL

        hasFocus = false;
    
public voidlCommitPendingInteraction()
Called to commit any pending user interaction for the item.

 
intlGetAdornedMinimumHeight()
PLACE HOLDER Used by the Form Layout to set the size of this Item

return
the minimum height that includes cell spacing

	return lGetMinimumHeight();
    
intlGetAdornedMinimumWidth()
PLACE HOLDER Used by the Form Layout to set the size of this Item

return
the minimum width that includes cell spacing

	return lGetMinimumWidth();
    
intlGetAdornedPreferredHeight(int width)
PLACE HOLDER Used by the Form Layout to set the size of this Item

param
width the tentative content width in pixels
return
the preferred height

	return lGetPreferredHeight(width);
    
intlGetAdornedPreferredWidth(int height)
PLACE HOLDER Used by the Form Layout to set the size of this Item

param
height the tentative content height in pixels
return
the preferred width

	return lGetPreferredWidth(height);
    
protected intlGetLockedHeight()
Returns the locked height of the Item, or -1 if it's not locked

return
locked height plus adornment height, or -1 if it's not locked


	if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
	    Logging.report(Logging.INFORMATION,
			   LogChannels.LC_HIGHUI_ITEM_LAYOUT,
			   " ItemLFImpl  -  lGetLockedHeight: " + 
			   item.lockedHeight);
	}
	return item.lockedHeight;
    
intlGetLockedWidth()
Returns the locked width of the Item, or -1 if it's not locked

return
locked width plus adornment width, or -1 if it's not locked

	
	if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
	    Logging.report(Logging.INFORMATION,
			   LogChannels.LC_HIGHUI_ITEM_LAYOUT,
			   " ItemLFImpl  -  lGetLockedWidth: " + 
			   item.lockedWidth);
	}
	return item.lockedWidth;
    
public intlGetMinimumHeight()
Get the minimum height of this Item.

return
the minimum height

	lGetRequestedSizes();
	return minimumHeight;
    
public intlGetMinimumWidth()
Get the minimum width of this Item.

return
the minimum width


	lGetRequestedSizes(); // Make sure cached sizes are up to date
	return minimumWidth;
    
public intlGetPreferredHeight(int w)
Get the preferred height of this Item.

param
w tentative locked width. Ignored here and preferred width is used always.
return
the preferred height


	// note: w is not used

	lGetRequestedSizes();
	return preferredHeight;
    
public intlGetPreferredWidth(int h)
Get the preferred width of this Item.

param
h tentative locked height. Ignored here and item.lockedHeight is used always.
return
the preferred width

	
	// note: h is not used!

	lGetRequestedSizes();
	return preferredWidth;
    
voidlGetRequestedSizes()
Calculate minimum and preferred width and height of this item and store the result in instance variables: minimumWidth, minimumHeight, preferredWidth and preferredHeight. This function will query native resources for the sizes. For Items like CustomItem and Spacer, whose sizes are only calculated in Java, this function should be overriden to perform their own calculation.


	if (cachedWidth != INVALID_SIZE) {
	    return;
	}

	// query native for real preferred sizes
	boolean wasNoNative = (nativeId == 
			       DisplayableLFImpl.INVALID_NATIVE_ID);

	// Native resource not yet created, create a temporary one
	if (wasNoNative) {
	    createTempNativeResource();
	}

	minimumWidth = getMinimumWidth0(nativeId);
	// ASSERT (ownerLFImpl.width 
	//         >= minimumWidth >= 0)
	
	minimumHeight = getMinimumHeight0(nativeId);
	// ASSERT (minimumHeight >= 0)
	
	// NOTE: When the item should shrink, the minimum size is used,
	// and the minimum size is calculated with the label
	// on the same line
	if (shouldHShrink() && item.label != null && item.label.length() > 0) {
	    minimumHeight += DEFAULT_LABEL_HEIGHT;
	}
	
	preferredWidth = getPreferredWidth0(nativeId, item.lockedHeight);
	if (preferredWidth < minimumWidth) {
	    preferredWidth = minimumWidth;
	}

	// Since we don't support horizontal scrolling, 
	// we limit the width before using it to query for preferredHeight
        if (item.owner != null) {

	    DisplayableLFImpl ownerLFImpl = 
		(DisplayableLFImpl)item.owner.getLF();

	    // Right now the space available for items is
	    // always limited by the scrollbar space (see first 
	    // FormLFImpl constructor)
	    
	    // The exception of that rule is List and TextBox
	    // implementations that use FormLFImpl 
	    // (notice that in the second constructor the width
	    // is not limited by scrollbar)
	    // But when a native peer cannot support vertical
	    // scrolling and has to be longer than the viewport
	    // FormLFImpl needs to provide its native scrollbar
	    // To make sure that happens we do the following check.
	    // That check must be removed if FormLFImpl supports
	    // dynamic change of the width available for layout.
	    if (ownerLFImpl.width == Display.WIDTH &&
		minimumHeight > Display.HEIGHT) {
	    
		ownerLFImpl.width -= Constants.VERT_SCROLLBAR_WIDTH;
	    }

	    if (preferredWidth > ownerLFImpl.width) {
		preferredWidth = ownerLFImpl.width;
	    }

	} else {
	    if (preferredWidth > 
		Display.WIDTH - Constants.VERT_SCROLLBAR_WIDTH) {
		preferredWidth = 
		    Display.WIDTH - Constants.VERT_SCROLLBAR_WIDTH;
	    }
	}

	preferredHeight = getPreferredHeight0(nativeId,
					      (item.lockedWidth == -1)
					      ? preferredWidth
					      : item.lockedWidth);

	if (preferredHeight < minimumHeight) {
	    preferredHeight = minimumHeight;
	}

	// Delete temporary native resource
	if (wasNoNative) {
	    deleteNativeResource();
	}

	cachedWidth = preferredWidth;
	
	if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
	    Logging.report(Logging.INFORMATION,
			   LogChannels.LC_HIGHUI_ITEM_LAYOUT,
			   " lGetRequestedSizes: " +
			   " mw=" + minimumWidth + " mh=" + minimumHeight +
			   " pw=" + preferredWidth + " ph=" + preferredHeight);
	}
    
voidlHideNativeResource()
Called by the system to hide this Item's native resource.

The default implementation of this method hides native resources corresponding to this Item

	if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    hide0(nativeId);
	}
    
voidlMove(int deltaX, int deltaY)
Moves item's location by delta. Both deltaX and deltaY can be positive and negative.

param
deltaX the amount of pixels by which x item's location has to be moved
param
deltaY the amount of pixels by which y item's location has to be moved


        bounds[X] += deltaX;
        bounds[Y] += deltaY;

	if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    setLocation0(nativeId, bounds[X], bounds[Y]);
	}
    
public voidlRemoveCommand(Command cmd, int i)
Notifies L&F of a command removal in the corresponding Item.

param
cmd the newly removed command
param
i the index of the removed command in the Item's commands[] array

        if (item.owner != null) {
            ((DisplayableLFImpl)item.owner.getLF()).updateCommandSet();
        }
    
voidlRequestInvalidate(boolean width, boolean height)
Request the event scheduler to schedule an invalidate event, that eventually will call uCallInvalidate(this item) of this item's DisplayableLFImpl. If caller also needs to call lSetRequestedSizes, then it must be called AFTER this function, to have effect.

param
width true if it was changed
param
height true if it was changed


        actualBoundsInvalid[WIDTH] = actualBoundsInvalid[WIDTH] || width;
        actualBoundsInvalid[HEIGHT] = actualBoundsInvalid[HEIGHT] || height;

	if (width || height) {
	    cachedWidth = INVALID_SIZE;
	}
	
	// if native resource is not visible we still need 
	// process invalidate to proper set the sizes of this ItemLF
	// and of form container as well
        if (item.owner != null) {
	    ((DisplayableLFImpl)item.owner.getLF()).lRequestInvalidate();
        }
    
voidlRequestPaint()
Called by subclasses to repaint this entire Item's bounds.

        if (bounds != null) {
            lRequestPaint(0, 0, bounds[WIDTH], bounds[HEIGHT]);
        }
    
voidlRequestPaint(int x, int y, int w, int h)
Called by subclasses to repaint a portion of this Item's bounds.

param
x the x coordinate of the origin of the dirty region
param
y the y coordinate of the origin of the dirty region
param
w the width of the dirty region
param
h the height of the dirty region


	if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
	    Logging.report(Logging.INFORMATION, LogChannels.LC_HIGHUI,
			   "repaint "+this+" \t owner ="+item.owner);
	}

        if (item.owner != null) {
            if (w < 0) {
                return;
            } else if (w > bounds[WIDTH]) {
		w = bounds[WIDTH];
            }
            
            if (h < 0) {
                return;
            } else if (h > bounds[HEIGHT]) {
		h = bounds[HEIGHT];
            }
            
            if (x < 0) {
                x = 0;
            } else if (x > bounds[WIDTH]) {
		return;
            }
            
            if (y < 0) {
                y = 0;
            } else if (y > bounds[HEIGHT]) {
                return;
            }
            
            if (item.owner.getLF() instanceof FormLFImpl) {
                ((FormLFImpl)item.owner.getLF()).lRequestPaintItem(item,
								   x, y, w, h);
            } else if (item.owner.getLF() instanceof AlertLFImpl) {
                // ((AlertLFImpl)item.owner.getLF()).repaintItem(item, 
                //                                               x, y, w, h); 
                ((AlertLFImpl)item.owner.getLF()).lRequestPaintContents();
            }
            
        }
    
public voidlSetDefaultCommand(Command cmd, int i)
Notifies L&F of the default command change in the corresponding Item.

param
cmd the newly set default command
param
i index of this new command in the ChoiceGroup's commands array

public voidlSetLabel(java.lang.String label)
Notifies L&F of a label change in the corresponding Item.

param
label the new label string

	if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    setLabel0(nativeId, label);
	}
        lRequestInvalidate(true, true);
    
public voidlSetLayout(int layout)
Notifies L&F of a layout change in the corresponding Item.

param
layout the new layout descriptor

        lRequestInvalidate(true, true);
    
voidlSetLocation(int x, int y)
Sets item's location.

param
x the new x location in form's content coordinate system
param
y the new y location in form's content coordinate system


	bounds[X] = x;
	bounds[Y] = y;

	if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    setLocation0(nativeId, x, y);
	}
    
public voidlSetOwner(Screen oldOwner)
Notify this itemLF that its owner screen has changed. Clear internal state if its new owner is null.

param
oldOwner old owner screen before this change. New owner can be found in Item model.


	// Currently Item has no owner
	if (item.owner == null) {

	    // Hide native resource
	    lHideNativeResource();

	    // Free any native resource
	    deleteNativeResource();

	    // do app notification
	    if (visibleInViewport) {
		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;
	    cachedWidth = INVALID_SIZE;
	    hasFocus = false;
	}
    
public voidlSetPreferredSize(int width, int height)
Notifies L&F of a preferred size change in the corresponding Item.

param
width the value to which the width is locked, or -1 if it is unlocked
param
height the value to which the height is locked, or -1 if it is unlocked

        if (width == bounds[WIDTH] && height == bounds[HEIGHT]) {
            // no need to invalidate
            return;
        }
        lRequestInvalidate(width != bounds[WIDTH],
			   height != bounds[HEIGHT]);
    
final voidlSetRequestedSizes(int mw, int mh, int pw, int ph)
Set minimum and preferred width and height of this item. This function should only be called on a CustomItemLFImpl or SpacerLFImpl. They will collect its own sizing, then call this function to cache them.

param
mw minimum width
param
mh minimum height
param
pw preferred width
param
ph preferred height

	// ASSERT (this instanceof CustomItemLFImpl or SpacerLFImpl)
	minimumWidth = mw;
	minimumHeight = mh;
	preferredWidth = pw;
	preferredHeight = ph;
	cachedWidth= pw;

	if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
	    Logging.report(Logging.INFORMATION,
			   LogChannels.LC_HIGHUI_ITEM_LAYOUT,
			   " lSetRequestedSizes: " +
			   " mw=" + minimumWidth + " mh=" + minimumHeight +
			   " pw=" + preferredWidth + " ph=" + preferredHeight);
	}

    
voidlSetSize(int w, int h)
Sets item's size.

param
w the new width of the item
param
h the new height of the item


	if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
	    Logging.report(Logging.INFORMATION,
			   LogChannels.LC_HIGHUI_ITEM_LAYOUT,
			   " ItemLFImpl  -  lSetSize: " + w + "x" + h);
	}

	if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
	    if (w < minimumWidth) {
		Logging.report(Logging.INFORMATION,
			       LogChannels.LC_HIGHUI_ITEM_LAYOUT,
			       " ******* ItemLFImpl  -  lSetSize: " + w +
			       " < " + minimumWidth);
	    }
	}
        bounds[WIDTH] = w;
        bounds[HEIGHT] = h;

	if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    setSize0(nativeId, w, h);
	}
    
voidlShowNativeResource()
Called by the system to show this Item's native resource.

The default implementation of this method shows the native resource corresponding to this Item

SYNC NOTE:

	if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
	    show0(nativeId);
	}
    
native voidsetLabel0(int nativeId, java.lang.String label)
Notifies native width that new label was set on this Item.

param
nativeId native resource id of this Item
param
label the new label set on this Item

private native voidsetLocation0(int nativeId, int x, int y)
Notifies native widget that Form set location of this Item to be at x, y.

param
nativeId native resource id of this Item
param
x the new x location of the Item
param
y the new y location of the Item

private native voidsetSize0(int nativeId, int w, int h)
Notifies native widget that Form set size of this Item to be at w and h.

param
nativeId native resource id of this Item
param
w the new width of the Item
param
h the new height of the Item

booleanshouldHExpand()
Determine if this Item should horizontally expand.

return
true if it should horizontally expand

        return ((item.layout & Item.LAYOUT_EXPAND) == Item.LAYOUT_EXPAND);
    
booleanshouldHShrink()
Determine if this Item should horizontally shrink.

return
true if it should horizontally shrink

        return ((item.layout & Item.LAYOUT_SHRINK) == Item.LAYOUT_SHRINK);
    
booleanshouldVExpand()
Determine if this Item should vertically expand.

return
true if it should vertically expand

        return ((item.layout & Item.LAYOUT_VEXPAND) == Item.LAYOUT_VEXPAND);
    
booleanshouldVShrink()
Determine if this Item should vertically shrink.

return
true if it should vertically shrink

        return ((item.layout & Item.LAYOUT_VSHRINK) == Item.LAYOUT_VSHRINK);
    
private native voidshow0(int nativeId)
Makes native widget that corresponds to this Item visible on the screen at the location set earlier.

param
nativeId native resource id of this Item

voiduCallHideNotify()
Sets the visibleInViewport flag to be false. Note the native resource is not hidden, nor deleted. This function simply calls lCallShowNotify() after obtaining LCDUILock.

	synchronized (Display.LCDUILock) {
	    lCallHideNotify();
	}
    
voiduCallKeyPressed(int keyCode)
Called by the system to signal a key press.

param
keyCode the key code of the key that has been pressed
see
#getInteractionModes

 
voiduCallKeyReleased(int keyCode)
Called by the system to signal a key release.

param
keyCode the key code of the key that has been released
see
#getInteractionModes

 
voiduCallKeyRepeated(int keyCode)
Called by the system to signal a key repeat.

param
keyCode the key code of the key that has been repeated
see
#getInteractionModes

 
voiduCallPaint(Graphics g, int w, int h)
Paint the content of this Item. This function simply calls lCallPaint() after obtaining LCDUILock.

param
g the Graphics object to be used for rendering the item
param
w current width of the item in pixels
param
h current height of the item in pixels

	synchronized (Display.LCDUILock) {
	    lCallPaint(g, w, h);
	}
    
abstract booleanuCallPeerStateChanged(int hint)
Called by event delivery to notify an ItemLF in current FormLF of a change in its peer state. Subclass should implement this function to sync its state with the peer and choose to return proper value to let Form know whether the itemStateListener should be notified.

param
hint some value that is interpreted only between the peers
return
true if internal state has changed and ItemStateListener should be notified after this function returns.

voiduCallPointerDragged(int x, int y)
Called by the system to signal a pointer drag.

param
x the x coordinate of the pointer drag
param
y the x coordinate of the pointer drag
see
#getInteractionModes

 
voiduCallPointerPressed(int x, int y)
Called by the system to signal a pointer press.

param
x the x coordinate of the pointer down
param
y the y coordinate of the pointer down
see
#getInteractionModes

 
voiduCallPointerReleased(int x, int y)
Called by the system to signal a pointer release.

param
x the x coordinate of the pointer up
param
y the x coordinate of the pointer up
see
#getInteractionModes

voiduCallShowNotify()
Sets the visibleInViewport flag of this Item to be true. Note that this method has no effect on the native resource. This function simply calls lCallShowNotify() after obtaining LCDUILock.

	synchronized (Display.LCDUILock) {
	    lCallShowNotify();
	}
    
voiduCallSizeChanged(int w, int h)
Called by the system to indicate the size available to this Item has changed.

param
w the new width of the item's content area
param
h the new height of the item's content area

        synchronized (Display.LCDUILock) {
            item.lUpdateLockedSize();
        }
 
booleanuCallTraverse(int dir, int viewportWidth, int viewportHeight, int[] visRect_inout)
Called by the system to notify internal traverse into the item. By default, it always returns false and should be overriden for items with enabled internal traversal

param
dir the direction of traversal
param
viewportWidth the width of the container's viewport
param
viewportHeight the height of the container's viewport
param
visRect_inout passes the visible rectangle into the method, and returns the updated traversal rectangle from the method
return
true if focus ius accepted by the item false if traversal should proceed out
see
#getInteractionModes
see
#traverseOut
see
#TRAVERSE_HORIZONTAL
see
#TRAVERSE_VERTICAL

        boolean ret = false;
        synchronized (Display.LCDUILock) {
            if (!hasFocus || dir == CustomItem.NONE) {
                if (ret = item.acceptFocus()) {
                    hasFocus = true;
                }
            } 
        }
        return ret;
    
voiduCallTraverseOut()
Called by the system to indicate traversal has left this Item. This function simply calls lCallTraverseOut after obtaining LCDUILock.

see
#getInteractionModes
see
#traverse
see
#TRAVERSE_HORIZONTAL
see
#TRAVERSE_VERTICAL

        synchronized (Display.LCDUILock) {
            lCallTraverseOut();
        }