|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.ui.Field
net.rim.device.api.ui.Manager
net.rim.device.api.ui.container.VerticalFieldManager
net.rim.blackberry.api.phone.phonegui.PhoneScreenVerticalManager
public class PhoneScreenVerticalManager
Manager used to organize data vertically on phone screen.
Register a class to the phone listener, then override the callIncoming, callWaiting or callInitiated in the class. e.g. Phone.addPhoneListener(this);
Example 1:
public void callIncoming(int callid)
{
PhoneScreen ps = new PhoneScreen(callid, application);
ps.add(new LabelField(“Hello World”));
ps.add(new LabelField(“Hello World Again”));
ps.sendDataToScreen();
}
Outcome:
Hello World
Hello World Again
Example 2 with use of PhoneScreenVerticalManager and PhoneScreenHorizontalManager:
public void callIncoming(int callid)
{
PhoneScreen ps = new PhoneScreen(callid, application);
PhoneScreenVerticalManager vfm = new PhoneScreenVerticalManager();
LabelField objLabel = new LabelField("V1");
objLabel.setFont(Font.getDefault().derive(Font.BOLD, 50));
vfm.add(objLabel);
LabelField objLabel2 = new LabelField("V2");
vfm.add(objLabel2);
PhoneScreenHorizontalManager hfm = new PhoneScreenHorizontalManager();
hfm.add(new LabelField("H1"));
hfm.add(vfm); //add the veritical field manager.
hfm.add(new LabelField("H2"));
ps.add(hfm); //add the overall data onto the phone screen.
ps.sendDataToScreen();
}
Outcome:
H1 V1 H2
V2
Deregister the class from the phone listener upon closing the application. e.g. Phone.removePhoneListener(this);
| Field Summary |
|---|
| Fields inherited from class net.rim.device.api.ui.Manager |
|---|
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, HORIZONTAL_SCROLL_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK, VERTICAL_SCROLL_MASK |
| Constructor Summary | ||
|---|---|---|
|
PhoneScreenVerticalManager()
Constructor to create a PhoneScreenVerticalManager instance. |
|
| Method Summary | ||
|---|---|---|
|
void |
add(Field field)
Add a field object. |
|
int |
addImage(Bitmap bitmap)
Add a bitmap object to the field. |
|
int |
addImage(EncodedImage image)
Add an encoded image to the field. |
|
void |
delete(Field field)
Delete a field object. |
|
void |
deleteRange(int start,
int count)
Delete a range of field objects. |
|
Field |
getField(int index)
Retrieve the field from an index. |
|
int |
getFieldCount()
Retrieves the number of fields. |
|
void |
insert(Field field,
int index)
Insert a field object at a specified index. |
|
void |
replace(Field oldField,
Field newField)
Replace a field object. |
|
void |
setPadding(int top,
int right,
int bottom,
int left)
Set the padding. |
|
void |
setPadding(XYEdges padding)
Set the padding. |
| Methods inherited from class net.rim.device.api.ui.container.VerticalFieldManager |
|---|
getFieldAtLocation, getPreferredHeight, getPreferredWidth, sublayout, subpaint |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PhoneScreenVerticalManager()
| Method Detail |
|---|
public void setPadding(int top,
int right,
int bottom,
int left)
setPadding in class Fieldtop - Top-most padding coordinate.right - Right-most padding coordinate.bottom - Bottom-most padding coordinate.left - Left-most padding coordinate.public void setPadding(XYEdges padding)
setPadding in class Fieldpadding - Padding coordinates.public int addImage(EncodedImage image)
image - The encoded image to be added.
NullPointerException - if image is null.
RuntimeException - if the number of field exceeds the maximum limit.
and/or the fledge doesn't support the phone screen display feature.public int addImage(Bitmap bitmap)
bitmap - The bitmap object to be added.
NullPointerException - if bitmap is null.
RuntimeException - if the number of field exceeds the maximum limit.
and/or the fledge doesn't support the phone screen display feature.public void add(Field field)
add in class Managerfield - The field object to be added.
NullPointerException - if the field is null.
IllegalArgumentException - if the field already has a manager or it is an instance of Screen.
RuntimeException - if the number of field exceeds the maximum limit.
and/or the fledge doesn't support the phone screen display feature.
public void deleteRange(int start,
int count)
deleteRange in class Managerstart - The start index.count - The number of field objects to be deleted.
RuntimeException - if Manager is empty and/or the fledge doesn't support the phone screen display feature.
IndexOutOfBoundsException - if the start index does not fall into valid range or the range to be deleted exceeds the valid boundary.
IllegalArgumentException - if the the count argument is less than 1.public void delete(Field field)
delete in class Managerfield - The field object to be deleted.
NullPointerException - if the field is null.
IllegalArgumentException - if the field does not have a manager or the field's manager is not the current manager instance.
RuntimeException - if the fledge doesn't support the phone screen display feature.
public void replace(Field oldField,
Field newField)
replace in class ManageroldField - The field object to be replaced.newField - The new field object to be added.
NullPointerException - if the old/newField is null.
IllegalArgumentException - if the new field already has a manager, the old field does not have a manager or the old field's manager is not the current manager instance, or any of the fields are an instance of Screen.
RuntimeException - if the fledge doesn't support the phone screen display feature.Manager.delete(Field),
Manager.insert(Field, int),
Field.getIndex(),
Field.getManager(),
Field.setFocus()
public void insert(Field field,
int index)
insert in class Managerfield - The field object to be inserted.index - The index where the field object is to be inserted.
NullPointerException - if the field is null.
RuntimeException - if the fledge doesn't support the phone screen display feature.
IllegalArgumentException - if the field already has a manager or it is an instance of Screen.
IndexOutOfBoundsException - if index is not in the valid range.public Field getField(int index)
getField in class Managerindex - Index of the field.
public int getFieldCount()
getFieldCount in class Manager
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.