|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.impl.LWUITImplementation
public abstract class LWUITImplementation
Represents a vendor extension mechanizm for LWUIT, WARNING: this class is for internal use only and is subject to change in future API revisions. To replace the way in which LWUIT performs its task this class can be extended and its functionality replaced or enhanced.
It is the responsibility of the implementation class to grab and fire all events to the Display specifically for key, pointer events and screen resolution.
Constructor Summary | |
---|---|
LWUITImplementation()
|
Method Summary | |
---|---|
boolean |
animateImage(java.lang.Object nativeImage,
long lastFrame)
Callback to allow images animated by the underlying system to change their state e.g. for SVG or animated gif support. |
void |
browserBack(PeerComponent browserPeer)
Navigates back in the history |
void |
browserClearHistory(PeerComponent browserPeer)
Clears navigation history |
void |
browserExecute(PeerComponent browserPeer,
java.lang.String javaScript)
Executes the given JavaScript string within the current context |
void |
browserExposeInJavaScript(PeerComponent browserPeer,
java.lang.Object o,
java.lang.String name)
Allows exposing the given object to JavaScript code so the JavaScript code can invoke methods and access fields on the given object. |
void |
browserForward(PeerComponent browserPeer)
Navigates forward in the history |
boolean |
browserHasBack(PeerComponent browserPeer)
Indicates whether back is currently available |
boolean |
browserHasForward(PeerComponent browserPeer)
Indicates whether forward is currently available |
void |
browserReload(PeerComponent browserPeer)
Reload the current page |
protected boolean |
cacheLinearGradients()
Indicates whether the implementation is interested in caching linear gradients for drawing. |
protected boolean |
cacheRadialGradients()
Indicates whether the implementation is interested in caching radial gradients for drawing. |
void |
cancelRepaint(Animation cmp)
Removes an entry from the paint queue if it exists, this is important for cases in which a component was repainted and immediately removed from its parent container afterwards. |
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 |
abstract int |
charsWidth(java.lang.Object nativeFont,
char[] ch,
int offset,
int length)
Return the width of the given characters in the given native font instance |
abstract int |
charWidth(java.lang.Object nativeFont,
char ch)
Return the width of the specific character when rendered alone |
void |
cleanupAudio(java.lang.Object handle)
Stops the audio playback and cleans up the resources related to it immediately. |
abstract void |
clipRect(java.lang.Object graphics,
int x,
int y,
int width,
int height)
Changes the current clipping rectangle to subset the current clipping with the given clipping. |
void |
clipRect(java.lang.Object graphics,
Rectangle rect)
Changes the current clipping rectangle to subset the current clipping with the given clipping. |
void |
confirmControlView()
Callback method allowing the implementation to confirm that it controls the view just before a new form is installed. |
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. |
protected java.lang.Object |
convertBuiltinSound(java.io.InputStream i)
Converts a sound object to a form which will be easy for the implementation to play later on. |
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,
java.lang.Runnable onCompletion)
Plays the sound in the given stream |
java.lang.Object |
createAudio(java.lang.String uri,
java.lang.Runnable onCompletion)
Plays the sound in the given URI which is partially platform specific. |
PeerComponent |
createBrowserComponent(java.lang.Object browserComponent)
If the implementation supports the creation of a browser component it should be returned in this method |
abstract java.lang.Object |
createFont(int face,
int style,
int size)
Creates a new instance of a native font |
abstract java.lang.Object |
createImage(byte[] bytes,
int offset,
int len)
Create a nativate image from its compressed byte data |
abstract java.lang.Object |
createImage(java.io.InputStream i)
Creates a native image from a given input stream |
abstract java.lang.Object |
createImage(int[] rgb,
int width,
int height)
Create a platform native image object from the given RGB data |
abstract java.lang.Object |
createImage(java.lang.String path)
Creates a native image from a file in the system jar |
abstract java.lang.Object |
createMutableImage(int width,
int height,
int fillColor)
Creates a modifable native image that can return a graphics object |
java.lang.Object |
createNativeIndexed(IndexedImage image)
Creates a native image representing the indexed image |
PeerComponent |
createNativePeer(java.lang.Object nativeComponent)
Creates a peer component for the given lightweight component |
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. |
java.lang.Object |
createSVGImage(java.lang.String baseURL,
byte[] data)
Creates an SVG Image from the given byte array data and the base URL |
java.lang.Object |
createVideoComponent(java.lang.Object player)
Deprecated. replaced by the new video component |
VideoComponent |
createVideoPeer(java.io.InputStream stream,
java.lang.String type)
Create a video component |
VideoComponent |
createVideoPeer(java.lang.String url)
Create a video component |
void |
deinitialize()
Allows subclasses to cleanup if necessary |
abstract void |
drawArc(java.lang.Object graphics,
int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Draws a circular or elliptical arc based on the given angles and bounding box |
abstract void |
drawImage(java.lang.Object graphics,
java.lang.Object img,
int x,
int y)
Draws the image so its top left coordinate corresponds to x/y |
void |
drawImage(java.lang.Object graphics,
java.lang.Object img,
int x,
int y,
int w,
int h)
Draws the image so its top left coordinate corresponds to x/y |
void |
drawImageArea(java.lang.Object nativeGraphics,
java.lang.Object img,
int x,
int y,
int imageX,
int imageY,
int imageWidth,
int imageHeight)
Draws a portion of the image |
void |
drawImageRotated(java.lang.Object graphics,
java.lang.Object img,
int x,
int y,
int degrees)
Draws the image so its top left coordinate corresponds to x/y with a fast native rotation in a square angle which must be one of 0, 90, 180 or 270 |
abstract void |
drawLine(java.lang.Object graphics,
int x1,
int y1,
int x2,
int y2)
Draws a line between the 2 X/Y coordinates |
void |
drawPolygon(java.lang.Object graphics,
int[] xPoints,
int[] yPoints,
int nPoints)
Draws a closed polygon defined by arrays of x and y coordinates. |
abstract void |
drawRect(java.lang.Object graphics,
int x,
int y,
int width,
int height)
Draws a rectangle in the given coordinates |
abstract void |
drawRGB(java.lang.Object graphics,
int[] rgbData,
int offset,
int x,
int y,
int w,
int h,
boolean processAlpha)
Draws the RGB values based on the MIDP API of a similar name. |
abstract void |
drawRoundRect(java.lang.Object graphics,
int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draws a rounded corner rectangle in the given coordinates with the arcWidth/height matching the last two arguments respectively. |
abstract void |
drawString(java.lang.Object graphics,
java.lang.String str,
int x,
int y)
Draw a string using the current font and color in the x,y coordinates. |
abstract 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 |
edtIdle(boolean enter)
This method is a callback from the edt before the edt enters to an idle state |
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 |
abstract void |
fillArc(java.lang.Object graphics,
int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Fills a circular or elliptical arc based on the given angles and bounding box. |
void |
fillLinearGradient(java.lang.Object graphics,
int startColor,
int endColor,
int x,
int y,
int width,
int height,
boolean horizontal)
Draws a linear gradient in the given coordinates with the given colors, doesn't take alpha into consideration when drawing the gradient |
void |
fillPolygon(java.lang.Object graphics,
int[] xPoints,
int[] yPoints,
int nPoints)
Fills a closed polygon defined by arrays of x and y coordinates. |
void |
fillRadialGradient(java.lang.Object graphics,
int startColor,
int endColor,
int x,
int y,
int width,
int height)
Draws a radial gradient in the given coordinates with the given colors, doesn't take alpha into consideration when drawing the gradient. |
abstract void |
fillRect(java.lang.Object graphics,
int x,
int y,
int width,
int height)
Fills the rectangle from the given position according to the width/height minus 1 pixel according to the convention in Java. |
void |
fillRectRadialGradient(java.lang.Object graphics,
int startColor,
int endColor,
int x,
int y,
int width,
int height,
float relativeX,
float relativeY,
float relativeSize)
Draws a radial gradient in the given coordinates with the given colors, doesn't take alpha into consideration when drawing the gradient. |
abstract void |
fillRoundRect(java.lang.Object graphics,
int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Fills a rounded rectangle in the same way as drawRoundRect |
void |
fillTriangle(java.lang.Object graphics,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
Draws a filled triangle with the given coordinates |
void |
flashBacklight(int duration)
Flash the backlight of the device for the given length of time |
abstract void |
flushGraphics()
Flush the currently painted drawing onto the screen if using a double buffer |
abstract void |
flushGraphics(int x,
int y,
int width,
int height)
Flush the currently painted drawing onto the screen if using a double buffer |
abstract int |
getAlpha(java.lang.Object graphics)
Alpha value from 0-255 can be ignored for some operations |
int |
getAudioDuration(java.lang.Object handle)
Returns the length in milli seconds of the audio file |
int |
getAudioTime(java.lang.Object handle)
Returns the time in seconds in the audio file |
abstract int |
getBackKeyCode()
Returns the keycode for the back key |
abstract int |
getBackspaceKeyCode()
Returns the keycode for the backspace key |
java.lang.String |
getBrowserTitle(PeerComponent browserPeer)
The page title |
java.lang.String |
getBrowserURL(PeerComponent browserPeer)
The page URL |
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. |
abstract int |
getClearKeyCode()
Returns the keycode for the clear key |
abstract int |
getClipHeight(java.lang.Object graphics)
Returns the clipping coordinate |
Rectangle |
getClipRect(java.lang.Object graphics)
Returns the internal clipping rectangle. |
abstract int |
getClipWidth(java.lang.Object graphics)
Returns the clipping coordinate |
abstract int |
getClipX(java.lang.Object graphics)
Returns the clipping coordinate |
abstract int |
getClipY(java.lang.Object graphics)
Returns the clipping coordinate |
abstract int |
getColor(java.lang.Object graphics)
Returns the current color |
Graphics |
getComponentScreenGraphics(Component cmp,
Graphics currentContext)
This method allows customizing/creating a graphics context per component which is useful for some elaborate implementations of LWUIT. |
Form |
getCurrentForm()
Returns the current form, this method is for internal use only and does not take transitions/menus into consideration |
abstract java.lang.Object |
getDefaultFont()
Return the global default font instance, if font is passed as null this font should be used |
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. |
abstract int |
getDisplayHeight()
Returns the height dimention of the display controlled by this implementation |
java.lang.Object |
getDisplayLock()
Returns a lock object which can be synchrnoized against, this lock is used by the EDT. |
abstract int |
getDisplayWidth()
Returns the width dimention of the display controlled by this implementation |
protected int |
getDragAutoActivationThreshold()
This method allows subclasses to manipulate the drag started detection logic. |
int |
getDragPathLength()
Indicates how many drag points are used to calculate dragging speed |
int |
getDragPathTime()
Indicates what drag points are valid for the drag speed calculation. |
float |
getDragSpeed(float[] points,
long[] dragPathTime,
int dragPathOffset,
int dragPathLength)
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 |
getFace(java.lang.Object nativeFont)
Optional operation returning the font face for the font |
java.lang.String[] |
getFontPlatformNames()
Returns a list of the platform names ordered by priority, platform names are used to choose a font based on platform. |
abstract int |
getGameAction(int keyCode)
Returns the display game action for the given keyCode if applicable to match the contrct of LWUIT for the game action behavior |
abstract int |
getHeight(java.lang.Object nativeFont)
Return the total height of the font |
abstract int |
getImageHeight(java.lang.Object i)
Returns the height of a native image |
abstract int |
getImageWidth(java.lang.Object i)
Returns the width of a native image |
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 |
abstract int |
getKeyCode(int gameAction)
Returns a keycode which can be sent to getGameAction |
protected Graphics |
getLWUITGraphics()
Returns a graphics object for use by the painting |
long |
getMediaTime(java.lang.Object player)
Deprecated. replaced by the new video component |
abstract java.lang.Object |
getNativeGraphics()
Returns the native graphics object on which all rendering operations occur |
abstract java.lang.Object |
getNativeGraphics(java.lang.Object image)
Returns the native graphics object on the given native image occur |
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. |
abstract void |
getRGB(java.lang.Object nativeImage,
int[] arr,
int offset,
int x,
int y,
int width,
int height)
Extracts RGB data from the given native image and places it in the given array |
int |
getSize(java.lang.Object nativeFont)
Optional operation returning the font size for system fonts |
abstract int[] |
getSoftkeyCode(int index)
Returns the softkey keycode for the given softkey index |
abstract int |
getSoftkeyCount()
Returns the number of softkeys on the device |
int |
getStyle(java.lang.Object nativeFont)
Optional operation returning the font style for system fonts |
java.lang.Object |
getSVGDocument(java.lang.Object svgImage)
Returns a platform specific DOM object that can be manipulated by the user to change the SVG Image |
int |
getTranslateX(java.lang.Object graphics)
Returns the current x translate value |
int |
getTranslateY(java.lang.Object graphics)
Returns the current y translate value |
java.lang.Object |
getVideoControl(java.lang.Object player)
Returns the video control for the media player |
int |
getVideoHeight(java.lang.Object videoControl)
Deprecated. replaced by the new video component |
int |
getVideoWidth(java.lang.Object videoControl)
Deprecated. replaced by the new video component |
int |
getVolume()
Returns the media playback volume in percentage |
boolean |
handleEDTException(java.lang.Throwable err)
Invoked when an exception occurs on the EDT, allows the implementation to take control of the device to produce testing information. |
protected boolean |
hasDragStarted(int[] x,
int[] y)
This method can be overriden by subclasses to indicate whether a drag event has started or whether the device is just sending out "noise". |
protected boolean |
hasDragStarted(int x,
int y)
This method can be overriden by subclasses to indicate whether a drag event has started or whether the device is just sending out "noise". |
boolean |
hasNativeTheme()
Indicates if the implemenetation has a native underlying theme |
boolean |
hasPendingPaints()
Returns true if the implementation still has elements to paint. |
protected void |
hideNotify()
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
abstract void |
init(java.lang.Object m)
Invoked by the display init method allowing the implementation to "bind" |
void |
initEDT()
Some implementations might need to perform initializations of the EDT thread |
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. |
boolean |
isAffineSupported()
Indicates whether the underlying implementation can draw using an affine transform hence methods such as rotate, scale and shear would work |
boolean |
isAlphaGlobal()
Returns true if alpha can be applied for all elements globally and efficiently otherwise alpha should be ignored. |
boolean |
isAlphaMutableImageSupported()
Indicates whether mutable images respect alpha values when constructed |
boolean |
isAnimation(java.lang.Object nativeImage)
Animations should return true to allow the native image animation to update |
boolean |
isAntiAliased(java.lang.Object graphics)
Returns anti-aliasing mode for regular rendering operations |
boolean |
isAntiAliasedText(java.lang.Object graphics)
Returns anti-aliasing mode for font rendering operations |
boolean |
isAntiAliasedTextSupported()
Indicates whether the underlying implementation allows for anti-aliased fonts |
boolean |
isAntiAliasingSupported()
Indicates whether the underlying implementation allows for anti-aliasing in regular drawing operations |
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 |
isLookupFontSupported()
Indicates whether loading a font by a string is supported by the platform |
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 |
isNativeBrowserComponentSupported()
An implementation can return true if it supports embedding a native browser widget |
boolean |
isNativeIndexed()
Returns true if indexed images should be used natively |
boolean |
isNativeInputSupported()
Indicates whether the device supports native in place editing in which case lightweight input logic shouldn't be used for input. |
boolean |
isOpaque(Image lwuitImage,
java.lang.Object nativeImage)
Returns true if the image was opaque |
boolean |
isPortrait()
Returns true if the device is currently in portrait mode |
boolean |
isRotationDrawingSupported()
Indicates whether drawImageRotated is supported by the platform for FAST drawing, if not then its not worth calling the method which will be unimplemented! |
boolean |
isRTL(char c)
Returns true if the given character is an RTL character |
boolean |
isRTLOrWhitespace(char c)
Returns true if the given character is an RTL character or a space character |
boolean |
isScaledImageDrawingSupported()
Indicates if image scaling on the fly is supported by the platform, if not LWUIT will just scale the images on its own before drawing |
boolean |
isSVGSupported()
Indicates whether the underlying platform supports creating an SVG Image |
boolean |
isTablet()
Indicates whether the device is a tablet, notice that this is often a guess |
boolean |
isThirdSoftButton()
Indicates the default status to apply to the 3rd softbutton variable |
abstract boolean |
isTouchDevice()
Returns true if the device will send touch events |
boolean |
isTranslationSupported()
LWUIT can translate all coordinates and never requires a call to translate this works well for some devices which have hairy issues with translate. |
boolean |
isTrueTypeSupported()
Returns true if the system supports dynamically loading truetype fonts from a stream. |
protected void |
keyPressed(int keyCode)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
keyReleased(int keyCode)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
java.lang.Object |
loadNativeFont(java.lang.String lookup)
Loads a native font based on a lookup for a font name and attributes. |
java.lang.Object |
loadTrueTypeFont(java.io.InputStream stream)
Loads the truetype font from the input stream without closing the stream, this method should return the native font. |
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). |
void |
notifyCommandBehavior(int commandBehavior)
This method notifies the implementation about the chosen commands behavior |
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 |
paintDirty()
Invoked by the EDT to paint the dirty regions |
protected void |
paintOverlay(Graphics g)
Allows for painting an overlay on top of the implementation for notices during testing etc. |
void |
paintVideo(Component cmp,
boolean fullScreen,
java.lang.Object nativeGraphics,
java.lang.Object video,
java.lang.Object player)
Deprecated. replaced by the version that accepts the video component instance |
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 |
playDialogSound(int type)
Invoked when a dialog is shown, this method allows a dialog to play a sound |
protected void |
playNativeBuiltinSound(java.lang.Object data)
This method allows implementations to store sound objects natively e.g. |
protected boolean |
playUserSound(java.lang.String soundIdentifier)
Plays a sound defined by the user |
protected void |
pointerDragged(int[] x,
int[] y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerDragged(int x,
int y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerHover(int[] x,
int[] y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerHover(int x,
int y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerHoverPressed(int[] x,
int[] y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerHoverPressed(int x,
int y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerHoverReleased(int[] x,
int[] y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerHoverReleased(int x,
int y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerPressed(int[] x,
int[] y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerPressed(int x,
int y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerReleased(int[] x,
int[] y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
pointerReleased(int x,
int y)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
void |
repaint(Animation cmp)
Invoked to add an element to the paintQueue |
void |
resetAffine(java.lang.Object nativeGraphics)
Resets the affine transform to the default value |
void |
restoreMinimizedApplication()
Restore the minimized application if minimization is supported by the platform |
void |
rotate(java.lang.Object nativeGraphics,
float angle)
Rotates the coordinate system around a radian angle using the affine transform |
java.lang.Object |
rotate(java.lang.Object image,
int degrees)
Returns an instance of this image rotated by the given number of degrees. |
void |
saveTextEditingState()
Invoked if LWUIT needs to dispose the native text editing but would like the editor to store its state. |
void |
scale(java.lang.Object nativeGraphics,
float x,
float y)
Scales the coordinate system using the affine transform |
abstract java.lang.Object |
scale(java.lang.Object nativeImage,
int width,
int height)
Scales a native image and returns the scaled version |
abstract void |
setAlpha(java.lang.Object graphics,
int alpha)
Alpha value from 0-255 can be ignored for some operations |
void |
setAntiAliased(java.lang.Object graphics,
boolean a)
Toggles anti-aliasing mode for regular rendering operations |
void |
setAntiAliasedText(java.lang.Object graphics,
boolean a)
Toggles anti-aliasing mode for font rendering operations |
void |
setAudioTime(java.lang.Object handle,
int time)
Sets the position in the audio file |
void |
setBidiAlgorithm(boolean activate)
Indicates whether LWUIT should consider the bidi RTL algorithm when drawing text or navigating with the text field cursor. |
void |
setBrowserPage(PeerComponent browserPeer,
java.lang.String html,
java.lang.String baseUrl)
Shows the given HTML in the native viewer |
void |
setBrowserProperty(PeerComponent browserPeer,
java.lang.String key,
java.lang.Object value)
This method allows customizing the properties of a web view in various ways including platform specific settings. |
void |
setBrowserURL(PeerComponent browserPeer,
java.lang.String url)
Sets the page URL, jar: URL's must be supported by the implementation |
void |
setBuiltinSoundsEnabled(boolean enabled)
Allows muting/unmuting the builtin sounds easily |
abstract void |
setClip(java.lang.Object graphics,
int x,
int y,
int width,
int height)
Installs a new clipping rectangle |
void |
setClipRect(java.lang.Object graphics,
Rectangle rect)
Installs a new clipping rectangle |
abstract void |
setColor(java.lang.Object graphics,
int RGB)
Sets the current rgb color while ignoring any potential alpha component within said color value. |
void |
setCurrentForm(Form f)
This method is used internally to determine the actual current form it doesn't perform the logic of transitions etc. and shouldn't be invoked by developers |
void |
setDisplayLock(java.lang.Object lock)
Installs the display lock allowing implementors to synchronize against the Display mutex, this method is invoked internally and should not be used. |
void |
setDragStartPercentage(int dragStartPercentage)
This method allows us to manipulate the drag started detection logic. |
void |
setLWUITGraphics(Graphics g)
Installs the LWUIT graphics object into the implementation |
long |
setMediaTime(java.lang.Object player,
long now)
Deprecated. replaced by the new video component |
void |
setNativeCommands(java.util.Vector commands)
Places the following commands on the native menu system |
abstract void |
setNativeFont(java.lang.Object graphics,
java.lang.Object font)
Installs a native font object |
void |
setVideoFullScreen(java.lang.Object player,
boolean fullscreen)
Deprecated. replaced by the new video component |
void |
setVideoFullScreen(VideoComponent v,
boolean fullscreen)
Toggles the fullscreen mode |
void |
setVideoLoopCount(java.lang.Object player,
int count)
Deprecated. replaced by the new video component |
void |
setVideoVisible(java.lang.Object vc,
boolean visible)
Deprecated. replaced by the new video component |
void |
setVolume(int vol)
Sets the media playback volume in percentage |
void |
shear(java.lang.Object nativeGraphics,
float x,
float y)
Shear the graphics coordinate system using the affine transform |
void |
showNativeScreen(java.lang.Object nativeFullScreenPeer)
Shows a native Form/Canvas or some other heavyweight native screen |
protected void |
showNotify()
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
protected void |
sizeChanged(int w,
int h)
Subclasses should invoke this method, it delegates the event to the display and into LWUIT. |
void |
startVideo(java.lang.Object player,
java.lang.Object videoControl)
Deprecated. replaced by the new video component |
void |
stopVideo(java.lang.Object player,
java.lang.Object videoControl)
Deprecated. replaced by the new video component |
abstract int |
stringWidth(java.lang.Object nativeFont,
java.lang.String str)
Return the width of the given string in this font instance |
void |
translate(java.lang.Object graphics,
int x,
int y)
Translates the X/Y location for drawing on the underlying surface. |
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 |
Constructor Detail |
---|
public LWUITImplementation()
Method Detail |
---|
public abstract void init(java.lang.Object m)
m
- the object passed to the Display init methodpublic void initEDT()
public void deinitialize()
public void playDialogSound(int type)
type
- the type of the dialog matching the dialog classes defined typespublic void vibrate(int duration)
duration
- length of time to vibratepublic void flashBacklight(int duration)
duration
- length of time to flash the backlightpublic abstract int getDisplayWidth()
public abstract int getDisplayHeight()
public boolean handleEDTException(java.lang.Throwable err)
err
- the exception that was caught in the EDT loop
public abstract 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 void saveTextEditingState()
public boolean hasPendingPaints()
public java.lang.Object getVideoControl(java.lang.Object player)
player
- the media player
public int numAlphaLevels()
public int numColors()
public Graphics getComponentScreenGraphics(Component cmp, Graphics currentContext)
cmp
- component being renderedcurrentContext
- the current graphics context
protected void paintOverlay(Graphics g)
g
- graphics context on which to draw the overlaypublic void paintDirty()
public void edtIdle(boolean enter)
enter
- true before the edt sleeps and false when exits from the
idle statepublic abstract void flushGraphics(int x, int y, int width, int height)
x
- position of the dirty regiony
- position of the dirty regionwidth
- width of the dirty regionheight
- height of the dirty regionpublic abstract void flushGraphics()
protected Graphics getLWUITGraphics()
public void setLWUITGraphics(Graphics g)
g
- graphics object for use by the implementationpublic void setDisplayLock(java.lang.Object lock)
lock
- the mutex from displaypublic java.lang.Object getDisplayLock()
public void cancelRepaint(Animation cmp)
cmp
- the component topublic void repaint(Animation cmp)
cmp
- component or animation to push into the paint queuepublic abstract void getRGB(java.lang.Object nativeImage, int[] arr, int offset, int x, int y, int width, int height)
nativeImage
- native platform image objectarr
- int array to store RGB dataoffset
- position within the array to startx
- x position within the imagey
- y position within the imagewidth
- width to extractheight
- height to extractpublic abstract java.lang.Object createImage(int[] rgb, int width, int height)
rgb
- ARGB data from which to create a platform imagewidth
- width for the resulting imageheight
- height for the resulting image
public abstract java.lang.Object createImage(java.lang.String path) throws java.io.IOException
path
- within the jar
java.io.IOException
- if thrown by loadingpublic abstract java.lang.Object createImage(java.io.InputStream i) throws java.io.IOException
i
- input stream from which to load the image
java.io.IOException
- if thrown by loadingpublic abstract java.lang.Object createMutableImage(int width, int height, int fillColor)
width
- the width of the mutable imageheight
- the height of the mutable imagefillColor
- the ARGB fill color, alpha may be ignored based on the value of
isAlphaMutableImageSupported
public boolean isAlphaMutableImageSupported()
public abstract java.lang.Object createImage(byte[] bytes, int offset, int len)
bytes
- the byte array representing the image dataoffset
- offset within the byte arraylen
- the length for the image within the byte array
public abstract int getImageWidth(java.lang.Object i)
i
- the native image
public abstract int getImageHeight(java.lang.Object i)
i
- the native image
public abstract java.lang.Object scale(java.lang.Object nativeImage, int width, int height)
nativeImage
- image to scalewidth
- width of the resulting imageheight
- height of the resulting image
public java.lang.Object rotate(java.lang.Object image, int degrees)
E.g. rotating an image to 45, 90 and 135 degrees is inefficient. Use rotatate to 45, 90 and then rotate the 45 to another 90 degrees to achieve the same effect with less memory.
degrees
- A degree in right angle must be larger than 0 and up to 359 degrees
public abstract int getSoftkeyCount()
public abstract int[] getSoftkeyCode(int index)
index
- the index of the softkey
public abstract int getClearKeyCode()
public abstract int getBackspaceKeyCode()
public abstract int getBackKeyCode()
public abstract int getGameAction(int keyCode)
keyCode
- the device keycode
public abstract int getKeyCode(int gameAction)
gameAction
- the game action
public abstract boolean isTouchDevice()
public void setCurrentForm(Form f)
f
- the current formpublic void confirmControlView()
public Form getCurrentForm()
public boolean isTranslationSupported()
public void translate(java.lang.Object graphics, int x, int y)
translate(-getTranslateX(), -getTranslateY())
graphics
- the graphics contextx
- the x coordinatey
- the y coordinatepublic int getTranslateX(java.lang.Object graphics)
graphics
- the graphics context
public int getTranslateY(java.lang.Object graphics)
graphics
- the graphics context
public abstract int getColor(java.lang.Object graphics)
graphics
- the graphics context
public abstract void setColor(java.lang.Object graphics, int RGB)
graphics
- the graphics contextRGB
- the RGB value for the color.public abstract void setAlpha(java.lang.Object graphics, int alpha)
graphics
- the graphics contextalpha
- the alpha channelpublic abstract int getAlpha(java.lang.Object graphics)
graphics
- the graphics context
public boolean isAlphaGlobal()
public boolean isAntiAliasingSupported()
public boolean isAntiAliasedTextSupported()
public void setAntiAliased(java.lang.Object graphics, boolean a)
graphics
- the graphics contexta
- true to activate Anti-aliasing, false to disable itpublic boolean isAntiAliased(java.lang.Object graphics)
graphics
- the graphics context
public void setAntiAliasedText(java.lang.Object graphics, boolean a)
graphics
- the graphics contexta
- true to activate Anti-aliasing, false to disable itpublic boolean isAntiAliasedText(java.lang.Object graphics)
graphics
- the graphics context
public abstract void setNativeFont(java.lang.Object graphics, java.lang.Object font)
graphics
- the graphics contextfont
- the native font objectpublic Rectangle getClipRect(java.lang.Object graphics)
graphics
- the graphics context
public abstract int getClipX(java.lang.Object graphics)
graphics
- the graphics context
public abstract int getClipY(java.lang.Object graphics)
graphics
- the graphics context
public abstract int getClipWidth(java.lang.Object graphics)
graphics
- the graphics context
public abstract int getClipHeight(java.lang.Object graphics)
graphics
- the graphics context
public void setClipRect(java.lang.Object graphics, Rectangle rect)
graphics
- the graphics contextrect
- rectangle representing the new clipping areapublic abstract void setClip(java.lang.Object graphics, int x, int y, int width, int height)
graphics
- the graphics contextx
- coordinatey
- coordinatewidth
- sizeheight
- sizerect
- rectangle representing the new clipping areapublic void clipRect(java.lang.Object graphics, Rectangle rect)
graphics
- the graphics contextrect
- rectangle representing the new clipping areapublic abstract void clipRect(java.lang.Object graphics, int x, int y, int width, int height)
graphics
- the graphics contextx
- coordinatey
- coordinatewidth
- sizeheight
- sizerect
- rectangle representing the new clipping areapublic abstract void drawLine(java.lang.Object graphics, int x1, int y1, int x2, int y2)
graphics
- the graphics contextx1
- first x positiony1
- first y positionx2
- second x positiony2
- second y positionpublic abstract void fillRect(java.lang.Object graphics, int x, int y, int width, int height)
graphics
- the graphics contextx
- the x coordinate of the rectangle to be filled.y
- the y coordinate of the rectangle to be filled.width
- the width of the rectangle to be filled.height
- the height of the rectangle to be filled.public abstract void drawRect(java.lang.Object graphics, int x, int y, int width, int height)
graphics
- the graphics contextx
- the x coordinate of the rectangle to be drawn.y
- the y coordinate of the rectangle to be drawn.width
- the width of the rectangle to be drawn.height
- the height of the rectangle to be drawn.public abstract void drawRoundRect(java.lang.Object graphics, int x, int y, int width, int height, int arcWidth, int arcHeight)
graphics
- the graphics contextx
- the x coordinate of the rectangle to be drawn.y
- the y coordinate of the rectangle to be drawn.width
- the width of the rectangle to be drawn.height
- the height of the rectangle to be drawn.arcWidth
- the horizontal diameter of the arc at the four corners.arcHeight
- the vertical diameter of the arc at the four corners.public abstract void fillRoundRect(java.lang.Object graphics, int x, int y, int width, int height, int arcWidth, int arcHeight)
graphics
- the graphics contextx
- the x coordinate of the rectangle to be filled.y
- the y coordinate of the rectangle to be filled.width
- the width of the rectangle to be filled.height
- the height of the rectangle to be filled.arcWidth
- the horizontal diameter of the arc at the four corners.arcHeight
- the vertical diameter of the arc at the four corners.drawRoundRect(java.lang.Object, int, int, int, int, int, int)
public abstract void fillArc(java.lang.Object graphics, int x, int y, int width, int height, int startAngle, int arcAngle)
graphics
- the graphics contextx
- the x coordinate of the upper-left corner of the arc to be filled.y
- the y coordinate of the upper-left corner of the arc to be filled.width
- the width of the arc to be filled.height
- the height of the arc to be filled.startAngle
- the beginning angle.arcAngle
- the angular extent of the arc, relative to the start angle.public abstract void drawArc(java.lang.Object graphics, int x, int y, int width, int height, int startAngle, int arcAngle)
graphics
- the graphics contextx
- the x coordinate of the upper-left corner of the arc to be drawn.y
- the y coordinate of the upper-left corner of the arc to be drawn.width
- the width of the arc to be drawn.height
- the height of the arc to be drawn.startAngle
- the beginning angle.arcAngle
- the angular extent of the arc, relative to the start angle.public abstract void drawString(java.lang.Object graphics, java.lang.String str, int x, int y)
graphics
- the graphics contextstr
- the string to be drawn.x
- the x coordinate.y
- the y coordinate.public abstract void drawImage(java.lang.Object graphics, java.lang.Object img, int x, int y)
graphics
- the graphics contextimg
- the specified native image to be drawnx
- the x coordinate.y
- the y coordinate.public void drawImage(java.lang.Object graphics, java.lang.Object img, int x, int y, int w, int h)
graphics
- the graphics contextimg
- the specified native image to be drawnx
- the x coordinate.y
- the y coordinate.w
- the widthh
- the heightpublic boolean isScaledImageDrawingSupported()
public void drawImageArea(java.lang.Object nativeGraphics, java.lang.Object img, int x, int y, int imageX, int imageY, int imageWidth, int imageHeight)
nativeGraphics
- the graphics contextimg
- the specified native image to be drawnx
- the x coordinate.y
- the y coordinate.imageX
- location within the image to drawimageY
- location within the image to drawimageWidth
- size of the location within the image to drawimageHeight
- size of the location within the image to drawpublic void drawImageRotated(java.lang.Object graphics, java.lang.Object img, int x, int y, int degrees)
graphics
- the graphics contextimg
- the specified native image to be drawnx
- the x coordinate.y
- the y coordinate.degrees
- either 0, 90, 180 or 270 degree rotation for the image drawingpublic boolean isRotationDrawingSupported()
public void fillTriangle(java.lang.Object graphics, int x1, int y1, int x2, int y2, int x3, int y3)
graphics
- the graphics contextx1
- the x coordinate of the first vertex of the triangley1
- the y coordinate of the first vertex of the trianglex2
- the x coordinate of the second vertex of the triangley2
- the y coordinate of the second vertex of the trianglex3
- the x coordinate of the third vertex of the triangley3
- the y coordinate of the third vertex of the trianglepublic abstract void drawRGB(java.lang.Object graphics, int[] rgbData, int offset, int x, int y, int w, int h, boolean processAlpha)
graphics
- the graphics contextrgbData
- an array of ARGB values in the format 0xAARRGGBBoffset
- the array index of the first ARGB valuex
- the horizontal location of the region to be renderedy
- the vertical location of the region to be renderedw
- the width of the region to be renderedh
- the height of the region to be renderedprocessAlpha
- true if rgbData has an alpha channel, false if
all pixels are fully opaquepublic abstract java.lang.Object getNativeGraphics()
public abstract java.lang.Object getNativeGraphics(java.lang.Object image)
image
- the native image on which the graphics will draw
public abstract int charsWidth(java.lang.Object nativeFont, char[] ch, int offset, int length)
nativeFont
- the font for which the string width should be calculatedch
- array of charactersoffset
- characters offsetslength
- characters length
public abstract int stringWidth(java.lang.Object nativeFont, java.lang.String str)
nativeFont
- the font for which the string width should be calculatedstr
- the given string *
public abstract int charWidth(java.lang.Object nativeFont, char ch)
nativeFont
- the font for which the string width should be calculatedch
- the specific character
public abstract int getHeight(java.lang.Object nativeFont)
nativeFont
- the font for which the string width should be calculated
public abstract java.lang.Object getDefaultFont()
public int getFace(java.lang.Object nativeFont)
nativeFont
- the font for which the string width should be calculated
public int getSize(java.lang.Object nativeFont)
nativeFont
- the font for which the string width should be calculated
public int getStyle(java.lang.Object nativeFont)
nativeFont
- the font for which the string width should be calculated
public abstract java.lang.Object createFont(int face, int style, int size)
face
- the face of the font, can be one of FACE_SYSTEM,
FACE_PROPORTIONAL, FACE_MONOSPACE.style
- the style of the font.
The value is an OR'ed combination of STYLE_BOLD, STYLE_ITALIC, and
STYLE_UNDERLINED; or the value is zero (STYLE_PLAIN).size
- the size of the font, can be one of SIZE_SMALL,
SIZE_MEDIUM, SIZE_LARGE
protected void keyPressed(int keyCode)
keyCode
- the key for the eventprotected void keyReleased(int keyCode)
keyCode
- the key for the eventprotected void pointerDragged(int x, int y)
x
- the position of the eventy
- the position of the eventprotected void pointerPressed(int x, int y)
x
- the position of the eventy
- the position of the eventprotected void pointerReleased(int x, int y)
x
- the position of the eventy
- the position of the eventprotected void pointerHover(int[] x, int[] y)
x
- the position of the eventy
- the position of the eventprotected void pointerHoverReleased(int[] x, int[] y)
x
- the position of the eventy
- the position of the eventprotected void pointerHoverReleased(int x, int y)
x
- the position of the eventy
- the position of the eventprotected void pointerHoverPressed(int[] x, int[] y)
x
- the position of the eventy
- the position of the eventprotected void pointerHoverPressed(int x, int y)
x
- the position of the eventy
- the position of the eventprotected void pointerHover(int x, int y)
x
- the position of the eventy
- the position of the eventprotected void pointerDragged(int[] x, int[] y)
x
- the position of the eventy
- the position of the eventprotected boolean hasDragStarted(int[] x, int[] y)
x
- the position of the current drag eventy
- the position of the current drag event
protected boolean hasDragStarted(int x, int y)
x
- the position of the current drag eventy
- the position of the current drag event
public int getDragStartPercentage()
public void setDragStartPercentage(int dragStartPercentage)
dragStartPercentage
- percentage of the screen required to initiate dragprotected int getDragAutoActivationThreshold()
protected void pointerPressed(int[] x, int[] y)
x
- the position of the eventy
- the position of the eventprotected void pointerReleased(int[] x, int[] y)
x
- the position of the eventy
- the position of the eventprotected void sizeChanged(int w, int h)
w
- the size of the screenh
- the size of the screenprotected void hideNotify()
w
- the size of the screenh
- the size of the screenprotected void showNotify()
w
- the size of the screenh
- the size of the screenpublic void fillRectRadialGradient(java.lang.Object graphics, int startColor, int endColor, int x, int y, int width, int height, float relativeX, float relativeY, float relativeSize)
graphics
- the graphics contextstartColor
- the starting RGB colorendColor
- the ending RGB colorx
- the x coordinatey
- the y coordinatewidth
- the width of the region to be filledheight
- the height of the region to be filledrelativeX
- indicates the relative position of the gradient within the drawing regionrelativeY
- indicates the relative position of the gradient within the drawing regionrelativeSize
- indicates the relative size of the gradient within the drawing regionpublic void fillRadialGradient(java.lang.Object graphics, int startColor, int endColor, int x, int y, int width, int height)
graphics
- the graphics contextstartColor
- the starting RGB colorendColor
- the ending RGB colorx
- the x coordinatey
- the y coordinatewidth
- the width of the region to be filledheight
- the height of the region to be filledpublic void fillLinearGradient(java.lang.Object graphics, int startColor, int endColor, int x, int y, int width, int height, boolean horizontal)
graphics
- the graphics contextstartColor
- the starting RGB colorendColor
- the ending RGB colorx
- the x coordinatey
- the y coordinatewidth
- the width of the region to be filledheight
- the height of the region to be filledhorizontal
- indicating wheter it is a horizontal fill or verticalpublic void fillPolygon(java.lang.Object graphics, int[] xPoints, int[] yPoints, int nPoints)
graphics
- the graphics contextxPoints
- - a an array of x coordinates.yPoints
- - a an array of y coordinates.nPoints
- - a the total number of points.public void drawPolygon(java.lang.Object graphics, int[] xPoints, int[] yPoints, int nPoints)
graphics
- the graphics contextxPoints
- - a an array of x coordinates.yPoints
- - a an array of y coordinates.nPoints
- - a the total number of points.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 boolean isNativeIndexed()
public java.lang.Object createNativeIndexed(IndexedImage image)
image
- the indexed image
public java.lang.Object createVideoComponent(java.lang.Object player)
player
- object responsible for playback lifecycle
public int getVideoWidth(java.lang.Object videoControl)
videoControl
- the control for the video
public int getVideoHeight(java.lang.Object videoControl)
videoControl
- the control for the video
public void setVideoVisible(java.lang.Object vc, boolean visible)
vc
- video control instancevisible
- whether the video is visiblepublic void startVideo(java.lang.Object player, java.lang.Object videoControl)
player
- the player objectvideoControl
- the video controlpublic void stopVideo(java.lang.Object player, java.lang.Object videoControl)
player
- the player objectvideoControl
- the video controlpublic void setVideoLoopCount(java.lang.Object player, int count)
player
- the player objectcount
- the number of times the media should looppublic long getMediaTime(java.lang.Object player)
player
- the player object
public long setMediaTime(java.lang.Object player, long now)
player
- the player objectnow
- the point in time to "Jump" to
public void setVideoFullScreen(java.lang.Object player, boolean fullscreen)
player
- the player objectfullscreen
- true for fullscreen modepublic void paintVideo(Component cmp, boolean fullScreen, java.lang.Object nativeGraphics, java.lang.Object video, java.lang.Object player)
cmp
- the media componentfullScreen
- indicates whether this is fullscreen or notnativeGraphics
- the native graphics objectvideo
- the native videoo controlplayer
- the native player objectpublic boolean isOpaque(Image lwuitImage, java.lang.Object nativeImage)
lwuitImage
- the lwuit imagenativeImage
- the image object to test
public boolean isAffineSupported()
public void resetAffine(java.lang.Object nativeGraphics)
nativeGraphics
- the native graphics objectpublic void scale(java.lang.Object nativeGraphics, float x, float y)
nativeGraphics
- the native graphics objectscale
- factor for xscale
- factor for ypublic void rotate(java.lang.Object nativeGraphics, float angle)
angle
- the rotation angle in radiansnativeGraphics
- the native graphics objectpublic void shear(java.lang.Object nativeGraphics, float x, float y)
shear
- factor for xshear
- factor for ynativeGraphics
- the native graphics objectpublic boolean isSVGSupported()
public java.lang.Object createSVGImage(java.lang.String baseURL, byte[] data) throws java.io.IOException
baseURL
- URL which is used to resolve relative references within the SVG filedata
- the conten of the SVG file
java.io.IOException
- if resource lookup fail SVG is unsupportedpublic java.lang.Object getSVGDocument(java.lang.Object svgImage)
svgImage
- the underlying image object
public boolean animateImage(java.lang.Object nativeImage, long lastFrame)
nativeImage
- a native image used within the image objectlastFrame
- the time the last frame of animation was shown
public java.lang.String[] getFontPlatformNames()
public java.lang.Object loadTrueTypeFont(java.io.InputStream stream) throws java.io.IOException
stream
- from which to load the font
java.io.IOException
- will be thrown in case of an io errorpublic boolean isTrueTypeSupported()
public java.lang.Object loadNativeFont(java.lang.String lookup)
lookup
- string describing the font
public boolean isLookupFontSupported()
public boolean minimizeApplication()
public void restoreMinimizedApplication()
public boolean isMinimized()
protected boolean cacheRadialGradients()
protected boolean cacheLinearGradients()
public boolean isThirdSoftButton()
Display.isThirdSoftButton()
,
com.sun.lwuit.Display#setThirdSoftButton()
public int getDragPathLength()
public int getDragPathTime()
public float getDragSpeed(float[] points, long[] dragPathTime, int dragPathOffset, int dragPathLength)
points
- array of locationsdragPathTime
- the time difference between each pointdragPathOffset
- the offset in the arraysdragPathLength
- 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 isRTLOrWhitespace(char c)
c
- character to test
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 boolean isAnimation(java.lang.Object nativeImage)
nativeImage
- underlying native imae
public PeerComponent createNativePeer(java.lang.Object nativeComponent)
nativeComponent
- a platform specific "native component"
public VideoComponent createVideoPeer(java.lang.String url) throws java.io.IOException
uri
- the platform specific location for the sound
java.io.IOException
- if the allocation failspublic VideoComponent createVideoPeer(java.io.InputStream stream, java.lang.String type) throws java.io.IOException
stream
- the stream containing the media datamimeType
- the type of the data in the stream
java.io.IOException
- if the allocation failspublic void setVideoFullScreen(VideoComponent v, boolean fullscreen)
v
- video componentfullscreen
- true for fullscreen modepublic void showNativeScreen(java.lang.Object nativeFullScreenPeer)
nativeFullScreenPeer
- the native screen peerpublic void setNativeCommands(java.util.Vector commands)
commands
- the LWUIT commands to usepublic void exitApplication()
public 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 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 soundprotected boolean playUserSound(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 sound
protected void playNativeBuiltinSound(java.lang.Object data)
data
- native data objectprotected java.lang.Object convertBuiltinSound(java.io.InputStream i) throws java.io.IOException
i
- stream containing a sound file
java.io.IOException
- thrown by the streampublic 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, 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 int getAudioTime(java.lang.Object handle)
handle
- the handle object returned by play audio
public void setAudioTime(java.lang.Object handle, int time)
handle
- the handle object returned by play audiotime
- in milli secondspublic int getAudioDuration(java.lang.Object handle)
handle
- the handle object returned by play audio
public void cleanupAudio(java.lang.Object handle)
handle
- the playback handlepublic 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 void notifyCommandBehavior(int commandBehavior)
commandBehavior
- see Display.COMMAND_BEHAVIOR...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 isNativeBrowserComponentSupported()
public PeerComponent createBrowserComponent(java.lang.Object browserComponent)
browserComponent
- instance of the browser component thru which events should be fired
public void setBrowserProperty(PeerComponent browserPeer, java.lang.String key, java.lang.Object value)
browserPeer
- browser instancekey
- see the documentation with the LWUIT Implementation for further detailsvalue
- see the documentation with the LWUIT Implementation for further detailspublic java.lang.String getBrowserTitle(PeerComponent browserPeer)
browserPeer
- browser instance
public java.lang.String getBrowserURL(PeerComponent browserPeer)
browserPeer
- browser instance
public void setBrowserURL(PeerComponent browserPeer, java.lang.String url)
browserPeer
- browser instanceurl
- the URLpublic void browserReload(PeerComponent browserPeer)
browserPeer
- browser instancepublic boolean browserHasBack(PeerComponent browserPeer)
browserPeer
- browser instance
public boolean browserHasForward(PeerComponent browserPeer)
browserPeer
- browser instance
public void browserBack(PeerComponent browserPeer)
browserPeer
- browser instancepublic void browserForward(PeerComponent browserPeer)
browserPeer
- browser instancepublic void browserClearHistory(PeerComponent browserPeer)
browserPeer
- browser instancepublic void setBrowserPage(PeerComponent browserPeer, java.lang.String html, java.lang.String baseUrl)
browserPeer
- browser instancehtml
- HTML web pagebaseUrl
- base URL to associate with the HTMLpublic void browserExecute(PeerComponent browserPeer, java.lang.String javaScript)
browserPeer
- browser instancejavaScript
- the JavaScript stringpublic void browserExposeInJavaScript(PeerComponent browserPeer, java.lang.Object o, java.lang.String name)
browserPeer
- browser instanceo
- the object to invoke, notice all public fields and methods would be exposed to JavaScriptname
- the name to expose within JavaScriptpublic int convertToPixels(int dipCount, boolean horizontal)
dipCount
- the dips that we will convert to pixelshorizontal
- indicates pixels in the horizontal plane
public boolean isTablet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |