|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Display
public final class Display
Central class for the API that manages rendering/events and is used to place top
level components (Form
) on the "display". Before any Form is shown the Developer must
invoke Display.init(Object m) in order to register the current MIDlet.
This class handles the main thread for the toolkit referenced here on as the EDT (Event Dispatch Thread) similar to the Swing EDT. This thread encapsulates the platform specific event delivery and painting semantics and enables threading features such as animations etc...
The EDT should not be blocked since paint operations and events would also be blocked
in much the same way as they would be in other platforms. In order to serialize calls back
into the EDT use the methods callSerially(java.lang.Runnable)
& callSeriallyAndWait(java.lang.Runnable)
.
Notice that all LWUIT calls occur on the EDT (events, painting, animations etc...), LWUIT
should normally be manipulated on the EDT as well (hence the callSerially(java.lang.Runnable)
&
callSeriallyAndWait(java.lang.Runnable)
methods). Theoretically it should be possible to manipulate
some LWUIT features from other threads but this can't be guaranteed to work for all use cases.
Field Summary | |
---|---|
static int |
COMMAND_BEHAVIOR_BUTTON_BAR
Indicates that commands should be added to an always visible bar at the bottom of the form. |
static int |
COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_BACK
Identical to the bar behavior, places the back command within the title bar of the form/dialg |
static int |
COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_RIGHT
Places all commands on the right side of the title bar with a uniform size grid layout |
static int |
COMMAND_BEHAVIOR_DEFAULT
Indicates that the LWUIT implementation should decide internally the command behavior most appropriate for this platform. |
static int |
COMMAND_BEHAVIOR_NATIVE
Indicates that commands should try to add themselves to the native menus |
static int |
COMMAND_BEHAVIOR_SOFTKEY
Indicates the classic LWUIT command behavior where the commands are placed in a list within a dialog. |
static int |
COMMAND_BEHAVIOR_TOUCH_MENU
Indicates the touch menu dialog rendered by LWUIT where commands are placed into a scrollable dialog |
static int |
DENSITY_HD
HD Up To 1920x1080 |
static int |
DENSITY_HIGH
Hi Density Up To 480x854 |
static int |
DENSITY_LOW
Low Density Up To 240x320 |
static int |
DENSITY_MEDIUM
Medium Density Up To 360x480 |
static int |
DENSITY_VERY_HIGH
Very Hi Density Up To 1440x720 |
static int |
DENSITY_VERY_LOW
Very Low Density 176x220 And Smaller |
static int |
GAME_DOWN
Game action for down key |
static int |
GAME_FIRE
Game action for fire |
static int |
GAME_LEFT
Game action for left key |
static int |
GAME_RIGHT
Game action for right key |
static int |
GAME_UP
Game action for UP key |
static int |
KEY_POUND
An attribute that encapsulates '#' int value. |
static int |
KEYBOARD_TYPE_HALF_QWERTY
Half QWERTY which needs software assistance for completion |
static int |
KEYBOARD_TYPE_NUMERIC
Numeric keypad keyboard type |
static int |
KEYBOARD_TYPE_QWERTY
Full QWERTY keypad keyboard type, even if a numeric keyboard also exists |
static int |
KEYBOARD_TYPE_UNKNOWN
Unknown keyboard type is the default indicating the software should try to detect the keyboard type if necessary |
static int |
KEYBOARD_TYPE_VIRTUAL
Touch device without a physical keyboard that should popup a keyboad |
static int |
SHOW_DURING_EDIT_ALLOW_DISCARD
Allow show to occur during edit and discard all user input at this moment |
static int |
SHOW_DURING_EDIT_ALLOW_SAVE
Allow show to occur during edit and save all user input at this moment |
static int |
SHOW_DURING_EDIT_EXCEPTION
If show is called while editing text in the native text box an exception is thrown |
static int |
SHOW_DURING_EDIT_IGNORE
Ignore all calls to show occurring during edit, they are discarded immediately |
static int |
SHOW_DURING_EDIT_SET_AS_NEXT
Show will update the current form to which the OK button of the text box will return |
static java.lang.String |
SOUND_TYPE_ALARM
A common sound type that can be used with playBuiltinSound |
static java.lang.String |
SOUND_TYPE_BUTTON_PRESS
A common sound type that can be used with playBuiltinSound |
static java.lang.String |
SOUND_TYPE_CONFIRMATION
A common sound type that can be used with playBuiltinSound |
static java.lang.String |
SOUND_TYPE_ERROR
A common sound type that can be used with playBuiltinSound |
static java.lang.String |
SOUND_TYPE_INFO
A common sound type that can be used with playBuiltinSound |
static java.lang.String |
SOUND_TYPE_WARNING
A common sound type that can be used with playBuiltinSound |
Method Summary | |
---|---|
void |
addEdtErrorHandler(ActionListener e)
An error handler will receive an action event with the source exception from the EDT once an error handler is installed the default LWUIT error dialog will no longer appear |
void |
callSerially(java.lang.Runnable r)
Causes the runnable to be invoked on the event dispatch thread. |
void |
callSeriallyAndWait(java.lang.Runnable r)
Identical to callSerially with the added benefit of waiting for the Runnable method to complete. |
void |
callSeriallyAndWait(java.lang.Runnable r,
int timeout)
Identical to callSerially with the added benefit of waiting for the Runnable method to complete. |
boolean |
canForceOrientation()
Returns true if the device allows forcing the orientation via code, feature phones do not allow this although some include a jad property allowing for this feature |
void |
cleanupAudio(java.lang.Object handle)
Stops the audio playback and cleans up the resources related to it immediately. |
java.lang.String |
convertBidiLogicalToVisual(java.lang.String s)
Converts the given string from logical bidi layout to visual bidi layout so it can be rendered properly on the screen. |
int |
convertToPixels(int dipCount,
boolean horizontal)
Converts the dips count to pixels, dips are roughly 1mm in length. |
void |
copyToClipboard(java.lang.Object obj)
Performs a clipboard copy operation, if the native clipboard is supported by the implementation it would be used |
java.lang.Object |
createAudio(java.io.InputStream stream,
java.lang.String mimeType)
Create the sound in the given stream Notice that an audio is "auto destroyed" on completion and cannot be played twice! |
java.lang.Object |
createAudio(java.io.InputStream stream,
java.lang.String mimeType,
java.lang.Runnable onCompletion)
Create the sound in the given stream Notice that an audio is "auto destroyed" on completion and cannot be played twice! |
java.lang.Object |
createAudio(java.lang.String uri)
Creates a sound in the given URI which is partially platform specific. |
java.lang.Object |
createAudio(java.lang.String uri,
java.lang.Runnable onCompletion)
Creates a sound in the given URI which is partially platform specific. |
java.lang.Object |
createSoftWeakRef(java.lang.Object o)
Creates a soft/weak reference to an object that allows it to be collected yet caches it. |
static void |
deinitialize()
Closes down the EDT and LWUIT, under normal conditions this method is completely unnecessary since exiting the application will shut down LWUIT. |
void |
editString(Component cmp,
int maxSize,
int constraint,
java.lang.String text)
Encapsulates the editing code which is specific to the platform, some platforms would allow "in place editing" MIDP does not. |
void |
editString(Component cmp,
int maxSize,
int constraint,
java.lang.String text,
int initiatingKeycode)
Encapsulates the editing code which is specific to the platform, some platforms would allow "in place editing" MIDP does not. |
void |
execute(java.lang.String url)
Executes the given URL on the native platform |
void |
exitApplication()
Exits the application... |
java.lang.Object |
extractHardRef(java.lang.Object o)
Extracts the hard reference from the soft/weak reference given |
void |
flashBacklight(int duration)
Flash the backlight of the device for the given length of time |
int |
getAudioDuration(java.lang.Object handle)
Returns the length in seconds of the audio file |
int |
getAudioTime(java.lang.Object handle)
Returns the time in seconds in the audio file |
int |
getCharLocation(java.lang.String source,
int index)
Returns the index of the given char within the source string, the actual index isn't necessarily the same when bidi is involved See this for more on visual vs. logical ordering. |
int |
getCommandBehavior()
Indicates the way commands should be added to a form as one of the ocmmand constants defined in this class |
Form |
getCurrent()
Return the form currently displayed on the screen or null if no form is currently displayed. |
VirtualKeyboardInterface |
getDefaultVirtualKeyboard()
Get the default virtual keyboard or null if the VirtualKeyboard is disabled |
int |
getDeviceDensity()
Returns one of the density variables appropriate for this device, notice that density doesn't alwyas correspond to resolution and an implementation might decide to change the density based on DPI constraints. |
int |
getDisplayHeight()
Return the height of the display |
int |
getDisplayWidth()
Return the width of the display |
float |
getDragSpeed(boolean yAxis)
This method returns the dragging speed based on the latest dragged events |
int |
getDragStartPercentage()
This method allows us to manipulate the drag started detection logic. |
int |
getFrameRate()
Indicates the maximum frames the API will try to draw every second |
int |
getGameAction(int keyCode)
Returns the game action code matching the given key combination |
LWUITImplementation |
getImplementation()
|
static Display |
getInstance()
Return the Display instance |
int |
getKeyboardType()
Returns the type of the input device one of: KEYBOARD_TYPE_UNKNOWN, KEYBOARD_TYPE_NUMERIC, KEYBOARD_TYPE_QWERTY, KEYBOARD_TYPE_VIRTUAL, KEYBOARD_TYPE_HALF_QWERTY |
int |
getKeyCode(int gameAction)
Deprecated. this method doesn't work properly across device and is mocked up here mostly for the case of unit testing. Do not use it for anything other than that! Do not rely on getKeyCode(GAME_*) == keyCodeFromKeyEvent, this will never actually happen! |
java.lang.Object |
getPasteDataFromClipboard()
Returns the current content of the clipboard |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the property from the underlying platform deployment or the default value if no deployment values are supported. |
java.io.InputStream |
getResourceAsStream(java.lang.Class cls,
java.lang.String resource)
This method is essentially equivalent to cls.getResourceAsStream(String) however some platforms might define unique ways in which to load resources within the implementation. |
int |
getShowDuringEditBehavior()
Returns the status of the show during edit flag |
java.lang.String[] |
getSupportedVirtualKeyboard()
Returns all platform supported virtual keyboards names |
int |
getVolume()
Returns the media playback volume in percentage |
boolean |
hasDragOccured()
This method should be invoked by components that broadcast events on the pointerReleased callback. |
boolean |
hasNativeTheme()
Indicates if the implemenetation has a native underlying theme |
void |
hideNotify()
Broadcasts hide notify into LWUIT, this method is invoked by the LWUIT implementation to notify LWUIT of hideNotify events |
static void |
init(java.lang.Object m)
This is the Display initialization method. |
void |
installBuiltinSound(java.lang.String soundIdentifier,
java.io.InputStream data)
Installs a replacement sound as the builtin sound responsible for the given sound identifier (this will override the system sound if such a sound exists). |
void |
installNativeTheme()
Installs the native theme, this is only applicable if hasNativeTheme() returned true. |
void |
invokeAndBlock(java.lang.Runnable r)
Invokes runnable and blocks the current thread, if the current thread is the edt it will still be blocked however a separate thread would be launched to perform the duties of the EDT while it is blocked. |
void |
invokeAndBlock(java.lang.Runnable r,
boolean dropEvents)
Invokes runnable and blocks the current thread, if the current thread is the edt it will still be blocked however a separate thread would be launched to perform the duties of the EDT while it is blocked. |
boolean |
isAllowMinimizing()
Allows a LWUIT application to minimize without forcing it to the front whenever a new dialog is poped up |
boolean |
isAutoFoldVKBOnFormSwitch()
Normally LWUIT folds the VKB when switching forms this field allows us to block that behavior. |
boolean |
isBidiAlgorithm()
Indicates whether LWUIT should consider the bidi RTL algorithm when drawing text or navigating with the text field cursor. |
boolean |
isBuiltinSoundAvailable(java.lang.String soundIdentifier)
Indicates whether a user installed or system sound is available |
boolean |
isBuiltinSoundsEnabled()
Allows muting/unmuting the builtin sounds easily |
boolean |
isClickTouchScreen()
Indicates whether the device has a double layer screen thus allowing two stages to touch events: click and hover. |
boolean |
isEdt()
Returns true if we are currently in the event dispatch thread. |
static boolean |
isInitialized()
This method returns true if the Display is initialized. |
boolean |
isMinimized()
Indicates whether an application is minimized |
boolean |
isMultiTouch()
Indicates whether the device supports multi-touch events, this is only relevant when touch events are supported |
boolean |
isNativeCommands()
Deprecated. use getCommandBehavior() == Display.COMMAND_BEHAVIOR_NATIVE |
boolean |
isNativeInputSupported()
Indicates whether the device supports native in place editing in which case lightweight input logic shouldn't be used for input. |
boolean |
isPortrait()
Returns true if the device is currently in portrait mode |
boolean |
isPureTouch()
A pure touch device has no focus showing when the user is using the touch interface. |
boolean |
isRTL(char c)
Returns true if the given character is an RTL character |
boolean |
isTablet()
Indicates whether the device is a tablet, notice that this is often a guess |
boolean |
isThirdSoftButton()
Indicates whether the 3rd softbutton should be supported on this device |
boolean |
isTouchScreenDevice()
Indicates if this is a touch screen device that will return pen events, defaults to true if the device has pen events but can be overriden by the developer. |
boolean |
isVirtualKeyboardShowing()
Indicates if the virtual keyboard is currently showing or not |
void |
keyPressed(int keyCode)
Pushes a key press event with the given keycode into LWUIT |
void |
keyReleased(int keyCode)
Pushes a key release event with the given keycode into LWUIT |
void |
lockOrientation(boolean portrait)
On devices that return true for canForceOrientation() this method can lock the device orientation either to portrait or landscape mode |
boolean |
minimizeApplication()
Minimizes the current application if minimization is supported by the platform (may fail). |
int |
numAlphaLevels()
Return the number of alpha levels supported by the implementation. |
int |
numColors()
Returns the number of colors applicable on the device, note that the API does not support gray scale devices. |
void |
onEditingComplete(Component c,
java.lang.String text)
Called by the underlying implementation to indicate that editing in the native system has completed and changes should propogate into LWUIT |
void |
pauseAudio(java.lang.Object handle)
Pauses the playback of the audio file |
void |
playAudio(java.lang.Object handle)
Starts playing the audio file |
void |
playBuiltinSound(java.lang.String soundIdentifier)
Plays a builtin device sound matching the given identifier, implementations and themes can offer additional identifiers to the ones that are already built in. |
void |
pointerDragged(int[] x,
int[] y)
Pushes a pointer drag event with the given coordinates into LWUIT |
void |
pointerHover(int[] x,
int[] y)
Pushes a pointer hover event with the given coordinates into LWUIT |
void |
pointerHoverPressed(int[] x,
int[] y)
Pushes a pointer hover release event with the given coordinates into LWUIT |
void |
pointerHoverReleased(int[] x,
int[] y)
Pushes a pointer hover release event with the given coordinates into LWUIT |
void |
pointerPressed(int[] x,
int[] y)
Pushes a pointer press event with the given coordinates into LWUIT |
void |
pointerReleased(int[] x,
int[] y)
Pushes a pointer release event with the given coordinates into LWUIT |
void |
registerVirtualKeyboard(VirtualKeyboardInterface vkb)
Register a virtual keyboard |
void |
removeEdtErrorHandler(ActionListener e)
An error handler will receive an action event with the source exception from the EDT once an error handler is installed the default LWUIT error dialog will no longer appear |
void |
restoreMinimizedApplication()
Restore the minimized application if minimization is supported by the platform |
void |
setAllowMinimizing(boolean allowMinimizing)
Allows a LWUIT application to minimize without forcing it to the front whenever a new dialog is poped up |
void |
setAudioTime(java.lang.Object handle,
int time)
Sets the position in the audio file |
void |
setAutoFoldVKBOnFormSwitch(boolean autoFoldVKBOnFormSwitch)
Normally LWUIT folds the VKB when switching forms this field allows us to block that behavior. |
void |
setBidiAlgorithm(boolean activate)
Indicates whether LWUIT should consider the bidi RTL algorithm when drawing text or navigating with the text field cursor. |
void |
setBuiltinSoundsEnabled(boolean enabled)
Allows muting/unmuting the builtin sounds easily |
void |
setCommandBehavior(int commandBehavior)
Indicates the way commands should be added to a form as one of the ocmmand constants defined in this class |
void |
setDefaultVirtualKeyboard(VirtualKeyboardInterface vkb)
Sets the default virtual keyboard to be used by the platform |
void |
setDragStartPercentage(int dragStartPercentage)
This method allows us to manipulate the drag started detection logic. |
void |
setFramerate(int rate)
Indicates the maximum frames the API will try to draw every second by default this is set to 10. |
void |
setNativeCommands(boolean nativeCommands)
Deprecated. use setCommandBehavior(Display.COMMAND_BEHAVIOR_NATIVE) |
void |
setNoSleep(boolean noSleep)
Calling this method with noSleep=true will cause the edt to run without sleeping. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets a local property to the application, this method has no effect on the implementation code and only allows the user to override the logic of getProperty for internal application purposes. |
void |
setPureTouch(boolean pureTouch)
A pure touch device has no focus showing when the user is using the touch interface. |
void |
setShowDuringEditBehavior(int showDuringEdit)
Invoking the show() method of a form/dialog while the user is editing text in the native text box can have several behaviors: SHOW_DURING_EDIT_IGNORE, SHOW_DURING_EDIT_EXCEPTION, SHOW_DURING_EDIT_ALLOW_DISCARD, SHOW_DURING_EDIT_ALLOW_SAVE, SHOW_DURING_EDIT_SET_AS_NEXT |
void |
setShowVirtualKeyboard(boolean show)
Displays the virtual keyboard on devices that support manually poping up the vitual keyboard |
void |
setThirdSoftButton(boolean thirdSoftButton)
Indicates whether the 3rd softbutton should be supported on this device |
void |
setTouchScreenDevice(boolean touchScreen)
Indicates if this is a touch screen device that will return pen events, defaults to true if the device has pen events but can be overriden by the developer. |
void |
setTransitionYield(int transitionD)
Indicates whether a delay should exist between calls to flush graphics during transition. |
void |
setVolume(int vol)
Sets the media playback volume in percentage |
boolean |
shouldRenderSelection()
This is an internal state flag relevant only for pureTouch mode (otherwise it will always be true). |
boolean |
shouldRenderSelection(Component c)
This is an internal state flag relevant only for pureTouch mode (otherwise it will always be true). |
void |
showNativeScreen(java.lang.Object nativeFullScreenPeer)
Shows a native Form/Canvas or some other heavyweight native screen |
void |
showNotify()
Broadcasts show notify into LWUIT, this method is invoked by the LWUIT implementation to notify LWUIT of showNotify events |
void |
sizeChanged(int w,
int h)
Notifies LWUIT of display size changes, this method is invoked by the implementation class and is for internal use |
void |
vibrate(int duration)
Vibrates the device for the given length of time |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SOUND_TYPE_ALARM
public static final java.lang.String SOUND_TYPE_CONFIRMATION
public static final java.lang.String SOUND_TYPE_ERROR
public static final java.lang.String SOUND_TYPE_INFO
public static final java.lang.String SOUND_TYPE_WARNING
public static final java.lang.String SOUND_TYPE_BUTTON_PRESS
public static final int KEYBOARD_TYPE_UNKNOWN
public static final int KEYBOARD_TYPE_NUMERIC
public static final int KEYBOARD_TYPE_QWERTY
public static final int KEYBOARD_TYPE_VIRTUAL
public static final int KEYBOARD_TYPE_HALF_QWERTY
public static final int DENSITY_VERY_LOW
public static final int DENSITY_LOW
public static final int DENSITY_MEDIUM
public static final int DENSITY_HIGH
public static final int DENSITY_VERY_HIGH
public static final int DENSITY_HD
public static final int GAME_FIRE
public static final int GAME_LEFT
public static final int GAME_RIGHT
public static final int GAME_UP
public static final int GAME_DOWN
public static final int KEY_POUND
public static final int SHOW_DURING_EDIT_IGNORE
public static final int SHOW_DURING_EDIT_EXCEPTION
public static final int SHOW_DURING_EDIT_ALLOW_DISCARD
public static final int SHOW_DURING_EDIT_ALLOW_SAVE
public static final int SHOW_DURING_EDIT_SET_AS_NEXT
public static final int COMMAND_BEHAVIOR_DEFAULT
public static final int COMMAND_BEHAVIOR_SOFTKEY
public static final int COMMAND_BEHAVIOR_TOUCH_MENU
public static final int COMMAND_BEHAVIOR_BUTTON_BAR
public static final int COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_BACK
public static final int COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_RIGHT
public static final int COMMAND_BEHAVIOR_NATIVE
Method Detail |
---|
public static void init(java.lang.Object m)
m
- the main running MIDletpublic static void deinitialize()
public static boolean isInitialized()
public static Display getInstance()
public int getDragStartPercentage()
public void setDragStartPercentage(int dragStartPercentage)
dragStartPercentage
- percentage of the screen required to initiate dragpublic LWUITImplementation getImplementation()
public void setFramerate(int rate)
rate
- the frame ratepublic void vibrate(int duration)
duration
- length of time to vibratepublic void flashBacklight(int duration)
duration
- length of time to flash the backlightpublic void setShowDuringEditBehavior(int showDuringEdit)
showDuringEdit
- one of the following: SHOW_DURING_EDIT_IGNORE,
SHOW_DURING_EDIT_EXCEPTION, SHOW_DURING_EDIT_ALLOW_DISCARD,
SHOW_DURING_EDIT_ALLOW_SAVE, SHOW_DURING_EDIT_SET_AS_NEXTpublic int getShowDuringEditBehavior()
public int getFrameRate()
public boolean isEdt()
public void callSerially(java.lang.Runnable r)
r
- runnable (NOT A THREAD!) that will be invoked on the EDT serial to
the paint and key handling eventspublic void callSeriallyAndWait(java.lang.Runnable r)
r
- runnable (NOT A THREAD!) that will be invoked on the EDT serial to
the paint and key handling events
java.lang.IllegalStateException
- if this method is invoked on the event dispatch thread (e.g. during
paint or event handling).public void callSeriallyAndWait(java.lang.Runnable r, int timeout)
r
- runnable (NOT A THREAD!) that will be invoked on the EDT serial to
the paint and key handling eventstimeout
- timeout duration, on timeout the method just returns
java.lang.IllegalStateException
- if this method is invoked on the event dispatch thread (e.g. during
paint or event handling).public void onEditingComplete(Component c, java.lang.String text)
c
- edited componenttext
- new text for the componentpublic void invokeAndBlock(java.lang.Runnable r, boolean dropEvents)
r
- runnable (NOT A THREAD!) that will be invoked synchroniously by this methoddropEvents
- indicates if the display should drop all events
while this runnable is runningpublic void invokeAndBlock(java.lang.Runnable r)
r
- runnable (NOT A THREAD!) that will be invoked synchroniously by this methodpublic boolean isTouchScreenDevice()
public void setTouchScreenDevice(boolean touchScreen)
touchScreen
- false if this is not a touch screen devicepublic void setNoSleep(boolean noSleep)
noSleep
- causes the edt to stop the sleeping periods between 2 cyclespublic void setTransitionYield(int transitionD)
transitionD
- -1 for no delay otherwise delay in millisecondspublic void editString(Component cmp, int maxSize, int constraint, java.lang.String text)
cmp
- the TextArea
componentmaxSize
- the maximum size from the text areaconstraint
- the constraints of the text areatext
- the string to editpublic void editString(Component cmp, int maxSize, int constraint, java.lang.String text, int initiatingKeycode)
cmp
- the TextArea
componentmaxSize
- the maximum size from the text areaconstraint
- the constraints of the text areatext
- the string to editinitiatingKeycode
- the keycode used to initiate the edit.public boolean minimizeApplication()
public boolean isMinimized()
public void restoreMinimizedApplication()
public void keyPressed(int keyCode)
keyCode
- keycode of the key eventpublic void keyReleased(int keyCode)
keyCode
- keycode of the key eventpublic void pointerDragged(int[] x, int[] y)
x
- the x position of the pointery
- the y position of the pointerpublic void pointerHover(int[] x, int[] y)
x
- the x position of the pointery
- the y position of the pointerpublic void pointerHoverPressed(int[] x, int[] y)
x
- the x position of the pointery
- the y position of the pointerpublic void pointerHoverReleased(int[] x, int[] y)
x
- the x position of the pointery
- the y position of the pointerpublic void pointerPressed(int[] x, int[] y)
x
- the x position of the pointery
- the y position of the pointerpublic void pointerReleased(int[] x, int[] y)
x
- the x position of the pointery
- the y position of the pointerpublic void sizeChanged(int w, int h)
w
- the width of the drawing surfaceh
- the height of the drawing surfacepublic void hideNotify()
public void showNotify()
public boolean hasDragOccured()
public Form getCurrent()
public int numAlphaLevels()
public int numColors()
public int getDisplayWidth()
public int getDisplayHeight()
public int convertToPixels(int dipCount, boolean horizontal)
dipCount
- the dips that we will convert to pixelshorizontal
- indicates pixels in the horizontal plane
public int getGameAction(int keyCode)
keyCode
- key code received from the event
public int getKeyCode(int gameAction)
gameAction
- game action constant from this class
public boolean isThirdSoftButton()
public void setThirdSoftButton(boolean thirdSoftButton)
thirdSoftButton
- true if a third softbutton should be usedpublic void setShowVirtualKeyboard(boolean show)
show
- toggles the virtual keyboards visibilitypublic boolean isVirtualKeyboardShowing()
public java.lang.String[] getSupportedVirtualKeyboard()
public void registerVirtualKeyboard(VirtualKeyboardInterface vkb)
vkb
- public void setDefaultVirtualKeyboard(VirtualKeyboardInterface vkb)
vkb
- a VirtualKeyboard to be used or null to disable the
VirtualKeyboardpublic VirtualKeyboardInterface getDefaultVirtualKeyboard()
public int getKeyboardType()
public boolean isNativeInputSupported()
public boolean isMultiTouch()
public boolean isClickTouchScreen()
A click touch screen will also send pointer hover events to the underlying software and will only send the standard pointer events on click.
public float getDragSpeed(boolean yAxis)
yAxis
- indicates what axis speed is required
public boolean isBidiAlgorithm()
public void setBidiAlgorithm(boolean activate)
activate
- set to true to activate the bidi algorithm, false to
disable itpublic java.lang.String convertBidiLogicalToVisual(java.lang.String s)
s
- a "logical" string with RTL characters
public int getCharLocation(java.lang.String source, int index)
source
- the string in which we are looking for the positionindex
- the "logical" location of the cursor
public boolean isRTL(char c)
c
- character to test
public java.io.InputStream getResourceAsStream(java.lang.Class cls, java.lang.String resource)
cls
- class to load the resource fromresource
- relative/absolute URL based on the Java convention
public void addEdtErrorHandler(ActionListener e)
e
- listener receiving the errorspublic void removeEdtErrorHandler(ActionListener e)
e
- listener receiving the errorspublic void setAllowMinimizing(boolean allowMinimizing)
allowMinimizing
- valuepublic boolean isAllowMinimizing()
public boolean shouldRenderSelection()
public boolean shouldRenderSelection(Component c)
c
- the component to test against, this prevents a touch outside of the component that triggers a repaint from painting the component selection
public boolean isPureTouch()
public void setPureTouch(boolean pureTouch)
pureTouch
- the value for pureTouchpublic boolean isNativeCommands()
public void setNativeCommands(boolean nativeCommands)
nativeCommands
- the flag to setpublic void exitApplication()
public void showNativeScreen(java.lang.Object nativeFullScreenPeer)
nativeFullScreenPeer
- the native screen peerpublic boolean isAutoFoldVKBOnFormSwitch()
public void setAutoFoldVKBOnFormSwitch(boolean autoFoldVKBOnFormSwitch)
autoFoldVKBOnFormSwitch
- the autoFoldVKBOnFormSwitch to setpublic int getCommandBehavior()
public void setCommandBehavior(int commandBehavior)
commandBehavior
- the commandBehavior to setpublic java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
The implementation should be responsible for the following keys to return reasonable valid values for the application:
key
- the key of the propertydefaultValue
- a default return value
public void setProperty(java.lang.String key, java.lang.String value)
key
- key the key of the propertyvalue
- the value of the propertypublic void execute(java.lang.String url)
url
- the url to executepublic int getDeviceDensity()
public void playBuiltinSound(java.lang.String soundIdentifier)
soundIdentifier
- the sound identifier which can match one of the
common constants in this class or be a user/implementation defined soundpublic void installBuiltinSound(java.lang.String soundIdentifier, java.io.InputStream data) throws java.io.IOException
soundIdentifier
- the sound string passed to playBuiltinSounddata
- an input stream containing platform specific audio file, its usually safe
to assume that wav/mp3 would be supported.
java.io.IOException
- if the stream throws an exceptionpublic boolean isBuiltinSoundAvailable(java.lang.String soundIdentifier)
soundIdentifier
- the sound string passed to playBuiltinSound
public void setBuiltinSoundsEnabled(boolean enabled)
enabled
- indicates whether the sound is mutedpublic boolean isBuiltinSoundsEnabled()
public java.lang.Object createAudio(java.lang.String uri) throws java.io.IOException
uri
- the platform specific location for the sound
java.io.IOException
- if the URI access failspublic java.lang.Object createAudio(java.io.InputStream stream, java.lang.String mimeType) throws java.io.IOException
stream
- the stream containing the media datamimeType
- the type of the data in the stream
java.io.IOException
- if the URI access failspublic java.lang.Object createAudio(java.lang.String uri, java.lang.Runnable onCompletion) throws java.io.IOException
uri
- the platform specific location for the soundonCompletion
- invoked when the audio file finishes playing, may be null
java.io.IOException
- if the URI access failspublic java.lang.Object createAudio(java.io.InputStream stream, java.lang.String mimeType, java.lang.Runnable onCompletion) throws java.io.IOException
stream
- the stream containing the media datamimeType
- the type of the data in the streamonCompletion
- invoked when the audio file finishes playing, may be null
java.io.IOException
- if the URI access failspublic void playAudio(java.lang.Object handle)
handle
- the handle object returned by create audiopublic void pauseAudio(java.lang.Object handle)
handle
- the handle object returned by create audiopublic void cleanupAudio(java.lang.Object handle)
handle
- the playback handlepublic int getAudioTime(java.lang.Object handle)
handle
- the handle object returned by create audio
public void setAudioTime(java.lang.Object handle, int time)
handle
- the handle object returned by create audiotime
- in milli secondspublic int getAudioDuration(java.lang.Object handle)
handle
- the handle object returned by create audio
public void setVolume(int vol)
vol
- the volume for media playbackpublic int getVolume()
public java.lang.Object createSoftWeakRef(java.lang.Object o)
o
- object to cache
public java.lang.Object extractHardRef(java.lang.Object o)
o
- the reference returned by createSoftWeakRef
public boolean hasNativeTheme()
public void installNativeTheme()
public void copyToClipboard(java.lang.Object obj)
obj
- object to copy, while this can be any arbitrary object it is recommended that only Strings or LWUIT
image objects be used to copypublic java.lang.Object getPasteDataFromClipboard()
public boolean isPortrait()
public boolean canForceOrientation()
public void lockOrientation(boolean portrait)
portrait
- true to lock to portrait mode, false to lock to landscape modepublic boolean isTablet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |