|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
API
public class API
This class contains constants and functions that available on scripts globally, without any prefix.
| Field Summary | |
|---|---|
static int |
AM
Calendar 12-hour clock: morning |
static int |
AM_PM
Calendar field |
static int |
ANIMATION_LINEAR
Animation, linear interpolation |
static int |
ANIMATION_QUAD
Animation, quad interpolation |
static int |
ANIMATION_SINE
Animation, sine interpolation |
static int |
ANY
Input flags: Any input allowed |
static int |
APRIL
Calendar month of year |
static int |
AUGUST
Calendar month of year |
static int |
BASELINE
Vertical alignment flag |
static int |
BLURRED
Implicit action: Called by the system when focus leaves the widget |
static int |
BOTTOM
Vertical alignment flag |
static int |
BROWSER_FAILED
Phone does not support given url (protocol) or user declined the security prompt. |
static int |
BROWSER_LATER
Phone does not support multi-tasking, browser is opened after WidSets client is closed. |
static int |
BROWSER_OK
Browser was opened successfully. |
static int |
CHANNEL_CLOSED
Status code for channel handling. |
static int |
CHANNEL_INFO_UPDATED
Status code for channel handling. |
static int |
CHANNEL_JOINED
Status code for channel handling. |
static int |
CHANNEL_LEFT
Status code for channel handling. |
static int |
CHANNEL_NOT_FOUND
Status code for channel handling. |
static int |
CHANNEL_OPENED
Status code for channel handling. |
static int |
CHANNEL_PROTOCOL_MISMATCH
Status code for channel handling. |
static int |
DATE
Calendar field |
static int |
DAY_OF_MONTH
Calendar field |
static int |
DAY_OF_WEEK
Calendar field |
static int |
DECEMBER
Calendar month of year |
static int |
DECIMAL
Input flags: Field is number |
static int |
DIMMED
Shell and Popup flag: Indicates that a dimming layer
should be applied on background before painting. |
static int |
EMAILADDR
Input flags: Field is email address |
static int |
FACE_MONOSPACE
Face of Font |
static int |
FACE_PROPORTIONAL
Face of Font |
static int |
FACE_SYSTEM
Face of Font |
static int |
FEBRUARY
Calendar month of year |
static int |
FOCUS_CHANGED
Implicit action: focused Component has changed |
static int |
FOCUSABLE
Component flag: Component is focusable |
static int |
FOCUSED
Implicit action: Called by the system when the focus enters the widget |
static int |
FORMAT_DATE
Calendar Format date as string according to current locale |
static int |
FORMAT_DATETIME
Calendar Format date and time as string according to current locale |
static int |
FORMAT_TIME
Calendar Format time as string according to current locale |
static int |
FRIDAY
Calendar day of week |
static int |
HCENTER
Horizontal alignment flag |
static int |
HEXPAND
Flag that only affects Components that have been placed
on Flow and has preferredWidth = 0. |
static int |
HLIMIT
Flag that only affects Components that have been placed
on Flow and has preferredWidth = 0. |
static int |
HOUR
Calendar field |
static int |
HOUR_OF_DAY
Calendar field |
static int |
INITIAL_CAPS_SENTENCE
Input flags: Suggests that first character of first word of sentence ought to be capitalized |
static int |
INITIAL_CAPS_WORD
Input flags: Suggests that first character of each word ought to be capitalized |
static int |
IS_BINARY
Value type: byte[] |
static int |
IS_BINDING
Value type: key-to-value binding |
static int |
IS_BOOLEAN
Value type: boolean |
static int |
IS_INT
Value type: int |
static int |
IS_LIST
Value type: Value[] |
static int |
IS_NULL
Value type: null |
static int |
IS_STRING
Value type: String |
static int |
ITEM_CANCEL
Implicit action: contents of an NativeInput has not changed |
static int |
ITEM_CHANGED
Implicit action: contents of an Component has changed |
static int |
JANUARY
Calendar month of year |
static int |
JULY
Calendar month of year |
static int |
JUNE
Calendar month of year |
static int |
KEY_BACK
Key code: Back/Cancel soft key |
static int |
KEY_BACKSPACE
Key code: backspace |
static int |
KEY_CR
Key code: carriage return |
static int |
KEY_DELETE
Key code: delete |
static int |
KEY_DOWN
Key code: down arrow |
static int |
KEY_ENTER
Key code: line feed |
static int |
KEY_ESC
Key code: escape |
static int |
KEY_FIRE
Key code: fire |
static int |
KEY_LEFT
Key code: left arrow |
static int |
KEY_OK
Key code: OK soft key |
static int |
KEY_PRESSED
Key action type: key was pressed. |
static int |
KEY_RELEASED
Key action type: key was released. |
static int |
KEY_REPEATED
Key action type: key was repeated. |
static int |
KEY_RIGHT
Key code: right arrow |
static int |
KEY_TAB
Key code: tabulator |
static int |
KEY_UP
Key code: up arrow |
static int |
LEFT
Horizontal alignment flag |
static int |
LINEFEED
Component flag: Component is followed by a linefeed |
static int |
MARCH
Calendar month of year |
static int |
MARK_READ
Explicit action: Called by the system suggesting that all the "items" on widget should be marked read, if applicable |
static int |
MATH_SCALE
Scale of integer math (32768). |
static int |
MAY
Calendar month of year |
static int |
MEMBER_JOINED
Status code for membership handling. |
static int |
MEMBER_LEFT
Status code for membership handling. |
static int |
MEMBER_UPDATED
Status code for membership handling. |
static int |
MILLISECOND
Calendar field |
static int |
MINUTE
Calendar field |
static int |
MONDAY
Calendar day of week |
static int |
MONTH
Calendar field |
static int |
NON_PREDICTIVE
Input flags: Non predictive input mode should be used |
static int |
NOVEMBER
Calendar month of year |
static int |
NUMERIC
Input flags: Numeric input allowed |
static int |
OCTOBER
Calendar month of year |
static int |
ONE_LINE
Input flags: Input field does not expand beyound one line |
static int |
OPAQUE
Shell and Popup flag: Indicates that shell is fully
opaque and therefore the underlying shell need not be painted as a
background. |
static int |
OPEN_HELP
Explicit action: Called by the system suggesting that widget should load and show widget specific help page. |
static int |
OPEN_HOME
Explicit action: Called by the system suggesting that widget should open it's home page |
static int |
OPEN_LINK
Implicit action: user has activated an link |
static int |
OPEN_MENU
Implicit action: menu is to be opened. |
static int |
OPEN_SETTINGS
Explicit action: Called by the system suggesting that widget should open it's settings for editing |
static int |
PASSWORD
Input flags: Blind input (typed text shown as '*') |
static int |
PHONENUMBER
Input flags: Field is phone number |
static int |
PM
Calendar 12-hour clock: evening |
static int |
RIGHT
Horizontal alignment flag |
static int |
SATURDAY
Calendar day of week |
static int |
SECOND
Calendar field |
static int |
SEND_WIDGET
Explicit action: Called by the system suggesting that widget should be sent to other user |
static int |
SENSITIVE
Input flags:
Indicates that the text entered is sensitive data
that the implementation must never store for later use |
static int |
SEPTEMBER
Calendar month of year |
static int |
SHELL_CLOSED
Implicit action: Shell has been popped from shell stack. |
static int |
SHELL_OPENED
Implicit action: Shell has been pushed and computed on shell stack |
static int |
SIZE_LARGE
Size of Font |
static int |
SIZE_MEDIUM
Size of Font |
static int |
SIZE_SMALL
Size of Font |
static int |
SOFTKEY_BACK
Back/Cancel soft key indicator. |
static int |
SOFTKEY_MIDDLE
Middle soft key indicator. |
static int |
SOFTKEY_OK
OK soft key indicator. |
static int |
STYLE_BOLD
Style of Font |
static int |
STYLE_ITALIC
Style of Font |
static int |
STYLE_PLAIN
Style of Font |
static int |
STYLE_UNDERLINED
Style of Font |
static int |
SUNDAY
Calendar day of week |
static int |
THURSDAY
Calendar day of week |
static int |
TOP
Vertical alignment flag |
static int |
TUESDAY
Calendar day of week |
static int |
URL
Input flags: Field is URL |
static int |
VCENTER
Vertical alignment flag |
static int |
VIEWPORT_CHANGED
Implicit action: Viewport of Scrollable has changed. |
static int |
VISIBLE
Component flag: Component is visible |
static int |
WEDNESDAY
Calendar day of week |
static int |
WIDGET_CLOSED
Explicit action: Sent to dashboard indicating that the widget has been closed |
static int |
WRAP
Component flag: Automatic linefeed as necessary |
static int |
YEAR
Calendar field |
| Method Summary | |
|---|---|
int |
abs(int i)
Returns the absolute value of an int value. |
long |
abs(long i)
Returns the absolute value of an long value. |
void |
call(Object state,
String service,
String action,
Value argument)
Calls a server side service. |
void |
call(Object state,
String service,
String action,
Value argument,
SuccessCallback onSuccess,
FailureCallback onFailure)
Calls a server side service. |
void |
call(Object state,
String serviceVersionAction,
Value argument,
SuccessCallback onSuccess,
FailureCallback onFailure)
Calls a server side service anonymously. |
void |
callSerially(Runnable runnable)
Executes specified operation later, by placing it into the user interface event queue. |
int |
cos(int a)
Returns the trigonometric cosine of an angle. |
View |
createMaximizedView(String name,
Object context)
Deprecated. Use createView(String, Object) instead |
View |
createMinimizedView(String name,
Object context)
|
View |
createView(String name,
Object context)
Creates a view according to view specification on widget.xml file of this widget. |
long |
currentTimeMillis()
Returns the current time in milliseconds. |
ByteArray |
decodeHex(String string)
Decodes specified string into ByteArray, assuming it contains hexadecimal notation. |
String |
decodeString(ByteArray array,
String encoding)
Construct a new String by converting the specified array of bytes using the specified character encoding. |
void |
dumpTree(Component c)
Prints component-tree of given component. |
String |
encodeHex(ByteArray array)
Encodes specified array into hexadecimal notation. |
ByteArray |
encodeString(String string,
String encoding)
Converts the specified String into bytes according to the specified character encoding, storing the result into a new byte array. |
String |
encodeURL(String string)
Encodes the specified string using url encoding. |
void |
flushScreen(boolean repaintAll)
Repaints whole UI or selected components. |
String |
format$(String format)
Creates a formatted string according to C-style %conventions. |
List |
getAvailableTimeZones()
Gets all the available IDs supported. |
Config |
getConfig()
Returns widget's config. |
TimeZone |
getDefaultTimeZone()
Gets the default TimeZone for this host. |
int, int |
getDisplaySize()
Returns total size of display, including menu-button area. |
Font |
getFont(int face,
int style,
int size)
Returns the font object according to given parameters. |
Image |
getImage(ByteArray data)
Creates an image from supplied .png encoded data. |
Image |
getImage(Store store,
String name)
Creates an image from .png encoded data stored
under given name at Store. |
Image |
getImage(String name)
Creates an image according the .png stored on
client .jar. |
long, long |
getMemoryUsage()
Returns the current memory usage of system. |
Flow |
getMinimizedView()
Returns the current minimized view of this widget. |
String |
getParameter(String name)
Returns the current value of given parameter. |
Map |
getParameters()
Returns a map containing all parameters for this widget. |
Picture |
getPicture(String url)
Loads image from url specified and displays it as a Picture. |
Picture |
getPicture(String url,
int boundx,
int boundy,
String format)
Loads image from url specified and displays it as a Picture. |
Player |
getPlayer(ByteArray data,
String contentType,
int volume)
Creates Player for playing sound. |
Player |
getPlayer(String sound,
int volume)
Return handle to sound player that can be used to play and stop playing multiple times. |
String |
getProperty(String name)
Returns a system property with given name. |
ByteArray |
getResource(String name)
Returns the named widget resource as ByteArray. |
int, int |
getScreenSize()
Returns size of the current maximized screen, excluding menu-button area. |
Map |
getServices()
Returns a map containing all service specifications for this Widget. |
List |
getShells()
Returns a list containing all shells belonging to this widget. |
Store |
getStore()
Returns the persistent storage for this Widget. |
Style |
getStyle(String name)
Returns the named style from stylesheet of this Widget. |
Style |
getStyle(String primary,
String secondary)
Returns the named style from stylesheet of this Widget. |
TimeZone |
getTimeZone(String id)
Gets the TimeZone for the given ID. |
String |
getUsername()
Returns the username. |
String |
getVersion()
Returns the version of the client taken from the MIDlet-Version parameter of jad file. |
long |
getWidgetID()
Returns the id of widget, returned from dabo/get service call. |
String |
getWidgetName()
Returns the name of widget, returned from dabo/get service call. |
String |
getWidgetName(int id)
Returns the name of widget with given id. |
boolean |
isDashboardVisible()
Checks if the dashboard is currently visible. |
boolean |
isOnline()
Returns the current online state of client. |
boolean |
isRegistered()
Returns if user if registered or not. |
boolean |
isSupported(String feature)
Checks if specified feature is supported by client/platform. |
boolean |
isUsingHTTP()
Returns true, if HTTP protocol is used between client and server, instead of socket connection. |
int |
max(int i,
int j)
Returns the greater of two int values. |
long |
max(long i,
long j)
Returns the greater of two long values. |
int |
min(int i,
int j)
Returns the smaller of two int values. |
long |
min(long i,
long j)
Returns the smaller of two long values. |
int |
morphColor(int sourceColor,
int targetColor,
int progress)
Morphs color from source to target. |
Value |
NULL()
Value: IS_NULL |
int |
openBrowser(String url)
Tries to open phone's web browser to given url. |
void |
openChannel(String id,
ChannelCallback channelCallback)
Joins existing public or private channel. |
void |
openChannel(String name,
String protocol,
Value info,
int timeout,
ChannelCallback channelCallback)
Obtains handle to public channel, creating it if it does not exists already. |
void |
openPrivateChannel(String protocol,
Value info,
int timeout,
ChannelCallback channelCallback)
Creates private, unnamed channel on server. |
Value |
operator_array()
Operator to handle [] expression. |
Value |
operator_bind(Value a,
Value b)
Operator to handle key-to-value binding expression ( key=>value) |
boolean |
operator_cast_boolean(Value v)
Cast from Value to boolean |
ByteArray |
operator_cast_ByteArray(Value v)
Cast from Value to ByteArray |
int |
operator_cast_int(Value v)
Cast from Value to int |
long |
operator_cast_long(Value v)
Cast from Value to long |
String |
operator_cast_String(ByteArray a)
Cast from ByteArray to String |
Value |
operator_cast_Value(boolean z)
Cast from boolean to Value |
Value |
operator_cast_Value(ByteArray a)
Cast from ByteArray to Value |
Value |
operator_cast_Value(int i)
Cast from int to Value |
Value |
operator_cast_Value(List l)
Cast from List to Value |
Value |
operator_cast_Value(long j)
Cast from long to Value |
Value |
operator_cast_Value(String s)
Cast from String to Value |
boolean, Component |
operator_next(Component a,
int var)
foreach support for Component |
boolean, int |
operator_next(IntArray a,
int var)
foreach support for IntArray |
boolean, Object |
operator_next(List a,
int var)
foreach support for List |
boolean, Object |
operator_next(Map a,
int var)
foreach support for Map |
boolean, Value |
operator_next(Value a,
int var)
foreach support for Value |
void |
operator_start(Component a,
int var)
foreach support for Component |
void |
operator_start(IntArray a,
int var)
foreach support for IntArray |
void |
operator_start(List a,
int var)
foreach support for List |
void |
operator_start(Map a,
int var)
foreach support for Map |
void |
operator_start(Value a,
int var)
foreach support for Value |
boolean |
parseBoolean(String str)
Parses the string argument as boolean. |
long |
parseFloat(String str,
int fraction)
Parses the string argument as floating point number. |
int |
parseInt(String str,
int radix)
Parses the string argument as a signed integer in the radix specified by the second argument. |
long |
parseLong(String str,
int radix)
Parses the string argument as a signed long in the radix specified by the second argument. |
int |
parseSize(String expr,
int parentSize)
Parses size expression used on <view> elements at widget XML specification. |
void |
playNotifySound(boolean force)
Plays notify sound assigned to this widget (if any). |
void |
playSound(String sound,
int volume)
Plays the sound once to the end, and releases resources. |
void |
popShell(Shell shell)
Pops a Shell from shell stack. |
void |
printf$(String format)
Prints out formatted string to log. |
void |
pushShell(Shell shell)
Pushes a Shell onto shell stack. |
int |
random(int max)
Returns a pseudo-random number between on zero (inclusive) and max (exclusive) |
Timer |
schedule(long delay)
Spawns a timer that will be executed after delay milliseconds
has passed. |
Timer |
schedule(long delay,
long period)
Schedules a timer for repeated fixed-delay execution, beginning after the specified delay. |
Timer |
schedule(long delay,
long period,
TimerCallback callback)
Schedules a timer for repeated fixed-delay execution, beginning after the specified delay. |
Timer |
schedule(long delay,
TimerCallback callback)
Spawns a timer that will be executed after delay milliseconds
has passed. |
void |
setBubble(Image image,
String message)
Shows short informative message on bubble. |
void |
setMinimizedView(Flow view)
Sets the minimized appearance of this Widget. |
boolean |
setParameter(String name,
Value value)
Sets new value to a widget parameter. |
boolean |
setParameters(Value params)
Sets multiple parameters at the same time. |
void |
setUpdated(boolean isUpdated)
Enables or disables updated state of widget. |
int |
sin(int a)
Returns the trigonometric sine of an angle. |
void |
slideIn(int x,
int y,
int w,
int h,
Shell shell)
Pushes a Shell onto shell stack. |
void |
slideOut(int x,
int y,
int w,
int h,
Shell shell)
Removes a Shell removes shell stack. |
String |
toString(int i,
int radix)
Returns a string representation of the first argument in the radix specified by the second argument. |
String |
toString(long i,
int radix)
Returns a string representation of the first argument in the radix specified by the second argument. |
| Methods inherited from |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int YEAR
Calendar field
public static final int MONTH
Calendar field
public static final int DATE
Calendar field
public static final int DAY_OF_MONTH
Calendar field
public static final int DAY_OF_WEEK
Calendar field
public static final int AM_PM
Calendar field
public static final int HOUR
Calendar field
public static final int HOUR_OF_DAY
Calendar field
public static final int MINUTE
Calendar field
public static final int SECOND
Calendar field
public static final int MILLISECOND
Calendar field
public static final int SUNDAY
Calendar day of week
public static final int MONDAY
Calendar day of week
public static final int TUESDAY
Calendar day of week
public static final int WEDNESDAY
Calendar day of week
public static final int THURSDAY
Calendar day of week
public static final int FRIDAY
Calendar day of week
public static final int SATURDAY
Calendar day of week
public static final int JANUARY
Calendar month of year
public static final int FEBRUARY
Calendar month of year
public static final int MARCH
Calendar month of year
public static final int APRIL
Calendar month of year
public static final int MAY
Calendar month of year
public static final int JUNE
Calendar month of year
public static final int JULY
Calendar month of year
public static final int AUGUST
Calendar month of year
public static final int SEPTEMBER
Calendar month of year
public static final int OCTOBER
Calendar month of year
public static final int NOVEMBER
Calendar month of year
public static final int DECEMBER
Calendar month of year
public static final int AM
Calendar 12-hour clock: morning
public static final int PM
Calendar 12-hour clock: evening
public static final int FORMAT_DATE
Calendar Format date as string according to current locale
public static final int FORMAT_TIME
Calendar Format time as string according to current locale
public static final int FORMAT_DATETIME
Calendar Format date and time as string according to current locale
public static final int IS_NULL
Value type: null
public static final int IS_BOOLEAN
Value type: boolean
public static final int IS_INT
Value type: int
public static final int IS_STRING
Value type: String
public static final int IS_LIST
Value type: Value[]
public static final int IS_BINDING
Value type: key-to-value binding
public static final int IS_BINARY
Value type: byte[]
public static final int MATH_SCALE
int angle = ...;
int x = (100 * cos(angle)) / MATH_SCALE; //-100..100
sin(int),
cos(int),
Constant Field Values
public static final int ANY
Input flags: Any input allowed
public static final int NUMERIC
Input flags: Numeric input allowed
public static final int PASSWORD
Input flags: Blind input (typed text shown as '*')
public static final int ONE_LINE
Input flags: Input field does not expand beyound one line
public static final int EMAILADDR
Input flags: Field is email address
public static final int PHONENUMBER
Input flags: Field is phone number
public static final int URL
Input flags: Field is URL
public static final int DECIMAL
Input flags: Field is number
public static final int SENSITIVE
Input flags:
Indicates that the text entered is sensitive data
that the implementation must never store for later use
public static final int NON_PREDICTIVE
Input flags: Non predictive input mode should be used
public static final int INITIAL_CAPS_WORD
Input flags: Suggests that first character of each word ought to be capitalized
public static final int INITIAL_CAPS_SENTENCE
Input flags: Suggests that first character of first word of sentence ought to be capitalized
public static final int OPEN_MENU
public static final int FOCUS_CHANGED
Component has changed
public static final int ITEM_CHANGED
Component has changed
public static final int ITEM_CANCEL
public static final int OPEN_LINK
public static final int SHELL_OPENED
Shell has been pushed and computed on shell stack
public static final int SHELL_CLOSED
Shell has been popped from shell stack.
public static final int VIEWPORT_CHANGED
Scrollable has changed.
public static final int FOCUSED
public static final int BLURRED
public static final int MARK_READ
public static final int OPEN_SETTINGS
public static final int OPEN_HOME
public static final int OPEN_HELP
public static final int SEND_WIDGET
public static final int WIDGET_CLOSED
public static final int KEY_PRESSED
Script.keyAction(Component, int, int),
Constant Field Valuespublic static final int KEY_RELEASED
Script.keyAction(Component, int, int),
Constant Field Valuespublic static final int KEY_REPEATED
Script.keyAction(Component, int, int),
Constant Field Valuespublic static final int KEY_UP
public static final int KEY_DOWN
public static final int KEY_LEFT
public static final int KEY_RIGHT
public static final int KEY_FIRE
public static final int KEY_ESC
public static final int KEY_ENTER
public static final int KEY_CR
public static final int KEY_DELETE
public static final int KEY_BACKSPACE
public static final int KEY_TAB
public static final int KEY_OK
public static final int KEY_BACK
public static final int SOFTKEY_OK
Script.getSoftKey(Shell, Component, int),
Constant Field Valuespublic static final int SOFTKEY_MIDDLE
Script.getSoftKey(Shell, Component, int),
Constant Field Valuespublic static final int SOFTKEY_BACK
Script.getSoftKey(Shell, Component, int),
Constant Field Valuespublic static final int FOCUSABLE
Component flag: Component is focusable
public static final int VISIBLE
Component flag: Component is visible
public static final int LINEFEED
Component flag: Component is followed by a linefeed
public static final int WRAP
Component flag: Automatic linefeed as necessary
public static final int OPAQUE
Shell and Popup flag: Indicates that shell is fully
opaque and therefore the underlying shell need not be painted as a
background. By default the OPAQUE is enabled for
Shell and disabled for Popup.
public static final int DIMMED
Shell and Popup flag: Indicates that a dimming layer
should be applied on background before painting. This flag is
only meaningful is OPAQUE flag is not set.
public static final int HEXPAND
Components that have been placed
on Flow and has preferredWidth = 0.
HEXPAND instructs the Flow to grant the flagged
component all the remaining space on the current line.
public static final int HLIMIT
Components that have been placed
on Flow and has preferredWidth = 0.
HLIMIT instructs the Flow to limit the granted width of
Component so that it does not grow over the remaining space on
current line.
public static final int BASELINE
public static final int BOTTOM
public static final int HCENTER
public static final int LEFT
public static final int RIGHT
public static final int TOP
public static final int VCENTER
public static final int STYLE_PLAIN
Font
public static final int STYLE_BOLD
Font
public static final int STYLE_ITALIC
Font
public static final int STYLE_UNDERLINED
Font
public static final int SIZE_SMALL
Font
public static final int SIZE_MEDIUM
Font
public static final int SIZE_LARGE
Font
public static final int FACE_SYSTEM
Font
public static final int FACE_MONOSPACE
Font
public static final int FACE_PROPORTIONAL
Font
public static final int CHANNEL_OPENED
ChannelCallback,
Constant Field Valuespublic static final int CHANNEL_JOINED
ChannelCallback,
Constant Field Valuespublic static final int CHANNEL_LEFT
ChannelCallback,
Constant Field Valuespublic static final int CHANNEL_CLOSED
ChannelCallback,
Constant Field Valuespublic static final int CHANNEL_NOT_FOUND
ChannelCallback,
Constant Field Valuespublic static final int CHANNEL_PROTOCOL_MISMATCH
ChannelCallback,
Constant Field Valuespublic static final int CHANNEL_INFO_UPDATED
ChannelCallback,
Constant Field Valuespublic static final int MEMBER_JOINED
MemberCallback,
Constant Field Valuespublic static final int MEMBER_LEFT
MemberCallback,
Constant Field Valuespublic static final int MEMBER_UPDATED
MemberCallback,
Constant Field Valuespublic static final int ANIMATION_LINEAR
Animation, linear interpolation
public static final int ANIMATION_QUAD
Animation, quad interpolation
public static final int ANIMATION_SINE
Animation, sine interpolation
public static final int BROWSER_OK
openBrowser(String),
Constant Field Valuespublic static final int BROWSER_LATER
openBrowser(String),
Constant Field Valuespublic static final int BROWSER_FAILED
openBrowser(String),
Constant Field Values| Method Detail |
|---|
public Value NULL()
Value: IS_NULL
public String toString(int i,
int radix)
i - a intto be converted to a string.radix - the radix to use in the string representation.
public String toString(long i,
int radix)
i - a longto be converted to a string.radix - the radix to use in the string representation.
public int parseInt(String str,
int radix)
'-'
indicate a negative value. The resulting integer value is returned.
str - the String containing the integer
representation to be parsedradix - the radix to be used while parsing s.
public long parseLong(String str,
int radix)
'-'
indicate a negative value. The resulting integer value is returned.
str - the String containing the integer
representation to be parsedradix - the radix to be used while parsing s.
public boolean parseBoolean(String str)
"true" returned value will be true, in all other
cases it will be false.
str - the to be parsed
public long parseFloat(String str,
int fraction)
[+-]?[0-9]*([.][0-9]*)?([eE][-+]?[0-9]+)?Examples:
parseFloat("1", 4) = 1000
parseFloat("1.234", 4) = 1234
parseFloat("1.234", 4) = 1234
parseFloat("1.234e2", 4) = 12340000
str - Textual presentation of floating point numberfraction - Number of significant numbers in fraction.
fraction lower digits.
public void operator_start(IntArray a,
int var)
foreach support for IntArray
public boolean, int operator_next(IntArray a,
int var)
foreach support for IntArray
public void operator_start(Value a,
int var)
foreach support for Value
public boolean, Value operator_next(Value a,
int var)
foreach support for Value
public void operator_start(List a,
int var)
foreach support for List
public boolean, Object operator_next(List a,
int var)
foreach support for List
public void operator_start(Map a,
int var)
foreach support for Map
public boolean, Object operator_next(Map a,
int var)
foreach support for Map
public Value operator_array()
[] expression.
public Value operator_bind(Value a,
Value b)
key=>value)
public Value operator_cast_Value(boolean z)
boolean to Value
public Value operator_cast_Value(int i)
int to Value
public Value operator_cast_Value(long j)
long to Value
public Value operator_cast_Value(String s)
String to Value
public Value operator_cast_Value(List l)
List to Value
public Value operator_cast_Value(ByteArray a)
ByteArray to Value
public String operator_cast_String(ByteArray a)
ByteArray to String
public boolean operator_cast_boolean(Value v)
Value to boolean
public int operator_cast_int(Value v)
Value to int
public long operator_cast_long(Value v)
Value to long
public ByteArray operator_cast_ByteArray(Value v)
Value to ByteArray
public int abs(int i)
int value.
public long abs(long i)
long value.
public int min(int i,
int j)
int values.
public int max(int i,
int j)
int values.
public long min(long i,
long j)
long values.
public long max(long i,
long j)
long values.
public int sin(int a)
short value.
Dividing with constant MATH_SCALE normalizes it to
[-1..1] range.
a - an angle, in degrees.
MATH_SCALEpublic int cos(int a)
short value.
Dividing with constant MATH_SCALE normalizes it to
[-1..1] range.
a - an angle, in degrees.
MATH_SCALEpublic String format$(String format)
[%]([0-9]+[:$])[+]?[-]?[0_ ]?[0-9]*[box]?[zcidjls]
$ or : Preceding number is treated as argument index (starts from 1)
+ Show sign of integer
- Left justify
' ' Use space padding
_ Use underscore padding
0 Use zero padding (if before other numbers)
0-9 Width of field
z boolean argument ("true" or "false")
b format integer as binary (radix=2)
o format integer as octal (radix=8)
x format integer as hexadecimal (radix=16)
c char argument
i,d integer argument
j,l long argument
s object argument
format - Format stringprintf$(String)public void printf$(String format)
format - Format stringformat$(String)public long currentTimeMillis()
public int random(int max)
max (exclusive)
max - Upper limit of random (exclusive)public Timer schedule(long delay)
delay milliseconds
has passed.
When executed the system calls void timerEvent(Timer timer)
function on widget script.
delay - delay in milliseconds before task is to be executed.Timer,
Timer.cancel()
public Timer schedule(long delay,
long period)
When executed the system calls void timerEvent(Timer timer)
function on widget script.
delay - delay in milliseconds before task is to be executed.period - time in milliseconds between successive task executions.Timer,
Timer.cancel()
public Timer schedule(long delay,
TimerCallback callback)
delay milliseconds
has passed.
When executed the system calls the supplied callback function.
delay - delay in milliseconds before task is to be executed.callback - Callback functionTimer,
Timer.cancel()
public Timer schedule(long delay,
long period,
TimerCallback callback)
When executed the system calls the supplied callback function.
delay - delay in milliseconds before task is to be executed.period - time in milliseconds between successive task executions.callback - Callback functionTimer,
Timer.cancel()public String getProperty(String name)
java.lang.System.getProperty()
and javax.microedition.midlet.MIDLet.getProperty().
param name Name of property
public List getShells()
Shells.public void pushShell(Shell shell)
Shell onto shell stack. Following
actions occur:
SHELL_OPENED event is fired
shell - Shell to showScript.actionPerformed(Shell, Component, int)public void popShell(Shell shell)
Shell from shell stack. Following
actions occur:
SHELL_CLOSED event is fired
shell - Shell to removeScript.actionPerformed(Shell, Component, int)
public void slideIn(int x,
int y,
int w,
int h,
Shell shell)
Shell onto shell stack.
Shell appears in animated fashion so that it seems to
"grow" from given region on screen
(region does not need to be actually visible).
Follow example demonstrates how to "fly-in" the new shell from right:
Shell shell = ...; int w, int h = getScreenSize(); slideIn(w, 0, w, h, shell);
x - X-coordinate of origin regiony - Y-coordinate of origin regionw - width of origin regionh - height of origin regionshell - Shell to showpushShell(Shell)
public void slideOut(int x,
int y,
int w,
int h,
Shell shell)
Shell removes shell stack.
Shell disappears in animated fashion so that it seems to
"shrink" into given region on screen
(region does not need to be actually visible).
x - X-coordinate of origin regiony - Y-coordinate of origin regionw - width of origin regionh - height of origin regionshell - Shell to removepopShell(Shell)public void flushScreen(boolean repaintAll)
Component.repaint(boolean) method.
Repainting does not occur during the call
of this function, instead it instructs the system
to repaint the screen as soon as possible.
repaintAll - if true whole UI is repainted,
otherwise only those components selected for repaintpublic void dumpTree(Component c)
c - Component to debug
public void setBubble(Image image,
String message)
image - Optional image to show along with messagemessage - Message to show
public void operator_start(Component a,
int var)
foreach support for Component
public boolean, Component operator_next(Component a,
int var)
foreach support for Component
public String getWidgetName()
public long getWidgetID()
public Image getImage(String name)
.png stored on
client .jar.
This method always returns an (informative) image even if
loading fails for some reason.
name - Name of image to load
public Image getImage(ByteArray data)
.png encoded data.
This method always returns an (informative) image even if
loading fails for some reason.
data - .png encoded data
public Image getImage(Store store,
String name)
.png encoded data stored
under given name at Store.
This method always returns an (informative) image even if
loading fails for some reason.
store - Store to usename - Name of record at Store
public Font getFont(int face,
int style,
int size)
face - Face of font, either
FACE_SYSTEM,
FACE_MONOSPACE or
FACE_PROPORTIONALstyle - Style of font, combination of
STYLE_PLAIN,
STYLE_BOLD,
STYLE_ITALIC and
STYLE_UNDERLINEDsize - Size of font, either
SIZE_SMALL,
SIZE_MEDIUM,
SIZE_LARGE
nullpublic Style getStyle(String name)
name and returned.
name - Name of style to return
public Style getStyle(String primary,
String secondary)
primary style and
if it is missing the secondary is used.
If the secondary style is missing as well, a new, plain style
is created under the primary and returned.
primary - Primary style to returnsecondary - Secondary style to return
public String getParameter(String name)
name - Name of parameter
null if it doesn't existpublic Map getParameters()
String to Value mappings.public Map getServices()
String to Value mappings.
public View createView(String name,
Object context)
widget.xml file of this widget.
Calling this function may cause the Script.createElement(String, String, Style, Object)
being called if the view contains script actions.
name - Name of view to createcontext - Context object, will be passed to Script.createElement(String, String, Style, Object)
callback.
public View createMinimizedView(String name,
Object context)
public View createMaximizedView(String name,
Object context)
createView(String, Object) instead
public void setMinimizedView(Flow view)
view - Widget appearancegetMinimizedView(),
createView(String, Object)public Flow getMinimizedView()
setMinimizedView(Flow),
getMinimizedView(),
createView(String, Object)public Store getStore()
public boolean isOnline()
public void call(Object state,
String service,
String action,
Value argument)
Script.onSuccess(Object, Value)
or Script.onFailure(Object, String) is called.
state - State object to support call, it is passed
success and failure callbacks.service - Name of service to callaction - Name of action to callargument - Argument to action
public void call(Object state,
String service,
String action,
Value argument,
SuccessCallback onSuccess,
FailureCallback onFailure)
Script.onSuccess(Object, Value) or
Script.onFailure(Object, String) is called instead.
state - State object to support call, it is passed
success and failure callbacks.service - Name of service to callaction - Name of action to callargument - Argument to actiononSuccess - Success callbackonFailure - Failure callback
public void call(Object state,
String serviceVersionAction,
Value argument,
SuccessCallback onSuccess,
FailureCallback onFailure)
call(Object, String, String, Value) and call(Object, String, String, Value, SuccessCallback, FailureCallback)
so that services doesn't have to be declared in widget.xml in order to call them.
state - State object to support call, it is passed
success and failure callbacks.serviceVersionAction - Composite of service name, service version and action. For example
image/1/geturlargument - Argument to actiononSuccess - Success callbackonFailure - Failure callbackcall(Object, String, String, Value, SuccessCallback, FailureCallback)public String getUsername()
public boolean isRegistered()
public String getVersion()
MIDlet-Version parameter of jad file.
public boolean isUsingHTTP()
public String getWidgetName(int id)
id - id of widget.public long, long getMemoryUsage()
(totalMemory, usedMemory)public int, int getScreenSize()
(width, height)public int, int getDisplaySize()
(width, height)public void playNotifySound(boolean force)
alert.sound (number) and alert.volume (number)
widgetparameters are defined in widget.xml file.
force - forces sound to be played even if widget had not been
notified for new content by server.
public Player getPlayer(String sound,
int volume)
volume * 15 milliseconds.
Note 0, Remember to close Player handle, and set references to
it null after you are done.
Note 1, File extension is used to map correct content type,
so make sure you use ones listed above.
Note 2, In Nokia phones you need to have Alert Sounds on from your
current profile in order to hear Java/WidSets sounds.
Note 3, Opening of Input dialog, stops sounds that are being played
at the time.
sound - Name of sound to use.
Name of widget resource defined in widget.xml
as binary resource.volume - Volume to use, must be in range 0..100.
null if
sound resource was not found or there are errors in playing.Player
public Player getPlayer(ByteArray data,
String contentType,
int volume)
data - Sound data.contentType - Content type of data, audio/mpeg for example.volume - Volume to use, must be in range 0..100.
null if
sound data was malformed, format not supported by this phone or WidSets application
setting "Alerts" is "No".getPlayer(String, int),
Player
public void playSound(String sound,
int volume)
sound - volume - getPlayer(String, int),
Playerpublic void setUpdated(boolean isUpdated)
isUpdated - true if widget has updated contentpublic TimeZone getTimeZone(String id)
id - the ID for a TimeZone, either an abbreviation such as "GMT", or a full
name such as "America/Los_Angeles". The only time zone ID that is required to be
supported is "GMT".
public TimeZone getDefaultTimeZone()
TimeZone
may vary with implementation.
public List getAvailableTimeZones()
public boolean setParameter(String name,
Value value)
name - name of parameter being setvalue - new value of the parameter
true if parameter update was successful,
false if named parameter is not defined for
this widget or if value was of wrong typepublic boolean setParameters(Value params)
params - Value-list of string-value bindings
trueif parameters update was successful,
false if some named parameter
was not defined for this widget or if values were of wrong typepublic Config getConfig()
public String decodeString(ByteArray array,
String encoding)
array - The bytes to be converted into charactersencoding - The name of a supported character encoding
null if decoding failed.
public ByteArray encodeString(String string,
String encoding)
string - String to encodeencoding - The name of a supported character encoding
null if encoding failespublic String encodeHex(ByteArray array)
array - Array to be encoded
public ByteArray decodeHex(String string)
string - String to be encoded
public String encodeURL(String string)
string - String to encode
public int parseSize(String expr,
int parentSize)
expr - Size expression (no spaces allowed)parentSize - Size of parent, needed if '%'
expressions are used.public Picture getPicture(String url)
url specified and displays it as a Picture.
Default boundaries are mobile screen dimensions - 10 pixels.
Default format is jpeg.
url - Url to the image resource in the Internet
getPicture(String, int, int, String)
public Picture getPicture(String url,
int boundx,
int boundy,
String format)
url specified and displays it as a Picture.
This is a shortcut for using the image-service. Calling the function will return
right away and a place holder image is shown during the time the image is being
loaded from the Internet, when image arrives and it is valid the place holder is
replaced with the actual image and component layout is re-calculated and repaint.
If the loading fails (image not found or something else) a broken place holder
is shown instead. Place holders are static images that come with the client.
Url to the original image is stored in the data field of the Picture reference
returned, and it can be fetched using Component.getData().
When images are resized to match the boundaries proportions are kept as is.
Scaling is only done downwards, so if original is smaller than boundaries it
is passed as is.
Possible format for images are png8, png24 and
jpeg. It doesn't matter which format the original image is, as
long as normal Java JRE can read it in, basically PNG, GIF, JPEG should at least
be ok.
Note. That image loading is initiated only if client is online when this function
is called, if client is not online just a static place holder image will be shown,
and even when client goes online after that the loading won't start.
url - Url to the image resource in the Internetboundx - Maximum width of the image returnedboundy - Maximum height of the image returnedformat - Format of the image returned by server
public ByteArray getResource(String name)
name - Name of resource
null if there is
no such resource
public void openChannel(String id,
ChannelCallback channelCallback)
id - Channel idchannelCallback - Callback for obtaining the channel instance
public void openChannel(String name,
String protocol,
Value info,
int timeout,
ChannelCallback channelCallback)
name - Name of public channelprotocol - Name of "protocol" used on this channelinfo - Context dependent info structure, cannot be null.timeout - Timeout (seconds) after which the channel is closed when no members are present.
Note that actual effective timeout can be slightly larger than number provided here.channelCallback - Callback for obtaining the channel instance
public void openPrivateChannel(String protocol,
Value info,
int timeout,
ChannelCallback channelCallback)
protocol - Name of "protocol" used on this channelinfo - Context dependent channel info structure, cannot be null.timeout - Timeout (seconds) after which the channel is closed when not members are present.
Note that actual effective timeout can be slightly larger than number provided here.channelCallback - Callback for obtaining the channel instancepublic void callSerially(Runnable runnable)
runnable - Operation to run
public int morphColor(int sourceColor,
int targetColor,
int progress)
sourceColor - Source color for transitiontargetColor - Target color for transitionprogress - Progress of transition in range of [0..1000]
public boolean isDashboardVisible()
public boolean isSupported(String feature)
feature -
public int openBrowser(String url)
Note some older phones might close WidSets client, web browser, crash or something between those if it runs out of memory while loading/rendering web content.
If phone does not support multi-tasking, BROWSER_LATER is returned,
and browser is opened after WidSets client is closed.
Content-types likely to be supported by phones are WML, HTML, GIF/PNG/JPEG images, AAC/Midi/MP3/WAV sounds, 3GP videos, RTSP streamed videos, PDF documents. Some types might be opened by separate program rather than embedded in browser.
url - Url to be opened
BROWSER_OK, BROWSER_LATER or BROWSER_FAILED
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||