de.enough.polish.ui
Class UiAccess

java.lang.Object
  extended by de.enough.polish.ui.UiAccess

public final class UiAccess
extends Object

Allows to access J2ME Polish specific features in a standard compliant way.

When a ScreenStateListener is registered with a screen, it will get notified when the screen changes its focus or another internal state (like changing a tab in the TabbedForm).

Copyright (c) Enough Software 2005 - 2009

 history
        31-Jan-2006 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
static int CONSTRAINT_FIXED_POINT_DECIMAL
          A constant for using the FIXED_POINT_DECIMAL constraint on TextFields.
static int DOWN_PRESSED
          The bit representing the DOWN key.
static int FIRE_PRESSED
          The bit representing the FIRE key.
static int GAME_A_PRESSED
          The bit representing the GAME_A key (may not be supported on all devices).
static int GAME_B_PRESSED
          The bit representing the GAME_B key (may not be supported on all devices).
static int GAME_C_PRESSED
          The bit representing the GAME_C key (may not be supported on all devices).
static int GAME_D_PRESSED
          The bit representing the GAME_D key (may not be supported on all devices).
static int LEFT_PRESSED
          The bit representing the LEFT key.
static int MODE_FIRST_UPPERCASE
          A constant for setting the input mode of an TextField to uppercase for the first character, followed by lowercase characters.
static int MODE_LOWERCASE
          A constant for setting the input mode of an TextField to lowercase.
static int MODE_NATIVE
          A constant for setting the input mode of an TextField to it't native input - that's useful for using T9 and similar input helpers.
static int MODE_NUMBERS
          A constant for setting the input mode of an TextField to numbers.
static int MODE_UPPERCASE
          A constant for setting the input mode of an TextField to uppercase.
static int RIGHT_PRESSED
          The bit representing the RIGHT key.
static int UP_PRESSED
          The bit representing the UP key.
 
Method Summary
static void addItemCommand(List list, int index, Command command)
          Adds a command to a list item.
static void addItemCommand(List list, int index, Command command)
          Adds a command to a list item.
static void addSubCommand(Command child, Command parent, Screen screen)
          Adds the given command as a subcommand to the defined screen.
static void addSubCommand(Command child, Command parent, Screen screen)
          Adds the given command as a subcommand to the defined screen.
static void addSubCommand(Command child, Command parent, Screen screen)
          Adds the given command as a subcommand to the defined screen.
static void addSubCommand(Command child, Command parent, Screen screen, Style style)
          Adds the given command as a subcommand to the defined screen.
static int append(Item item, Form form)
          Adds the specified (J2ME Polish) item to the given form.
static int append(Item item, Form form)
          Adds the specified (J2ME Polish) item to the given form.
static int append(Ticker ticker, Form form)
          Adds a ticker as a normal item to the specified form.
static void appendChoiceGroupItem(ChoiceGroup ChoiceGroup, ChoiceItem item)
          Appends a ChoiceItem or a subclass to the given ChoiceGroup.
static void appendChoiceGroupItem(ChoiceGroup ChoiceGroup, ChoiceItem item)
          Sets a ChoiceItem or a subclass for the given ChoiceGroup.
static void appendListItem(List list, ChoiceItem item)
          Sets a ChoiceItem or a subclass for the given list.
static void appendListItem(List list, ChoiceItem item)
          Sets a ChoiceItem or a subclass for the given list.
static Command cast(Command cmd)
          Casts the given MIDP command into a J2ME Polish command
static Command cast(Command cmd)
          Casts the given J2ME Polish command into a MIDP command
static CommandListener cast(CommandListener cmd)
          Casts the given MIDP CommandListener into a J2ME Polish CommandListener
static CommandListener cast(CommandListener cmd)
          Casts the given J2ME Polish CommandListener into a MIDP CommandListener
static Displayable cast(Displayable disp)
          Casts the given MIDP Displayable into a J2ME Polish Displayable
static Displayable cast(Displayable disp)
          Casts the given J2ME Polish Displayable into a MIDP Displayable
static Item cast(Item item)
          Casts the given LCDUI item into a J2ME Polish item
static Item cast(Item item)
          Casts the given J2ME Polish item into a LCDUI item
static Item[] cast(Item[] items)
          Casts the given LCDUI items into J2ME Polish items
static Item[] cast(Item[] items)
          Casts the given J2ME Polish items into a LCDUI items
static void defocus(Item item, Style style)
          Defocuses the given item and sets the style to the specified one.
static boolean delete(Form form, Item item)
          Deletes the specified item from the form
static boolean delete(Form form, Item item)
          Deletes the specified item from the form
static void emitGameActionPress(int gameAction)
          Simulates a keyPressed event.
static void emitGameActionRelease(int gameAction)
          Simulates a keyReleased event.
static void emitKeyPress(int keyCode)
          Simulates a keyPressed event.
static void emitKeyRelease(int keyCode)
          Simulates a keyReleased event.
static void emitKeyRepeated(int keyCode)
          Simulates a keyRepeated event.
static void enableScreenChangeAnimation(Screen screen, boolean enable)
          Enables or disables screen change animations for the specified screen
static void enableScreenChangeAnimation(Screen screen, boolean enable)
          Enables or disables screen change animations for the specified screen
static void enableScreenChangeAnimations(boolean enable)
          Enables or disables screen change animations
static void fireEvent(String name, Item item, Object data)
          Fires an event for the specified item and all its subitems.
static void fireEvent(String name, Item item, Object data)
          Fires an event for the specified item and all its subitems.
static void fireEvent(String name, Screen screen, Object data)
          Fires an event for the specified screen and all its components.
static void fireEvent(String name, Screen screen, Object data)
          Fires an event for the specified screen and all its components.
static void fireEventForTitleAndMenubar(String name, Screen screen, Object data)
          Fires an event for the title and menubar of the specified screen.
static void fireEventForTitleAndMenubar(String name, Screen screen, Object data)
          Fires an event for the title and menubar of the specified screen.
static void focus(ChoiceGroup choiceGroup, int index)
          Focuses the specified item on the given choice group.
static void focus(ChoiceGroup choiceGroup, int index)
          Focuses the specified item on the given choice group.
static Style focus(Item item, int direction, Style style)
          Focusses the given item with the specified style.
static void focus(Screen screen, int index)
          Focuses the specified item on the given screen.
static void focus(Screen screen, int index)
          Focuses the specified item on the given screen.
static void focus(Screen screen, Item item)
          Focuses the specified item on the given screen.
static void focus(Screen screen, Item item)
          Focuses the specified item on the given screen.
static void focus(Screen screen, Item item)
          Focuses the specified item on the given screen.
static void focus(Screen screen, Item item)
          Focuses the specified item on the given screen.
static Object getAttribute(Item item, Object key)
          Gets an previously added attribute of the specified item.
static Object getAttribute(Item item, Object key)
          Gets an previously added attribute of the specified item.
static Object getAttribute(List list, int index, Object key)
          Gets an previously added attribute of the specified item.
static Object getAttribute(List list, int index, Object key)
          Gets an previously added attribute of the specified item.
static HashMap getAttributes(Item item)
          Returns a HashMap object with all registered attributes.
static HashMap getAttributes(Item item)
          Returns a HashMap object with all registered attributes.
static HashMap getAttributes(List list, int index)
          Returns a HashMap object with all registered attributes.
static HashMap getAttributes(List list, int index)
          Returns a HashMap object with all registered attributes.
static Background getBackground(Item item)
          Retrieves the background of the given item.
static Background getBackground(Item item)
          Retrieves the background of the given item.
static Background getBackground(Screen screen)
          Retrieves the background of the given screen.
static Background getBackground(Screen screen)
          Retrieves the background of the given screen.
static ChoiceItem getChoiceGroupItem(ChoiceGroup ChoiceGroup, int index)
          Retrieves a ChoiceItem or a subclass for the given ChoiceGroup.
static ChoiceItem getChoiceGroupItem(ChoiceGroup ChoiceGroup, int index)
          Retrieves a ChoiceItem or a subclass for the given ChoiceGroup.
static CommandListener getCommandListener(Screen screen)
          Retrieves the command listener belonging to this screen.
static CommandListener getCommandListener(Screen screen)
          Retrieves the command listener belonging to this screen.
static int getContentHeight(Screen screen)
          Retrieves the vertical content width for the given screen.
static int getContentHeight(Screen screen)
          Retrieves the vertical content width for the given screen.
static int getContentWidth(Screen screen)
          Retrieves the horizontal content width for the given screen.
static int getContentWidth(Screen screen)
          Retrieves the horizontal content width for the given screen.
static int getContentX(Screen screen)
          Retrieves the horizontal content start for the given screen.
static int getContentX(Screen screen)
          Retrieves the horizontal content start for the given screen.
static int getContentY(Screen screen)
          Retrieves the vertical content start for the given screen.
static int getContentY(Screen screen)
          Retrieves the vertical content start for the given screen.
static Object getData(Screen screen)
          Retrieves screen specific data.
static Object getData(Screen screen)
          Retrieves screen specific data.
static String getDotSeparatedDecimalString(TextField field)
          Retrieves the decimal value entered with a dot as the decimal mark.
static String getDotSeparatedDecimalString(TextField field)
          Retrieves the decimal value entered with a dot as the decimal mark.
static int getFocusedIndex(ChoiceGroup group)
          Retrieves the currently focused item of the specified ChoiceGroup
static int getFocusedIndex(ChoiceGroup group)
          Retrieves the currently focused item of the specified ChoiceGroup
static int getFocusedIndex(Screen screen)
          Retrieves the focused index of the specified screen
static int getFocusedIndex(Screen screen)
          Retrieves the focused index of the specified screen
static Item getFocusedItem(Screen screen)
          Retrieves the focused index of the specified screen
static Item getFocusedItem(Screen screen)
          Retrieves the focused index of the specified screen
static int getInputMode(TextBox box)
          Retrieves the input mode for the given textbox.
static int getInputMode(TextBox box)
          Retrieves the input mode for the given textbox.
static int getInputMode(TextField field)
          Retrieves the input mode for the given textfield.
static int getInputMode(TextField field)
          Retrieves the input mode for the given textfield.
static int getInternalHeight(Item item)
          Retrieves the internal height of the given item.
static int getInternalHeight(Item item)
          Retrieves the internal height of the given item.
static int getInternalWidth(Item item)
          Retrieves the internal width of the given item.
static int getInternalWidth(Item item)
          Retrieves the internal width of the given item.
static int getInternalX(Item item)
          Retrieves the internal x position of the given item.
static int getInternalX(Item item)
          Retrieves the internal x position of the given item.
static int getInternalY(Item item)
          Retrieves the internal y position of the given item.
static int getInternalY(Item item)
          Retrieves the internal y position of the given item.
static int getKeyStates()
          Gets the states of the physical game keys.
static ChoiceItem getListItem(List list, int index)
          Retrieves a ChoiceItem or a subclass for the given list.
static ChoiceItem getListItem(List list, int index)
          Retrieves a ChoiceItem or a subclass for the given list.
static int getNumberOfDecimalFractions(TextField field)
          Retrieves the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields
static int getNumberOfDecimalFractions(TextField field)
          Retrieves the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields
static Object getPaintLock(Screen screen)
          Retrieves the lock object for the paint thread.
static Object getPaintLock(Screen screen)
          Retrieves the lock object for the paint thread.
static ArrayList getPredictiveMatchingWords(TextField field)
          Retrieves matching words for the specified textfield.
static ArrayList getPredictiveMatchingWords(TextField field)
          Retrieves matching words for the specified textfield.
static int[] getRgbData(Item item)
          Retrieves the RGB data of the specified item.
static int[] getRgbData(Item item)
          Retrieves the RGB data of the specified item.
static int[] getRgbData(Item item, int opacity)
          Retrieves the RGB data of the specified item.
static int[] getRgbData(Item item, int opacity)
          Retrieves the RGB data of the specified item.
static int[] getRgbDataOfContent(Item item)
          Retrieves the RGB data of the specified item's content without using a view-type/ItemView.
static int[] getRgbDataOfContent(Item item)
          Retrieves the RGB data of the specified item's content without using a view-type/ItemView.
static void getRgbDataOfContent(Item item, int[] rgbData, int x, int y, int width)
          Retrieves the RGB data of the specified item's content without using a view-type/ItemView.
static void getRgbDataOfContent(Item item, int[] rgbData, int x, int y, int width)
          Retrieves the RGB data of the specified item's content without using a view-type/ItemView.
static Container getScreenContainer(Screen screen)
          Retrieves the container of the screen.
static Container getScreenContainer(Screen screen)
          Retrieves the container of the screen.
static Style getStyle(Item item)
          Gets the current style of the given item.
static Style getStyle(Item item)
          Gets the current style of the given item.
static Style getStyle(Screen screen)
          Gets the current style of the given screen.
static Style getStyle(Screen screen)
          Gets the current style of the given screen.
static String getText(Item item)
          Retrieves text from a J2ME Polish item.
static String getText(Item item)
          Retrieves text from a J2ME Polish item.
static List getTextFieldSymbols()
          Initializes the symbols list and returns it
static int getTitleHeight(Screen screen)
          Determines the height of the title of the specified screen.
static int getTitleHeight(Screen screen)
          Determines the height of the title of the specified screen.
static Item getTitleItem(Screen screen)
          Retrieves the title of the specified screen as an Item
static Item getTitleItem(Screen screen)
          Retrieves the title of the specified screen as an Item
static UiEventListener getUiEventListener(Item item)
          Retrieves an UiEventListener for the specified item
static UiEventListener getUiEventListener(Item item)
          Retrieves an UiEventListener for the specified item
static UiEventListener getUiEventListener(Screen screen)
          Retrieves an UiEventListener for the specified screen and its items.
static UiEventListener getUiEventListener(Screen screen)
          Retrieves an UiEventListener for the specified screen and its items.
static boolean handleCommand(Item item, Command cmd)
          Asks the specified item to handle the command.
static boolean handleCommand(Item item, Command cmd)
          Asks the specified item to handle the command.
static boolean handleCommand(Screen screen, Command cmd)
          Asks the specified screen to handle the command.
static boolean handleCommand(Screen screen, Command cmd)
          Asks the specified screen to handle the command.
static boolean handleKeyPressed(Item item, int keyCode, int gameAction)
          Forwards a key event to the specified item.
static boolean handleKeyPressed(Item item, int keyCode, int gameAction)
          Forwards a key event to the specified item.
static boolean handleKeyPressed(Screen screen, int keyCode, int gameAction)
          Forwards a key event to the specified screen.
static boolean handleKeyPressed(Screen screen, int keyCode, int gameAction)
          Forwards a key event to the specified screen.
static boolean handleKeyReleased(Item item, int keyCode, int gameAction)
          Forwards a key event to the specified item.
static boolean handleKeyReleased(Item item, int keyCode, int gameAction)
          Forwards a key event to the specified item.
static boolean handleKeyReleased(Screen screen, int keyCode, int gameAction)
          Forwards a key event to the specified screen.
static boolean handleKeyReleased(Screen screen, int keyCode, int gameAction)
          Forwards a key event to the specified screen.
static boolean handleKeyRepeated(Item item, int keyCode, int gameAction)
          Forwards a key event to the specified item.
static boolean handleKeyRepeated(Item item, int keyCode, int gameAction)
          Forwards a key event to the specified item.
static boolean handleKeyRepeated(Screen screen, int keyCode, int gameAction)
          Forwards a key event to the specified screen.
static boolean handleKeyRepeated(Screen screen, int keyCode, int gameAction)
          Forwards a key event to the specified screen.
static boolean handlePointerDragged(Item item, int x, int y)
          Forwards a pointer event to the specified item.
static boolean handlePointerDragged(Item item, int x, int y)
          Forwards a pointer event to the specified item.
static boolean handlePointerPressed(Item item, int x, int y)
          Forwards a pointer event to the specified item.
static boolean handlePointerPressed(Item item, int x, int y)
          Forwards a pointer event to the specified item.
static boolean handlePointerPressed(Screen screen, int x, int y)
          Forwards a key event to the specified screen.
static boolean handlePointerPressed(Screen screen, int x, int y)
          Forwards a key event to the specified screen.
static boolean handlePointerReleased(Item item, int x, int y)
          Forwards a pointer event to the specified item.
static boolean handlePointerReleased(Item item, int x, int y)
          Forwards a pointer event to the specified item.
static boolean handlePointerReleased(Screen screen, int x, int y)
          Forwards a pointer event to the specified screen.
static boolean handlePointerReleased(Screen screen, int x, int y)
          Forwards a pointer event to the specified screen.
static void hideNotify(Item item)
          Calls hide notify on the specified item.
static void hideNotify(Item item)
          Calls hide notify on the specified item.
static int indexOf(Item item, Screen screen)
          Retrieves the index of the specified item in the screen.
static int indexOf(Item item, Screen screen)
          Retrieves the index of the specified item in the screen.
static int indexOf(Item item, Screen screen)
          Retrieves the index of the specified item in the screen.
static int indexOf(Item item, Screen screen)
          Retrieves the index of the specified item in the screen.
static void init(Item item, int firstLineWidth, int availWidth, int availHeight)
          Intializes the specified item with the specified dimensions
static void init(Item item, int firstLineWidth, int availWidth, int availHeight)
          Intializes the specified item with the specified dimensions
static void init(Screen screen)
          Intializes the specified screen
static boolean isGameActionFire(int keyCode, int gameAction, Screen screen)
          Determines whether the given key is really a Canvas.FIRE game action
static boolean isGameActionFire(int keyCode, int gameAction, Screen screen)
          Determines whether the given key is really a Canvas.FIRE game action
static boolean isMenuOpened(Screen screen)
          Checks whether the commands menu of the screen is currently opened.
static boolean isMenuOpened(Screen screen)
          Checks whether the commands menu of the screen is currently opened.
static boolean isSoftKey(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is a soft key for the given screen.
static boolean isSoftKey(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is a soft key for the given screen.
static boolean isSoftKey(int keyCode, Screen screen)
          Determines whether the given key code is a soft key for the given screen.
static boolean isSoftKey(int keyCode, Screen screen)
          Determines whether the given key code is the middle soft key for the given screen.
static boolean isSoftKeyLeft(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is the left soft key for the given screen.
static boolean isSoftKeyLeft(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is the left soft key for the given screen.
static boolean isSoftKeyLeft(int keyCode, Screen screen)
          Determines whether the given key code is the left soft key for the given screen.
static boolean isSoftKeyLeft(int keyCode, Screen screen)
          Determines whether the given key code is the left soft key for the given screen.
static boolean isSoftKeyMiddle(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is the middle soft key for the given screen.
static boolean isSoftKeyMiddle(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is the middle soft key for the given screen.
static boolean isSoftKeyMiddle(int keyCode, Screen screen)
          Determines whether the given key code is the middle soft key for the given screen.
static boolean isSoftKeyMiddle(int keyCode, Screen screen)
          Determines whether the given key code is the middle soft key for the given screen.
static boolean isSoftKeyRight(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is the right soft key for the given screen.
static boolean isSoftKeyRight(int keyCode, int gameAction, Screen screen)
          Determines whether the given key code is the right soft key for the given screen.
static boolean isSoftKeyRight(int keyCode, Screen screen)
          Determines whether the given key code is the right soft key for the given screen.
static boolean isSoftKeyRight(int keyCode, Screen screen)
          Determines whether the given key code is the right soft key for the given screen.
static boolean isVisible(Item item)
          Gets the visible status of the specified item.
static boolean isVisible(Item item)
          Gets the visible status of the specified item.
static boolean isVisible(List list, int index)
          Gets the visible status of the specified list-item.
static boolean isVisible(List list, int index)
          Gets the visible status of the specified list-item.
static void notifyItemPressedEnd(Item item)
          Makes the notifyItemPressedEnd method publicly available.
static void notifyItemPressedEnd(Item item)
          Makes the notifyItemPressedEnd method publicly available.
static void notifyItemPressedStart(Item item)
          Makes the notifyItemPressedStart method publicly available.
static void notifyItemPressedStart(Item item)
          Makes the notifyItemPressedStart method publicly available.
static void releaseResources()
          Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI.
static void releaseResources(Screen screen)
          Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI for the specified screen.
static void releaseResources(Screen screen)
          Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI for the specified screen.
static void releaseResourcesOnScreenChange()
          Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI when a non-J2ME Polish screen is shown.
static void removeAllCommands(Screen screen)
          Removes all commands from the given screen This option is only available when the "menu" fullscreen mode is activated.
static void removeAllCommands(Screen screen)
          Removes all commands from the given screen This option is only available when the "menu" fullscreen mode is activated.
static void removeSubCommand(Command childCommand, Command parentCommand, Screen screen)
          Removes the given command as subcommand from the defined screen
static void removeSubCommand(Command childCommand, Command parentCommand, Screen screen)
          Removes the given command as a subcommand from the defined screen
static void repaint(Item item)
          Repaints the specified item
static void repaint(Item item)
          Repaints the specified item
static void scroll(Screen screen, int yOffset)
          Scrolls the screen to the given position.
static void scroll(Screen screen, int yOffset)
          Scrolls the screen to the given position.
static void scrollTo(Item item)
          Scrolls the screen so that the specified item becomes visible.
static void scrollTo(Item item)
          Scrolls the screen so that the specified item becomes visible.
static void scrollTo(Item item, int position)
          Scrolls the screen so that the specified item will be position according to the specified position.
static void scrollTo(Item item, int position)
          Scrolls the screen so that the specified item will be position according to the specified position.
static void setAccessible(Choice choice, int itemIndex, boolean isAccessible)
          Makes the specified List or ChoiceGroup item selectable or inaccessible - can be used in combination with a #style preprocessing directive.
static void setAccessible(Choice choice, int itemIndex, boolean isAccessible)
          Makes the specified List item selectable or inaccessible - can be used in combination with a #style preprocessing directive.
static void setAccessible(Choice choice, int itemIndex, boolean isAccessible, Style style)
          Makes the specified List or ChoiceGroup item selectable or inaccessible.
static void setAccessible(Item item, boolean isAccessible)
          Makes the item interactive (accessible) or non-interactive.
static void setAccessible(Item item, boolean isAccessible)
          Makes the item interactive (accessible) or non-interactive.
static void setAccessible(Item item, boolean isAccessible, Style style)
          Makes the item interactive (accessible) or non-interactive.
static void setAccessible(Screen screen, Command command, boolean isAccessible)
          Makes the command interactive (accessible) or non-interactive.
static void setAccessible(Screen screen, Command command, boolean isAccessible)
          Makes the command interactive (accessible) or non-interactive.
static void setAccessible(Screen screen, Command command, boolean isAccessible)
          Makes the item interactive (accessible) or non-interactive.
static void setAccessible(Screen screen, Command command, boolean isAccessible, Style style)
          Makes the item interactive (accessible) or non-interactive.
static void setAttribute(Item item, Object key, Object value)
          Sets an arbitrary attribute for the given item.
static void setAttribute(Item item, Object key, Object value)
          Sets an arbitrary attribute for the given item.
static void setAttribute(List list, int index, Object key, Object value)
          Sets an arbitrary attribute for the specified list item.
static void setAttribute(List list, int index, Object key, Object value)
          Sets an arbitrary attribute for the specified list item.
static void setBackground(Item item, Background background)
          Sets the background for the given item.
static void setBackground(Item item, Background background)
          Sets the background for the given item.
static void setBackground(Screen screen, Background background)
          Sets the background for the given screen.
static void setBackground(Screen screen, Background background)
          Sets the background for the given screen.
static void setCaretPosition(TextBox box, int position)
          Sets the caret position in the given text box.
static void setCaretPosition(TextBox box, int position)
          Sets the caret position in the given text box.
static void setCaretPosition(TextField field, int position)
          Sets the caret position in the given text field.
static void setCaretPosition(TextField field, int position)
          Sets the caret position in the given text field.
static void setChoiceGroupItem(ChoiceGroup ChoiceGroup, int index, ChoiceItem item)
          Sets a ChoiceItem or a subclass for the given ChoiceGroup.
static void setChoiceGroupItem(ChoiceGroup ChoiceGroup, int index, ChoiceItem item)
          Sets a ChoiceItem or a subclass for the given ChoiceGroup.
static void setCommandLabel(Command command, String label)
          Changes the shown label of the specified command.
static void setCommandLabel(Screen screen, Command command, String label)
          Changes the shown label of the specified command.
static void setCommandLabel(Screen screen, Command command, String label)
          Changes the shown label of the specified command.
static void setCommandLabel(Screen screen, Command command, String label)
          Changes the shown label of the specified command.
static void setCurrentListIndex(Display display, List list, int index)
          Sets the focus to the given index of the specified list.
static void setCurrentListIndex(Display display, List list, int index)
          Sets the focus to the given index of the specified list.
static void setCycling(Container container, boolean cycling)
          Specifies if the given contain is allowed to cycle through its items.
static void setCycling(FramedForm form, boolean cycling)
          Specifies if the given FramedForm is allowed to cycle through its items.
static void setData(Screen screen, Object data)
          Attaches data to the specified screen.
static void setData(Screen screen, Object data)
          Attaches data to the specified screen.
 void setEventHandled(CustomItem item)
          Notifies the specified CustomItem that a key or pointer event has been processed and that it should not be processed by other components.
 void setEventHandled(CustomItem item)
          Notifies the specified CustomItem that a key or pointer event has been processed and that it should not be processed by other components.
static void setFocusedIndex(Screen screen, int index)
          Sets the focused index of the specified screen
static void setFocusedIndex(Screen screen, int index)
          Sets the focused index of the specified screen
static void setFocusedItem(Screen screen, Item item)
          Sets the focused item of the specified screen
static void setFocusedItem(Screen screen, Item item)
          Sets the focused item of the specified screen
static void setFullScreenMode(Screen screen, boolean fullScreen)
          Sets the fullscreen mode of the screen.
static void setFullScreenMode(Screen screen, boolean fullScreen)
          Sets the fullscreen mode of the screen.
static void setInputMode(TextBox box, int inputMode)
          Sets the input mode for the given textbox.
static void setInputMode(TextBox box, int inputMode)
          Sets the input mode for the given textbox.
static void setInputMode(TextField field, int inputMode)
          Sets the input mode for the given textfield.
static void setInputMode(TextField field, int inputMode)
          Sets the input mode for the given textfield.
static void setItemScreen(Item item, Screen screen)
          Sets the 'screen' property of the specified item to the given item
static void setItemScreen(Item item, Screen screen)
          Sets the 'screen' property of the specified item to the given item
static void setItemStateListener(Item item, ItemStateListener listener)
          Sets an ItemStateListener specifically for this item.
static void setItemStateListener(Item item, ItemStateListener listener)
          Sets an ItemStateListener specifically for this item.
static void setListItem(List list, int index, ChoiceItem item)
          Sets a ChoiceItem or a subclass for the given list.
static void setListItem(List list, int index, ChoiceItem item)
          Sets a ChoiceItem or a subclass for the given list.
static void setMenuBarStyle(Screen screen)
          Set the style of the specified screen's menubar.
static void setMenuBarStyle(Screen screen)
          Set the style of the specified screen's menubar.
static void setMenuBarStyle(Screen screen, Style style)
          Set the style of the specified screen's menubar.
static void setMenuBarStyle(Screen screen, Style style)
          Set the style of the specified screen's menubar.
static void setNoNewLine(TextField textField, boolean noNewLine)
          Set if the textfield should accept the enter key as an input which results in a new line.
static void setNoNewLine(TextField textField, boolean noNewLine)
          Set if the textfield should accept the enter key as an input which results in a new line.
static void setNumberOfDecimalFractions(TextField field, int number)
          Sets the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields
static void setNumberOfDecimalFractions(TextField field, int number)
          Sets the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields
static void setParent(Item child, Item parent)
          Sets the parent for the given child item.
static void setParent(Item child, Item parent)
          Sets the parent for the given child item.
static void setParent(Item child, Item parent)
          Sets the parent for the given child item.
static void setPredictiveDictionary(TextField field, String[] words)
          Allows the given words for the specified textfield.
static void setPredictiveDictionary(TextField field, String[] words)
          Allows the given words for the specified textfield.
static void setScreenOrientation(int degrees)
          Sets the screen orientation in 90 degrees steps.
static void setScreenOrientation(Screen screen, int degrees)
          Deprecated. use setScreenOrientation(int degress) instead
static void setScreenOrientation(Screen screen, int degrees)
          Deprecated. use setScreenOrientation(int degress) instead
static void setScreenStateListener(Screen screen, ScreenStateListener listener)
          Registers a ScreenStateListener to any J2ME Polish screen.
static void setScreenStateListener(Screen screen, ScreenStateListener listener)
          Registers a ScreenStateListener to any J2ME Polish screen.
static void setStyle(Alert screen)
          Applies a style to the given alert if used in conjunction with the //#style preprocessing directive.
static void setStyle(Alert screen, Style style)
          Applies a style to the given alert if used in conjunction with the //#style preprocessing directive.
static void setStyle(Command command)
          Applies a style to the specified command.
static void setStyle(Item item)
          Applies a style to the given item if used in conjunction with the //#style preprocessing directive.
static void setStyle(Item item)
          Applies a style to the given item if used in conjunction with the //#style preprocessing directive.
static void setStyle(Item item, Style style)
          Applies a style to the given item if used in conjunction with the //#style preprocessing directive.
static void setStyle(Item item, Style style)
          Applies a style to the given item.
static void setStyle(List list, int itemIndex)
          Applies a style to the specified list item.
static void setStyle(List list, int itemIndex)
          Applies a style to the specified list item.
static void setStyle(List list, int itemIndex, Style style)
          Applies a style to the specified list item.
static void setStyle(Screen screen)
          Applies a style to the given screen if used in conjunction with the //#style preprocessing directive.
static void setStyle(Screen screen)
          Applies a style to the given screen if used in conjunction with the //#style preprocessing directive.
static void setStyle(Screen screen, Style style)
          Applies a style to the given screen.
static void setSubtitle(Screen screen, Item subtitle)
          Sets the subtitle for the specified screen
static void setSubtitle(Screen screen, Item subtitle)
          Sets the subtitle for the specified screen
static void setSubtitle(Screen screen, String subtitle)
          Sets the subtitle for the specified screen
static void setSubtitle(Screen screen, String subtitle)
          Sets the subtitle for the specified screen
static void setSubtitle(Screen screen, String subtitle, Style style)
          Sets the subtitle for the specified screen
static void setSubtitle(Screen screen, String subtitle, Style style)
          Sets the subtitle for the specified screen
static void setSuppressCommands(TextField field, boolean suppress)
          Can be used to deactivate or activate commands for a specific TextField.
static void setSuppressCommands(TextField field, boolean suppress)
          Can be used to deactivate or activate commands for a specific TextField.
static void setTextEffect(StringItem item, TextEffect effect)
          Specifies a new text effect for the specified string item.
static void setTextEffect(StringItem item, TextEffect effect)
          Specifies a new text effect for the specified string item.
static void setTextfieldHelp(TextField field, String text)
          Sets the help text for the specified TextField.
static void setTextfieldHelp(TextField field, String text)
          Sets the help text for the specified TextField.
static void setTextfieldInfo(TextField field, String info)
           
static void setTextfieldInfo(TextField field, String info)
           
static void setTextfieldInfoItem(TextField field, StringItem infoItem)
          Sets the item responsible for displaying the current input mode like Abc, ABC, 123, and so on.
static void setTextfieldInfoItem(TextField field, StringItem infoItem)
          Sets the item responsible for displaying the current input mode like Abc, ABC, 123, and so on.
static void setTickerImage(Ticker ticker, Image image)
          Sets an image for the specified ticker.
static void setTickerImage(Ticker ticker, Image image)
          Sets an image for the specified ticker.
static void setTitle(Screen screen, Item title)
          Sets the title of the screen using an Item.
static void setTitle(Screen screen, Item title)
          Sets the title of the screen using an Item.
static void setTitle(Screen screen, Item title)
          Sets the title of the screen using an Item.
static void setTitle(Screen screen, Item title)
           
static void setTitle(Screen screen, Item title, Style style)
          Sets the title of the screen using an Item.
static void setTitle(Screen screen, Item title, Style style)
          Sets the title of the screen using an Item.
static void setUiEventListener(Item item, UiEventListener listener)
          Sets an UiEventListener for the specified item and its children.
static void setUiEventListener(Item item, UiEventListener listener)
          Sets an UiEventListener for the specified item and its children.
static void setUiEventListener(Screen screen, UiEventListener listener)
          Sets an UiEventListener for the specified screen and its items.
static void setUiEventListener(Screen screen, UiEventListener listener)
          Sets an UiEventListener for the specified screen and its items.
static void setUserInputValidator(Display.UserInputValidator validator)
          Sets the key validator for the current display.
static void setVisible(Item item, boolean visible)
          Sets the invisible status of the specified item.
static void setVisible(Item item, boolean visible)
          Sets the visible status of the specified item.
static void setVisible(List list, int index, boolean visible)
          Sets the invisible status of the specified list-item.
static void setVisible(List list, int index, boolean visible)
          Sets the invisible status of the specified list-item.
static void setWordNotFound(TextField field, Alert alert)
          Set the word-not-found box in the textfield
static void setWordNotFound(TextField field, Alert alert)
          Set the word-not-found box in the textfield
static void showNotify(Item item)
          Calls show notify on the specified item.
static void showNotify(Item item)
          Calls show notify on the specified item.
static void showNotify(Screen screen, Item item)
          Calls show notify on the specified item.
static void showNotify(Screen screen, Item item)
          Calls show notify on the specified item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UP_PRESSED

public static final int UP_PRESSED
The bit representing the UP key. This constant has a value of 0x0002 (1 << Canvas.UP).

See Also:
getKeyStates(), Constant Field Values

DOWN_PRESSED

public static final int DOWN_PRESSED
The bit representing the DOWN key. This constant has a value of 0x0040 (1 << Canvas.DOWN).

See Also:
getKeyStates(), Constant Field Values

LEFT_PRESSED

public static final int LEFT_PRESSED
The bit representing the LEFT key. This constant has a value of 0x0004 (1 << Canvas.LEFT).

See Also:
getKeyStates(), Constant Field Values

RIGHT_PRESSED

public static final int RIGHT_PRESSED
The bit representing the RIGHT key. This constant has a value of 0x0020 (1 << Canvas.RIGHT).

See Also:
getKeyStates(), Constant Field Values

FIRE_PRESSED

public static final int FIRE_PRESSED
The bit representing the FIRE key. This constant has a value of 0x0100 (1 << Canvas.FIRE).

See Also:
getKeyStates(), Constant Field Values

GAME_A_PRESSED

public static final int GAME_A_PRESSED
The bit representing the GAME_A key (may not be supported on all devices). This constant has a value of 0x0200 (1 << Canvas.GAME_A).

See Also:
getKeyStates(), Constant Field Values

GAME_B_PRESSED

public static final int GAME_B_PRESSED
The bit representing the GAME_B key (may not be supported on all devices). This constant has a value of 0x0400 (1 << Canvas.GAME_B).

See Also:
getKeyStates(), Constant Field Values

GAME_C_PRESSED

public static final int GAME_C_PRESSED
The bit representing the GAME_C key (may not be supported on all devices). This constant has a value of 0x0800 (1 << Canvas.GAME_C).

See Also:
getKeyStates(), Constant Field Values

GAME_D_PRESSED

public static final int GAME_D_PRESSED
The bit representing the GAME_D key (may not be supported on all devices). This constant has a value of 0x1000 (1 << Canvas.GAME_D).

See Also:
getKeyStates(), Constant Field Values

MODE_LOWERCASE

public static final int MODE_LOWERCASE
A constant for setting the input mode of an TextField to lowercase.

See Also:
setInputMode(javax.microedition.lcdui.TextField, int), Constant Field Values

MODE_FIRST_UPPERCASE

public static final int MODE_FIRST_UPPERCASE
A constant for setting the input mode of an TextField to uppercase for the first character, followed by lowercase characters.

See Also:
setInputMode(javax.microedition.lcdui.TextField, int), Constant Field Values

MODE_UPPERCASE

public static final int MODE_UPPERCASE
A constant for setting the input mode of an TextField to uppercase.

See Also:
setInputMode(javax.microedition.lcdui.TextField, int), Constant Field Values

MODE_NUMBERS

public static final int MODE_NUMBERS
A constant for setting the input mode of an TextField to numbers.

See Also:
setInputMode(javax.microedition.lcdui.TextField, int), Constant Field Values

MODE_NATIVE

public static final int MODE_NATIVE
A constant for setting the input mode of an TextField to it't native input - that's useful for using T9 and similar input helpers.

See Also:
setInputMode(javax.microedition.lcdui.TextField, int), Constant Field Values

CONSTRAINT_FIXED_POINT_DECIMAL

public static final int CONSTRAINT_FIXED_POINT_DECIMAL
A constant for using the FIXED_POINT_DECIMAL constraint on TextFields. Sample usage:
 TextField cashRegister = new TextField("Price: ",  null, 5, UiAccess.CONSTRAINT_FIXED_POINT_DECIMAL );
 

See Also:
TextField.FIXED_POINT_DECIMAL, setNumberOfDecimalFractions(TextField, int), getNumberOfDecimalFractions(TextField), Constant Field Values
Method Detail

getKeyStates

public static int getKeyStates()
Gets the states of the physical game keys. Each bit in the returned integer represents a specific key on the device. A key's bit will be 1 if the key is currently down or has been pressed at least once since the last time this method was called. The bit will be 0 if the key is currently up and has not been pressed at all since the last time this method was called. This latching behavior ensures that a rapid key press and release will always be caught by an application loop, regardless of how slowly the loop runs.

For example:

 
 // Get the key state and store it
 int keyState = getKeyStates();
 if ((keyState & UiAccess.LEFT_KEY) != 0) {
                positionX--;
 }
 else if ((keyState & UiAccess.RIGHT_KEY) != 0) {
                positionX++;
 }
 
 

Calling this method has the side effect of clearing any latched state. Another call to getKeyStates immediately after a prior call will therefore report the system's best idea of the current state of the keys, the latched bits having been cleared by the first call.

On J2ME Polish this method is implemented by monitoring key press and release events. Thus the state reported by getKeyStates might lag the actual state of the physical keys since the timeliness of the key information is be subject to the capabilities of each device. Also, some devices may be incapable of detecting simultaneous presses of multiple keys.

This method returns 0 unless the GameCanvas is currently visible as reported by Displayable.isShown(). Upon becoming visible, a GameCanvas will initially indicate that all keys are unpressed (0); if a key is held down while the GameCanvas is being shown, the key must be first released and then pressed in order for the key press to be reported by the GameCanvas.

Returns:
An integer containing the key state information (one bit per key), or 0 if the J2ME Polish is not used or there is no current screen
See Also:
UP_PRESSED, DOWN_PRESSED, LEFT_PRESSED, RIGHT_PRESSED, FIRE_PRESSED, GAME_A_PRESSED, GAME_B_PRESSED, GAME_C_PRESSED, GAME_D_PRESSED

setScreenStateListener

public static void setScreenStateListener(Screen screen,
                                          ScreenStateListener listener)
Registers a ScreenStateListener to any J2ME Polish screen.

Parameters:
screen - the screen
listener - the listener

setScreenStateListener

public static void setScreenStateListener(Screen screen,
                                          ScreenStateListener listener)
Registers a ScreenStateListener to any J2ME Polish screen.

Parameters:
screen - the screen
listener - the listener

getFocusedIndex

public static int getFocusedIndex(Screen screen)
Retrieves the focused index of the specified screen

Parameters:
screen - the screen
Returns:
the focused index, -1 when it is not known

getFocusedIndex

public static int getFocusedIndex(Screen screen)
Retrieves the focused index of the specified screen

Parameters:
screen - the screen
Returns:
the focused index, -1 when it is not known

getFocusedIndex

public static int getFocusedIndex(ChoiceGroup group)
Retrieves the currently focused item of the specified ChoiceGroup

Parameters:
group - the group
Returns:
the index of the currently focused item, -1 if none is focused

getFocusedIndex

public static int getFocusedIndex(ChoiceGroup group)
Retrieves the currently focused item of the specified ChoiceGroup

Parameters:
group - the group
Returns:
the index of the currently focused item, -1 if none is focused

getFocusedItem

public static Item getFocusedItem(Screen screen)
Retrieves the focused index of the specified screen

Parameters:
screen - the screen
Returns:
the focused item, null when it is not known

getFocusedItem

public static Item getFocusedItem(Screen screen)
Retrieves the focused index of the specified screen

Parameters:
screen - the screen
Returns:
the focused item, null when it is not known

setFocusedIndex

public static void setFocusedIndex(Screen screen,
                                   int index)
Sets the focused index of the specified screen

Parameters:
screen - the screen
index - the focused index, -1 when none should be focused

setFocusedIndex

public static void setFocusedIndex(Screen screen,
                                   int index)
Sets the focused index of the specified screen

Parameters:
screen - the screen
index - the focused index, -1 when none should be focused

setFocusedItem

public static void setFocusedItem(Screen screen,
                                  Item item)
Sets the focused item of the specified screen

Parameters:
screen - the screen
item - the focused item, null when none should be focused

setFocusedItem

public static void setFocusedItem(Screen screen,
                                  Item item)
Sets the focused item of the specified screen

Parameters:
screen - the screen
item - the focused item, null when none should be focused

setTitle

public static void setTitle(Screen screen,
                            Item title)
Sets the title of the screen using an Item. important: you cannot call screen.setTitle(String) afterwards anymore!

Parameters:
screen - the screen for which the title should be replaced
title - the element responsible for painting the title.
See Also:
getTitleItem(javax.microedition.lcdui.Screen)

setTitle

public static void setTitle(Screen screen,
                            Item title)
Sets the title of the screen using an Item. important: you cannot call screen.setTitle(String) afterwards anymore!

Parameters:
screen - the screen for which the title should be replaced
title - the element responsible for painting the title.
See Also:
getTitleItem(Screen)

setTitle

public static void setTitle(Screen screen,
                            Item title,
                            Style style)
Sets the title of the screen using an Item. important: you cannot call screen.setTitle(String) afterwards anymore! This method is meant to be used in conjunction with the //#style preprocessing directive.

Parameters:
screen - the screen for which the title should be replaced
title - the element responsible for painting the title.
style - the style for the title
See Also:
getTitleItem(Screen)

setTitle

public static void setTitle(Screen screen,
                            Item title)
Sets the title of the screen using an Item. important: you cannot call screen.setTitle(String) afterwards anymore!

Parameters:
screen - the screen for which the title should be replaced
title - the element responsible for painting the title.
See Also:
getTitleItem(javax.microedition.lcdui.Screen)

setTitle

public static void setTitle(Screen screen,
                            Item title)

setTitle

public static void setTitle(Screen screen,
                            Item title,
                            Style style)
Sets the title of the screen using an Item. important: you cannot call screen.setTitle(String) afterwards anymore! This method is meant to be used in conjunction with the //#style preprocessing directive.

Parameters:
screen - the screen for which the title should be replaced
title - the element responsible for painting the title.
style - the style for the title
See Also:
getTitleItem(javax.microedition.lcdui.Screen)

setFullScreenMode

public static void setFullScreenMode(Screen screen,
                                     boolean fullScreen)
Sets the fullscreen mode of the screen. The title and the menubar will be hidden by this call.

Parameters:
screen - the screen
fullScreen - true when the fullscreen mode should be entered

setFullScreenMode

public static void setFullScreenMode(Screen screen,
                                     boolean fullScreen)
Sets the fullscreen mode of the screen. The title and the menubar will be hidden by this call.

Parameters:
screen - the screen
fullScreen - true when the fullscreen mode should be entered

addItemCommand

public static void addItemCommand(List list,
                                  int index,
                                  Command command)
Adds a command to a list item. Warning: this method won't add any commands when the J2ME Polish GUI is not activated.

Parameters:
list - the list
index - the index of the item
command - the item command

addItemCommand

public static void addItemCommand(List list,
                                  int index,
                                  Command command)
Adds a command to a list item. Warning: this method won't add any commands when the J2ME Polish GUI is not activated.

Parameters:
list - the list
index - the index of the item
command - the item command

setParent

public static void setParent(Item child,
                             Item parent)
Sets the parent for the given child item.

Parameters:
child - the child
parent - the parent

setParent

public static void setParent(Item child,
                             Item parent)
Sets the parent for the given child item.

Parameters:
child - the child
parent - the parent

setParent

public static void setParent(Item child,
                             Item parent)
Sets the parent for the given child item.

Parameters:
child - the child
parent - the parent

getInternalX

public static int getInternalX(Item item)
Retrieves the internal x position of the given item. When it is equal -9999 this item's internal position is not known. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal x position of this item's currently selected content, -9999 when it is unknown.

getInternalY

public static int getInternalY(Item item)
Retrieves the internal y position of the given item. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal y position of this item's currently selected content.
See Also:
getInternalX(javax.microedition.lcdui.Item)

getInternalWidth

public static int getInternalWidth(Item item)
Retrieves the internal width of the given item. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal width of this item's currently selected content.
See Also:
getInternalX(javax.microedition.lcdui.Item)

getInternalHeight

public static int getInternalHeight(Item item)
Retrieves the internal height of the given item. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal height of this item's currently selected content.
See Also:
getInternalX(javax.microedition.lcdui.Item)

getInternalX

public static int getInternalX(Item item)
Retrieves the internal x position of the given item. When it is equal Item.NO_POSITION_SET / -9999 this item's internal position is not known. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal x position of this item's currently selected content, -9999 / Item.NO_POSITION_SET when it is unknown.

getInternalY

public static int getInternalY(Item item)
Retrieves the internal y position of the given item. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal y position of this item's currently selected content.
See Also:
getInternalX(Item)

getInternalWidth

public static int getInternalWidth(Item item)
Retrieves the internal width of the given item. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal width of this item's currently selected content.
See Also:
getInternalX(Item)

getInternalHeight

public static int getInternalHeight(Item item)
Retrieves the internal height of the given item. The internal position is useful for items that have a large content which needs to be scrolled, e.g. containers.

Parameters:
item - the item
Returns:
the internal height of this item's currently selected content.
See Also:
getInternalX(Item)

focus

public static Style focus(Item item,
                          int direction,
                          Style style)
Focusses the given item with the specified style.

Parameters:
item - the item that should be focussed
direction - the direction from which the focus comes, e.g. Canvas.DOWN, Canvas.UP or 0.
style - the style - use null when the item's focussed style should be used
Returns:
the previously assigned style of that item

defocus

public static void defocus(Item item,
                           Style style)
Defocuses the given item and sets the style to the specified one.

Parameters:
item - the item
style - the style

setCurrentListIndex

public static void setCurrentListIndex(Display display,
                                       List list,
                                       int index)
Sets the focus to the given index of the specified list. When the list is not shown, it will be shown in this call. When the J2ME Polish GUI is not used, only the list will be shown.

Parameters:
display - the display
list - the list
index - the index

setCurrentListIndex

public static void setCurrentListIndex(Display display,
                                       List list,
                                       int index)
Sets the focus to the given index of the specified list. When the list is not shown, it will be shown in this call. When the J2ME Polish GUI is not used, only the list will be shown.

Parameters:
display - the display
list - the list
index - the index

setListItem

public static void setListItem(List list,
                               int index,
                               ChoiceItem item)
Sets a ChoiceItem or a subclass for the given list.

Parameters:
list - the list
index - the index of the item that should be exchanged
item - the new item

getListItem

public static ChoiceItem getListItem(List list,
                                     int index)
Retrieves a ChoiceItem or a subclass for the given list.

Parameters:
list - the list
index - the index of the item that should be returned
Returns:
the item at the given position

appendListItem

public static void appendListItem(List list,
                                  ChoiceItem item)
Sets a ChoiceItem or a subclass for the given list.

Parameters:
list - the list
item - the new item

setListItem

public static void setListItem(List list,
                               int index,
                               ChoiceItem item)
Sets a ChoiceItem or a subclass for the given list.

Parameters:
list - the list
index - the index of the item that should be exchanged
item - the new item

getListItem

public static ChoiceItem getListItem(List list,
                                     int index)
Retrieves a ChoiceItem or a subclass for the given list.

Parameters:
list - the list
index - the index of the item that should be returned
Returns:
the item at the given position

appendListItem

public static void appendListItem(List list,
                                  ChoiceItem item)
Sets a ChoiceItem or a subclass for the given list.

Parameters:
list - the list
item - the new item

setChoiceGroupItem

public static void setChoiceGroupItem(ChoiceGroup ChoiceGroup,
                                      int index,
                                      ChoiceItem item)
Sets a ChoiceItem or a subclass for the given ChoiceGroup.

Parameters:
ChoiceGroup - the ChoiceGroup
index - the index of the item that should be exchanged
item - the new item

getChoiceGroupItem

public static ChoiceItem getChoiceGroupItem(ChoiceGroup ChoiceGroup,
                                            int index)
Retrieves a ChoiceItem or a subclass for the given ChoiceGroup.

Parameters:
ChoiceGroup - the ChoiceGroup
index - the index of the item that should be returned
Returns:
the item at the given position

appendChoiceGroupItem

public static void appendChoiceGroupItem(ChoiceGroup ChoiceGroup,
                                         ChoiceItem item)
Appends a ChoiceItem or a subclass to the given ChoiceGroup.

Parameters:
ChoiceGroup - the ChoiceGroup
item - the new item

setChoiceGroupItem

public static void setChoiceGroupItem(ChoiceGroup ChoiceGroup,
                                      int index,
                                      ChoiceItem item)
Sets a ChoiceItem or a subclass for the given ChoiceGroup.

Parameters:
ChoiceGroup - the ChoiceGroup
index - the index of the item that should be exchanged
item - the new item

getChoiceGroupItem

public static ChoiceItem getChoiceGroupItem(ChoiceGroup ChoiceGroup,
                                            int index)
Retrieves a ChoiceItem or a subclass for the given ChoiceGroup.

Parameters:
ChoiceGroup - the ChoiceGroup
index - the index of the item that should be returned
Returns:
the item at the given position

appendChoiceGroupItem

public static void appendChoiceGroupItem(ChoiceGroup ChoiceGroup,
                                         ChoiceItem item)
Sets a ChoiceItem or a subclass for the given ChoiceGroup.

Parameters:
ChoiceGroup - the ChoiceGroup
item - the new item

setStyle

public static void setStyle(Item item)
Applies a style to the given item if used in conjunction with the //#style preprocessing directive. Example:
 //#style myStyle
 UiAccess.setStyle( myItem );
 

Parameters:
item - the item which should get the new style

setStyle

public static void setStyle(Item item,
                            Style style)
Applies a style to the given item if used in conjunction with the //#style preprocessing directive. Example:
 //#style myStyle
 UiAccess.setStyle( myItem );
 

Parameters:
item - the item which should get the new style
style - the style for the item

setStyle

public static void setStyle(Screen screen)
Applies a style to the given screen if used in conjunction with the //#style preprocessing directive. Example:
 //#style myStyle
 UiAccess.setStyle( myScreen );
 

Parameters:
screen - the screen which should get the new style

setStyle

public static void setStyle(Alert screen)
Applies a style to the given alert if used in conjunction with the //#style preprocessing directive. Example:
 //#style myStyle
 UiAccess.setStyle( myAlert );
 

Parameters:
screen - the alert which should get the new style

setStyle

public static void setStyle(Alert screen,
                            Style style)
Applies a style to the given alert if used in conjunction with the //#style preprocessing directive. Example:
 //#style myStyle
 UiAccess.setStyle( myAlert );
 

Parameters:
screen - the alert which should get the new style
style - the style for the alert

setStyle

public static void setStyle(Item item)
Applies a style to the given item if used in conjunction with the //#style preprocessing directive. Example:
 //#style myStyle
 UiAccess.setStyle( myItem );
 

Parameters:
item - the item which should get the new style

setStyle

public static void setStyle(Screen screen)
Applies a style to the given screen if used in conjunction with the //#style preprocessing directive. Example:
 //#style myStyle
 UiAccess.setStyle( myScreen );
 

Parameters:
screen - the screen which should get the new style

setStyle

public static void setStyle(Item item,
                            Style style)
Applies a style to the given item.

Parameters:
item - the item which should get the new style
style - the style

setStyle

public static void setStyle(Screen screen,
                            Style style)
Applies a style to the given screen.

Parameters:
screen - the screen which should get the new style
style - the style

setStyle

public static void setStyle(List list,
                            int itemIndex)
Applies a style to the specified list item.

Parameters:
list - the list
itemIndex - the index of the list

setStyle

public static void setStyle(List list,
                            int itemIndex)
Applies a style to the specified list item.

Parameters:
list - the list
itemIndex - the index of the list

setStyle

public static void setStyle(List list,
                            int itemIndex,
                            Style style)
Applies a style to the specified list item.

Parameters:
list - the list
itemIndex - the index of the list
style - the new style of the item

setStyle

public static void setStyle(Command command)
Applies a style to the specified command.

Parameters:
command - the command

getStyle

public static Style getStyle(Item item)
Gets the current style of the given item. Example:
 //#if polish.usePolishGui
        Style style = UiAccess.getStyle( myItem );
        if (style != null) }
                style.background = new SimpleBackground( 0x00FF00 );
  }
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.

Parameters:
item - the item of which the style should be retrieved
Returns:
the style of the item

getStyle

public static Style getStyle(Screen screen)
Gets the current style of the given screen. Example:
 //#if polish.usePolishGui
        Style style = UiAccess.getStyle( myScreen );
        if (style != null) }
                style.background = new SimpleBackground( 0x00FF00 );
  }
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.

Parameters:
screen - the screen of which the style should be retrieved
Returns:
the style of the screen

getStyle

public static Style getStyle(Item item)
Gets the current style of the given item. Example:
 //#if polish.usePolishGui
        Style style = UiAccess.getStyle( myItem );
        if (style != null) }
                style.background = new SimpleBackground( 0x00FF00 );
  }
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.

Parameters:
item - the item of which the style should be retrieved
Returns:
the style of the item

getStyle

public static Style getStyle(Screen screen)
Gets the current style of the given screen. Example:
 //#if polish.usePolishGui
        Style style = UiAccess.getStyle( myScreen );
        if (style != null) }
                style.background = new SimpleBackground( 0x00FF00 );
  }
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.

Parameters:
screen - the screen of which the style should be retrieved
Returns:
the style of the screen

handleKeyPressed

public static boolean handleKeyPressed(Item item,
                                       int keyCode,
                                       int gameAction)
Forwards a key event to the specified item. The handleKeyPressed call is protected, this is an public accessor for any item.

Parameters:
item - the item
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the item

handleKeyPressed

public static boolean handleKeyPressed(Item item,
                                       int keyCode,
                                       int gameAction)
Forwards a key event to the specified item. The handleKeyPressed call is protected, this is an public accessor for any item.

Parameters:
item - the item
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the item

handleKeyReleased

public static boolean handleKeyReleased(Item item,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified item. The handleKeyReleased call is protected, this is an public accessor for any item.

Parameters:
item - the item
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the item

handleKeyReleased

public static boolean handleKeyReleased(Item item,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified item. The handleKeyPressed call is protected, this is an public accessor for any item.

Parameters:
item - the item
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the item

handleKeyRepeated

public static boolean handleKeyRepeated(Item item,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified item. The handleKeyRepeated call is protected, this is an public accessor for any item.

Parameters:
item - the item
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the item

handleKeyRepeated

public static boolean handleKeyRepeated(Item item,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified item. The handleKeyPressed call is protected, this is an public accessor for any item.

Parameters:
item - the item
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the item

handlePointerPressed

public static boolean handlePointerPressed(Item item,
                                           int x,
                                           int y)
Forwards a pointer event to the specified item. The handlePointerPressed call is protected, this is an public accessor for any item.

Parameters:
item - the item
x - the x position of the pointer position relative to this item's left position
y - the y position of the pointer position relative to this item's top position
Returns:
true when the event has been consumed by the item

handlePointerPressed

public static boolean handlePointerPressed(Item item,
                                           int x,
                                           int y)
Forwards a pointer event to the specified item. The handlePointerPressed call is protected, this is an public accessor for any item.

Parameters:
item - the item
x - the x position of the pointer position relative to this item's left position
y - the y position of the pointer position relative to this item's top position
Returns:
true when the event has been consumed by the item

handlePointerDragged

public static boolean handlePointerDragged(Item item,
                                           int x,
                                           int y)
Forwards a pointer event to the specified item. The handlePointerDragged call is protected, this is an public accessor for any item.

Parameters:
item - the item
x - the x position of the pointer position relative to this item's left position
y - the y position of the pointer position relative to this item's top position
Returns:
true when the event has been consumed by the item

handlePointerDragged

public static boolean handlePointerDragged(Item item,
                                           int x,
                                           int y)
Forwards a pointer event to the specified item. The handlePointerDragged call is protected, this is an public accessor for any item.

Parameters:
item - the item
x - the x position of the pointer position relative to this item's left position
y - the y position of the pointer position relative to this item's top position
Returns:
true when the event has been consumed by the item

handlePointerReleased

public static boolean handlePointerReleased(Item item,
                                            int x,
                                            int y)
Forwards a pointer event to the specified item. The handlePointerReleased call is protected, this is an public accessor for any item.

Parameters:
item - the item
x - the x position of the pointer position relative to this item's left position
y - the y position of the pointer position relative to this item's top position
Returns:
true when the event has been consumed by the item

handlePointerReleased

public static boolean handlePointerReleased(Item item,
                                            int x,
                                            int y)
Forwards a pointer event to the specified item. The handlePointerReleased call is protected, this is an public accessor for any item.

Parameters:
item - the item
x - the x position of the pointer position relative to this item's left position
y - the y position of the pointer position relative to this item's top position
Returns:
true when the event has been consumed by the item

handleCommand

public static boolean handleCommand(Item item,
                                    Command cmd)
Asks the specified item to handle the command.

Parameters:
item - the item
cmd - the command that the item should handle
Returns:
true when the item has handled that command

handleCommand

public static boolean handleCommand(Item item,
                                    Command cmd)
Asks the specified item to handle the command.

Parameters:
item - the item
cmd - the command that the item should handle
Returns:
true when the item has handled that command

handleKeyPressed

public static boolean handleKeyPressed(Screen screen,
                                       int keyCode,
                                       int gameAction)
Forwards a key event to the specified screen. The handleKeyPressed call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the screen

handleKeyPressed

public static boolean handleKeyPressed(Screen screen,
                                       int keyCode,
                                       int gameAction)
Forwards a key event to the specified screen. The handleKeyPressed call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the screen

handleKeyReleased

public static boolean handleKeyReleased(Screen screen,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified screen. The handleKeyReleased call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the screen

handleKeyReleased

public static boolean handleKeyReleased(Screen screen,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified screen. The handleKeyPressed call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the screen

handleKeyRepeated

public static boolean handleKeyRepeated(Screen screen,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified screen. The handleKeyRepeated call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the screen

handleKeyRepeated

public static boolean handleKeyRepeated(Screen screen,
                                        int keyCode,
                                        int gameAction)
Forwards a key event to the specified screen. The handleKeyPressed call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
keyCode - the code of the key
gameAction - the associated game action
Returns:
true when the event has been consumed by the screen

handlePointerPressed

public static boolean handlePointerPressed(Screen screen,
                                           int x,
                                           int y)
Forwards a key event to the specified screen. The handlePointerPressed call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
x - the x position of the pointer pressing relative to this screen's left position
y - the y position of the pointer pressing relative to this screen's top position
Returns:
true when the event has been consumed by the screen

handlePointerPressed

public static boolean handlePointerPressed(Screen screen,
                                           int x,
                                           int y)
Forwards a key event to the specified screen. The handlePointerPressed call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
x - the x position of the pointer pressing relative to this screen's left position
y - the y position of the pointer pressing relative to this screen's top position
Returns:
true when the event has been consumed by the screen

handlePointerReleased

public static boolean handlePointerReleased(Screen screen,
                                            int x,
                                            int y)
Forwards a pointer event to the specified screen. The handlePointerReleased call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
x - the x position of the pointer pressing relative to this screen's left position
y - the y position of the pointer pressing relative to this screen's top position
Returns:
true when the event has been consumed by the screen

handlePointerReleased

public static boolean handlePointerReleased(Screen screen,
                                            int x,
                                            int y)
Forwards a pointer event to the specified screen. The handlePointerReleased call is protected, this is an public accessor for any screen.

Parameters:
screen - the screen
x - the x position of the pointer pressing relative to this screen's left position
y - the y position of the pointer pressing relative to this screen's top position
Returns:
true when the event has been consumed by the screen

handleCommand

public static boolean handleCommand(Screen screen,
                                    Command cmd)
Asks the specified screen to handle the command.

Parameters:
screen - the screen
cmd - the command that the screen should handle
Returns:
true when the screen has handled that command

handleCommand

public static boolean handleCommand(Screen screen,
                                    Command cmd)
Asks the specified screen to handle the command.

Parameters:
screen - the screen
cmd - the command that the screen should handle
Returns:
true when the screen has handled that command

setCaretPosition

public static void setCaretPosition(TextField field,
                                    int position)
Sets the caret position in the given text field. Please note that this operation requires the direct input mode to work.

Parameters:
field - the text field
position - the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.

setCaretPosition

public static void setCaretPosition(TextField field,
                                    int position)
Sets the caret position in the given text field. Please note that this operation requires the direct input mode to work.

Parameters:
field - the text field
position - the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.

setNumberOfDecimalFractions

public static void setNumberOfDecimalFractions(TextField field,
                                               int number)
Sets the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields

Parameters:
field - the textfield the textfield for which the fractions are set
number - the number (defaults to 2)
See Also:
CONSTRAINT_FIXED_POINT_DECIMAL, TextField.FIXED_POINT_DECIMAL

setNumberOfDecimalFractions

public static void setNumberOfDecimalFractions(TextField field,
                                               int number)
Sets the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields

Parameters:
field - the textfield the textfield for which the fractions are set
number - the number (defaults to 2)
See Also:
CONSTRAINT_FIXED_POINT_DECIMAL, TextField.FIXED_POINT_DECIMAL

getNumberOfDecimalFractions

public static int getNumberOfDecimalFractions(TextField field)
Retrieves the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields

Parameters:
field - the textfield the textfield for which the fractions are set
Returns:
the number (defaults to 2)
See Also:
CONSTRAINT_FIXED_POINT_DECIMAL, TextField.FIXED_POINT_DECIMAL

getNumberOfDecimalFractions

public static int getNumberOfDecimalFractions(TextField field)
Retrieves the number of decimal fractions that are allowed for FIXED_POINT_DECIMAL constrained TextFields

Parameters:
field - the textfield the textfield for which the fractions are set
Returns:
number the number (defaults to 2)
See Also:
CONSTRAINT_FIXED_POINT_DECIMAL, TextField.FIXED_POINT_DECIMAL

setCaretPosition

public static void setCaretPosition(TextBox box,
                                    int position)
Sets the caret position in the given text box. Please note that this operation requires the direct input mode to work.

Parameters:
box - the text box
position - the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.

setCaretPosition

public static void setCaretPosition(TextBox box,
                                    int position)
Sets the caret position in the given text box. Please note that this operation requires the direct input mode to work.

Parameters:
box - the text box
position - the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.

setInputMode

public static void setInputMode(TextField field,
                                int inputMode)
Sets the input mode for the given textfield. Warning: you have to ensure that the input mode matches the contraints of the given TextField.

Parameters:
field - the text field
inputMode - the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

setInputMode

public static void setInputMode(TextField field,
                                int inputMode)
Sets the input mode for the given textfield. Warning: you have to ensure that the input mode matches the contraints of the given TextField.

Parameters:
field - the text field
inputMode - the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

setInputMode

public static void setInputMode(TextBox box,
                                int inputMode)
Sets the input mode for the given textbox. Warning: you have to ensure that the input mode matches the contraints of the given TextBox.

Parameters:
box - the text box
inputMode - the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

setInputMode

public static void setInputMode(TextBox box,
                                int inputMode)
Sets the input mode for the given textbox. Warning: you have to ensure that the input mode matches the contraints of the given TextBox.

Parameters:
box - the text box
inputMode - the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASEor UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

getInputMode

public static int getInputMode(TextField field)
Retrieves the input mode for the given textfield.

Parameters:
field - the text field
Returns:
the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASEor UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

getInputMode

public static int getInputMode(TextField field)
Retrieves the input mode for the given textfield.

Parameters:
field - the text field
Returns:
the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

getInputMode

public static int getInputMode(TextBox box)
Retrieves the input mode for the given textbox.

Parameters:
box - the text box
Returns:
the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

getInputMode

public static int getInputMode(TextBox box)
Retrieves the input mode for the given textbox.

Parameters:
box - the text box
Returns:
the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
See Also:
MODE_NUMBERS, MODE_LOWERCASE, MODE_UPPERCASE, MODE_FIRST_UPPERCASE, MODE_NATIVE

getDotSeparatedDecimalString

public static String getDotSeparatedDecimalString(TextField field)
Retrieves the decimal value entered with a dot as the decimal mark. When the J2ME Polish GUI is not used, this method will only detect commas as possible alternative decimal marks.

Parameters:
field - the text field with a DECIMAL constraint
Returns:
either the formatted value or null, when there was no input.
Throws:
IllegalStateException - when the TextField is not DECIMAL constrained

getDotSeparatedDecimalString

public static String getDotSeparatedDecimalString(TextField field)
Retrieves the decimal value entered with a dot as the decimal mark.

Parameters:
field - the text field with a DECIMAL constraint
Returns:
either the formatted value or null, when there was no input.
Throws:
IllegalStateException - when the TextField is not DECIMAL constrained

addSubCommand

public static void addSubCommand(Command child,
                                 Command parent,
                                 Screen screen)
Adds the given command as a subcommand to the defined screen. When the J2ME Polish GUI is not used, this will just add the command to the screen like a normal command.

Parameters:
child - the sub command
parent - the parent command
screen - the screen.

addSubCommand

public static void addSubCommand(Command child,
                                 Command parent,
                                 Screen screen)
Adds the given command as a subcommand to the defined screen. When the J2ME Polish GUI is not used, this will just add the command to the screen like a normal command.

Parameters:
child - the sub command
parent - the parent command
screen - the screen.

addSubCommand

public static void addSubCommand(Command child,
                                 Command parent,
                                 Screen screen)
Adds the given command as a subcommand to the defined screen. When the J2ME Polish GUI is not used, this will just add the command to the screen like a normal command.

Parameters:
child - the sub command
parent - the parent command
screen - the screen.

addSubCommand

public static void addSubCommand(Command child,
                                 Command parent,
                                 Screen screen,
                                 Style style)
Adds the given command as a subcommand to the defined screen. When the J2ME Polish GUI is not used, this will just add the command to the screen like a normal command.

Parameters:
child - the sub command
parent - the parent command
screen - the screen.
style - the style of the command

removeSubCommand

public static void removeSubCommand(Command childCommand,
                                    Command parentCommand,
                                    Screen screen)
Removes the given command as subcommand from the defined screen

Parameters:
childCommand - the command to remove.
parentCommand - the parent command of the command to remove.
screen - the screen.

removeSubCommand

public static void removeSubCommand(Command childCommand,
                                    Command parentCommand,
                                    Screen screen)
Removes the given command as a subcommand from the defined screen

Parameters:
childCommand - the command to remove.
parentCommand - the parent command of the command to remove.
screen - the screen.

removeAllCommands

public static void removeAllCommands(Screen screen)
Removes all commands from the given screen This option is only available when the "menu" fullscreen mode is activated.

Parameters:
screen - the screen.

removeAllCommands

public static void removeAllCommands(Screen screen)
Removes all commands from the given screen This option is only available when the "menu" fullscreen mode is activated.

Parameters:
screen - the screen.

isMenuOpened

public static boolean isMenuOpened(Screen screen)
Checks whether the commands menu of the screen is currently opened. Useful when overriding the keyPressed() method.

Parameters:
screen - the screen
Returns:
true when the commands menu is opened.

isMenuOpened

public static boolean isMenuOpened(Screen screen)
Checks whether the commands menu of the screen is currently opened. Useful when overriding the keyPressed() method.

Parameters:
screen - the screen
Returns:
true when the commands menu is opened.

focus

public static void focus(Screen screen,
                         Item item)
Focuses the specified item on the given screen.

Parameters:
screen - the screen
item - the item that should be focused

focus

public static void focus(Screen screen,
                         Item item)
Focuses the specified item on the given screen.

Parameters:
screen - the screen
item - the item that should be focused

focus

public static void focus(Screen screen,
                         Item item)
Focuses the specified item on the given screen.

Parameters:
screen - the screen
item - the item that should be focused

focus

public static void focus(Screen screen,
                         Item item)
Focuses the specified item on the given screen.

Parameters:
screen - the screen
item - the item that should be focused

focus

public static void focus(Screen screen,
                         int index)
Focuses the specified item on the given screen.

Parameters:
screen - the screen
index - the index of the item that should be focused, first item has the index 0

focus

public static void focus(Screen screen,
                         int index)
Focuses the specified item on the given screen.

Parameters:
screen - the screen
index - the index of the item that should be focused, first item has the index 0

focus

public static void focus(ChoiceGroup choiceGroup,
                         int index)
Focuses the specified item on the given choice group.

Parameters:
choiceGroup - the choice group
index - the index of the item that should be focused, first item has the index 0

focus

public static void focus(ChoiceGroup choiceGroup,
                         int index)
Focuses the specified item on the given choice group.

Parameters:
choiceGroup - the choice group
index - the index of the item that should be focused, first item has the index 0

releaseResources

public static void releaseResources()
Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI.


releaseResourcesOnScreenChange

public static void releaseResourcesOnScreenChange()
Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI when a non-J2ME Polish screen is shown.


releaseResources

public static void releaseResources(Screen screen)
Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI for the specified screen. The release is synchronized with the paint cycle of the screen and must not be called from within a paint method, as this will result in deadlocks.

Parameters:
screen - the screen for which the resources should be released.

releaseResources

public static void releaseResources(Screen screen)
Releases all (memory) instensive resources that are currently hold by the J2ME Polish GUI for the specified screen. The release is synchronized with the paint cycle of the screen and must not be called from within a paint method, as this will result in deadlocks.

Parameters:
screen - the screen for which the resources should be released.

setSubtitle

public static void setSubtitle(Screen screen,
                               String subtitle)
Sets the subtitle for the specified screen

Parameters:
screen - the screen
subtitle - the subtitle text

setSubtitle

public static void setSubtitle(Screen screen,
                               String subtitle,
                               Style style)
Sets the subtitle for the specified screen

Parameters:
screen - the screen
subtitle - the subtitle text
style - the style of the subtitle text

setSubtitle

public static void setSubtitle(Screen screen,
                               String subtitle)
Sets the subtitle for the specified screen

Parameters:
screen - the screen
subtitle - the subtitle text

setSubtitle

public static void setSubtitle(Screen screen,
                               String subtitle,
                               Style style)
Sets the subtitle for the specified screen

Parameters:
screen - the screen
subtitle - the subtitle text
style - the style of the subtitle text

setSubtitle

public static void setSubtitle(Screen screen,
                               Item subtitle)
Sets the subtitle for the specified screen

Parameters:
screen - the screen
subtitle - the subtitle item

setSubtitle

public static void setSubtitle(Screen screen,
                               Item subtitle)
Sets the subtitle for the specified screen

Parameters:
screen - the screen
subtitle - the subtitle item

scroll

public static void scroll(Screen screen,
                          int yOffset)
Scrolls the screen to the given position.

Parameters:
screen - the screen
yOffset - the vertical offset: 0 is the very top, negative values scroll the screen towards the end.

scroll

public static void scroll(Screen screen,
                          int yOffset)
Scrolls the screen to the given position.

Parameters:
screen - the screen
yOffset - the vertical offset: 0 is the very top, negative values scroll the screen towards the end.

scrollTo

public static void scrollTo(Item item)
Scrolls the screen so that the specified item becomes visible. If the item is above the currently visible screen area, it will be placed at the top. If the item is below the currently visible screen area, it will be placed at the bottom. If the item is within the currently visible screen area, the call will be ignored.

Parameters:
item - the item that should become visible.
See Also:
scrollTo(javax.microedition.lcdui.Item, int)

scrollTo

public static void scrollTo(Item item,
                            int position)
Scrolls the screen so that the specified item will be position according to the specified position.

Parameters:
item - the item that should become visible.
position - the position, either Graphics.TOP, Graphics.BOTTOM or Graphics.VCENTER
See Also:
scrollTo(javax.microedition.lcdui.Item)

scrollTo

public static void scrollTo(Item item)
Scrolls the screen so that the specified item becomes visible. If the item is above the currently visible screen area, it will be placed at the top. If the item is below the currently visible screen area, it will be placed at the bottom. If the item is within the currently visible screen area, the call will be ignored.

Parameters:
item - the item that should become visible.
See Also:
scrollTo(Item, int)

scrollTo

public static void scrollTo(Item item,
                            int position)
Scrolls the screen so that the specified item will be position according to the specified position.

Parameters:
item - the item that should become visible.
position - the position, either Graphics.TOP, Graphics.BOTTOM or Graphics.VCENTER
See Also:
scrollTo(javax.microedition.lcdui.Item)

getBackground

public static Background getBackground(Screen screen)
Retrieves the background of the given screen. This can be used to dynamically alter the background, e.g. by setting a different image:
 //#if polish.usePolishGui
   ImageBackground ib = (ImageBackground) UiAccess.getBackground( form );
   ib.setImage( newImage );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
screen - the screen
Returns:
the background for the screen

getBackground

public static Background getBackground(Screen screen)
Retrieves the background of the given screen. This can be used to dynamically alter the background, e.g. by setting a different image:
 //#if polish.usePolishGui
   ImageBackground ib = (ImageBackground) UiAccess.getBackground( form );
   ib.setImage( newImage );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
screen - the screen
Returns:
the background for the screen

setBackground

public static void setBackground(Screen screen,
                                 Background background)
Sets the background for the given screen. This can be used to dynamically alter the background:
 //#if polish.usePolishGui
   SimpleBackground bg = new SimpleBackground( 0x00FF00 );
   UiAccess.setBackground( item, screen );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
screen - the screen
background - - the new background

setBackground

public static void setBackground(Screen screen,
                                 Background background)
Sets the background for the given screen. This can be used to dynamically alter the background:
 //#if polish.usePolishGui
   SimpleBackground bg = new SimpleBackground( 0x00FF00 );
   UiAccess.setBackground( item, screen );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
screen - the screen
background - - the new background

getBackground

public static Background getBackground(Item item)
Retrieves the background of the given item. This can be used to dynamically alter the background, e.g. by setting a different image:
 //#if polish.usePolishGui
   ImageBackground ib = (ImageBackground) UiAccess.getBackground( item );
   ib.setImage( newImage );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
item - the item
Returns:
the background for the item

getBackground

public static Background getBackground(Item item)
Retrieves the background of the given item. This can be used to dynamically alter the background, e.g. by setting a different image:
 //#if polish.usePolishGui
   ImageBackground ib = (ImageBackground) UiAccess.getBackground( item );
   ib.setImage( newImage );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
item - the item
Returns:
the background for the item

setBackground

public static void setBackground(Item item,
                                 Background background)
Sets the background for the given item. This can be used to dynamically alter the background:
 //#if polish.usePolishGui
   SimpleBackground bg = new SimpleBackground( 0x00FF00 );
   UiAccess.setBackground( item, screen );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
item - the item
background - - the new background

setBackground

public static void setBackground(Item item,
                                 Background background)
Sets the background for the given item. This can be used to dynamically alter the background:
 //#if polish.usePolishGui
   SimpleBackground bg = new SimpleBackground( 0x00FF00 );
   UiAccess.setBackground( item, screen );
 //#endif
 
Note: this method is only available when the J2ME Polish GUI is used! Check for the preprocessing symbold polish.usePolishGui.

Parameters:
item - the item
background - - the new background

getCommandListener

public static CommandListener getCommandListener(Screen screen)
Retrieves the command listener belonging to this screen.

Parameters:
screen - the screen
Returns:
the associated command listener, always null for javax.microedition.lcdui.Screen objects that have not been converted to J2ME Polish components

getCommandListener

public static CommandListener getCommandListener(Screen screen)
Retrieves the command listener belonging to this screen.

Parameters:
screen - the screen
Returns:
the associated command listener, always null for javax.microedition.lcdui.Screen objects that have not been converted to J2ME Polish components

setAttribute

public static void setAttribute(Item item,
                                Object key,
                                Object value)
Sets an arbitrary attribute for the given item.

Parameters:
item - the item to which the attribute should be added
key - the key for the attribute
value - the attribute value

getAttribute

public static Object getAttribute(Item item,
                                  Object key)
Gets an previously added attribute of the specified item.

Parameters:
item - the item to which the attribute should be added
key - the key of the attribute
Returns:
the attribute value, null if none has been registered under the given key before

getAttributes

public static HashMap getAttributes(Item item)
Returns a HashMap object with all registered attributes.

Parameters:
item - the item from which the attributes should be retrieved
Returns:
a HashMap object with all attribute key/value pairs, null if no attribute was stored before.

setAttribute

public static void setAttribute(List list,
                                int index,
                                Object key,
                                Object value)
Sets an arbitrary attribute for the specified list item.

Parameters:
list - a list of items
index - the index of the item to which the attribute should be added
key - the key for the attribute
value - the attribute value

getAttribute

public static Object getAttribute(List list,
                                  int index,
                                  Object key)
Gets an previously added attribute of the specified item.

Parameters:
list - a list of items
index - the index of item from which the attribute should be retrieved
key - the key of the attribute
Returns:
the attribute value, null if none has been registered under the given key before

getAttributes

public static HashMap getAttributes(List list,
                                    int index)
Returns a HashMap object with all registered attributes.

Parameters:
list - a list of items
index - the index of item from which the attributes should be retrieved
Returns:
a HashMap object with all attribute key/value pairs, null if no attribute was stored before.

setAttribute

public static void setAttribute(Item item,
                                Object key,
                                Object value)
Sets an arbitrary attribute for the given item.

Parameters:
item - the item to which the attribute should be added
key - the key for the attribute
value - the attribute value

getAttribute

public static Object getAttribute(Item item,
                                  Object key)
Gets an previously added attribute of the specified item.

Parameters:
item - the item from which the attribute should be retrieved
key - the key of the attribute
Returns:
the attribute value, null if none has been registered under the given key before

getAttributes

public static HashMap getAttributes(Item item)
Returns a HashMap object with all registered attributes.

Parameters:
item - the item from which the attributes should be retrieved
Returns:
a HashMap object with all attribute key/value pairs, null if no attribute was stored before.

setAttribute

public static void setAttribute(List list,
                                int index,
                                Object key,
                                Object value)
Sets an arbitrary attribute for the specified list item.

Parameters:
list - a list of items
index - the index of the item to which the attribute should be added
key - the key for the attribute
value - the attribute value

getAttribute

public static Object getAttribute(List list,
                                  int index,
                                  Object key)
Gets an previously added attribute of the specified item.

Parameters:
list - a list of items
index - the index of item from which the attributes should be retrieved
key - the key of the attribute
Returns:
the attribute value, null if none has been registered under the given key before

getAttributes

public static HashMap getAttributes(List list,
                                    int index)
Returns a HashMap object with all registered attributes.

Parameters:
list - a list of items
index - the index of the item from which the attributes should be retrieved
Returns:
a HashMap object with all attribute key/value pairs, null if no attribute was stored before.

setAccessible

public static void setAccessible(Item item,
                                 boolean isAccessible)
Makes the item interactive (accessible) or non-interactive. This method is ignored when the J2ME Polish UI is not activated.
 //#style inactiveStyle
 UiAccess.setAccessible( myItem, false );
 

Parameters:
item - the item that should be made accessible
isAccessible - true when the item should be accessible/selectable

setAccessible

public static void setAccessible(Item item,
                                 boolean isAccessible)
Makes the item interactive (accessible) or non-interactive. You can set a new style at the same time by adding a style directive:
 //#style inactiveStyle
 UiAccess.setAccessible( myItem, false );
 

Parameters:
item - the item that should be made accessible
isAccessible - true when the item should be accessible/selectable

setAccessible

public static void setAccessible(Item item,
                                 boolean isAccessible,
                                 Style style)
Makes the item interactive (accessible) or non-interactive. You can set a new style at the same time by adding a style directive:
 //#style inactiveStyle
 UiAccess.setAccessible( myItem, false );
 

Parameters:
item - the item that should be made accessible
isAccessible - true when the item should be accessible/selectable
style - the new style, is ignored when it is null

setAccessible

public static void setAccessible(Choice choice,
                                 int itemIndex,
                                 boolean isAccessible)
Makes the specified List or ChoiceGroup item selectable or inaccessible - can be used in combination with a #style preprocessing directive.

Parameters:
choice - the list
itemIndex - the index of the list
isAccessible - true when the item should be accessible/selectable

setAccessible

public static void setAccessible(Choice choice,
                                 int itemIndex,
                                 boolean isAccessible)
Makes the specified List item selectable or inaccessible - can be used in combination with a #style preprocessing directive.

Parameters:
choice - the list
itemIndex - the index of the list
isAccessible - true when the item should be accessible/selectable
Throws:
IllegalArgumentException - when choice is not a List/ChoiceGroup or a J2ME Polish Container

setAccessible

public static void setAccessible(Choice choice,
                                 int itemIndex,
                                 boolean isAccessible,
                                 Style style)
Makes the specified List or ChoiceGroup item selectable or inaccessible.

Parameters:
choice - the List or ChoiceGroup
itemIndex - the index of the list
isAccessible - true when the item should be accessible/selectable
style - the new style of the item
Throws:
IllegalArgumentException - when choice is not a List/ChoiceGroup or a J2ME Polish Container

setAccessible

public static void setAccessible(Screen screen,
                                 Command command,
                                 boolean isAccessible)
Makes the command interactive (accessible) or non-interactive. This method is ignored when the J2ME Polish UI is not activated.
 //#style inactiveStyle
 UiAccess.setAccessible( myScreen, myCommand, false );
 

Parameters:
screen - the screen that contains the command
command - the item that should be made accessible
isAccessible - true when the item should be accessible/selectable

setAccessible

public static void setAccessible(Screen screen,
                                 Command command,
                                 boolean isAccessible)
Makes the command interactive (accessible) or non-interactive. This method is ignored when the J2ME Polish UI is not activated.
 //#style inactiveStyle
 UiAccess.setAccessible( myScreen, myCommand, false );
 

Parameters:
screen - the screen that contains the command
command - the item that should be made accessible
isAccessible - true when the item should be accessible/selectable

setAccessible

public static void setAccessible(Screen screen,
                                 Command command,
                                 boolean isAccessible)
Makes the item interactive (accessible) or non-interactive.
 //#style inactiveStyle
 UiAccess.setAccessible( myScreen, myCommand, false );
 

Parameters:
screen - the screen that contains the command
command - the item that should be made accessible
isAccessible - true when the item should be accessible/selectable

setAccessible

public static void setAccessible(Screen screen,
                                 Command command,
                                 boolean isAccessible,
                                 Style style)
Makes the item interactive (accessible) or non-interactive.
 //#style inactiveStyle
 UiAccess.setAccessible( myScreen, myCommand, false );
 

Parameters:
screen - the screen that contains the command
command - the item that should be made accessible
isAccessible - true when the item should be accessible/selectable
style - the new style for the command, is ignored when null

setTickerImage

public static void setTickerImage(Ticker ticker,
                                  Image image)
Sets an image for the specified ticker. This method is ignored when the J2ME Polish UI is not activated.

Parameters:
ticker - the ticker item which will the image be set
image - that image that will be set to the ticker

setTickerImage

public static void setTickerImage(Ticker ticker,
                                  Image image)
Sets an image for the specified ticker. This method is ignored when the J2ME Polish UI is not activated.

Parameters:
ticker - the ticker item which will the image be set
image - that image that will be set to the ticker

setData

public static void setData(Screen screen,
                           Object data)
Attaches data to the specified screen. This mechanism can be used to add business logic to screens.

Parameters:
screen - the screen in which the data should be stored
data - the screen specific data
See Also:
getData(Screen)

getData

public static Object getData(Screen screen)
Retrieves screen specific data. This mechanism can be used to add business logic to screens.

Parameters:
screen - the screen in which data has been previously stored using UiAccess.setData()
Returns:
any screen specific data or null when no data has been attached before
See Also:
setData(Screen, Object)

setData

public static void setData(Screen screen,
                           Object data)
Attaches data to the specified screen. This mechanism can be used to add business logic to screens.

Parameters:
screen - the screen in which the data should be stored
data - the screen specific data
See Also:
getData(Screen)

getData

public static Object getData(Screen screen)
Retrieves screen specific data. This mechanism can be used to add business logic to screens.

Parameters:
screen - the screen in which data has been previously stored using UiAccess.setData()
Returns:
any screen specific data or null when no data has been attached before
See Also:
setData(Screen, Object)

setCommandLabel

public static void setCommandLabel(Screen screen,
                                   Command command,
                                   String label)
Changes the shown label of the specified command. Note that command.getLabel() will afterwards retrieve the same string as before, only the shown label will be changed. You cannot change the labels of the commands that are shown on the left or right side of the menu, unless the extended menubar is activated (polish.MenuBar.useExtendedMenuBar=true). This call is ignored when J2ME Polish does not render the menu.

Parameters:
screen - the screen that contains the command
command - the command
label - the new label that should be shown

setCommandLabel

public static void setCommandLabel(Screen screen,
                                   Command command,
                                   String label)
Changes the shown label of the specified command. Note that command.getLabel() will afterwards retrieve the same string as before, only the shown label will be changed. You cannot change the labels of the commands that are shown on the left or right side of the menu, unless the extended menubar is activated (polish.MenuBar.useExtendedMenuBar=true). This call is ignored when J2ME Polish does not render the menu.

Parameters:
screen - the screen that contains the command
command - the command
label - the new label that should be shown

setCommandLabel

public static void setCommandLabel(Screen screen,
                                   Command command,
                                   String label)
Changes the shown label of the specified command. Note that command.getLabel() will afterwards retrieve the same string as before, only the shown label will be changed. You cannot change the labels of the commands that are shown on the left or right side of the menu, unless the extended menubar is activated (polish.MenuBar.useExtendedMenuBar=true). This call is ignored when J2ME Polish does not render the menu.

Parameters:
screen - the screen that contains the command
command - the command
label - the new label that should be shown

setCommandLabel

public static void setCommandLabel(Command command,
                                   String label)
Changes the shown label of the specified command. Note that command.getLabel() will afterwards retrieve the same string as before, only the shown label will be changed. You cannot change the labels of the commands that are shown on the left or right side of the menu, unless the extended menubar is activated (polish.MenuBar.useExtendedMenuBar=true). This call is ignored when J2ME Polish does not render the menu.

Parameters:
command - the command
label - the new label that should be shown

append

public static int append(Ticker ticker,
                         Form form)
Adds a ticker as a normal item to the specified form.

Parameters:
ticker - the ticker
form - the form
Returns:
the index of the ticker within the form, -1 when the J2ME Polish UI is not used.

append

public static int append(Item item,
                         Form form)
Adds the specified (J2ME Polish) item to the given form. This can be used for example to add several tickers to a form.

Parameters:
item - the item
form - the form
Returns:
the index of the item within the form, -1 when the J2ME Polish UI is not used.

append

public static int append(Item item,
                         Form form)
Adds the specified (J2ME Polish) item to the given form.

Parameters:
item - the item
form - the form
Returns:
the index of the item within the form

isVisible

public static boolean isVisible(Item item)
Gets the visible status of the specified item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true.

Parameters:
item - the item that might be invisible
Returns:
true when this item is visible.

isVisible

public static boolean isVisible(List list,
                                int index)
Gets the visible status of the specified list-item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true.

Parameters:
list - the list
index - the index of the item
Returns:
true when this item is visible.

setVisible

public static void setVisible(Item item,
                              boolean visible)
Sets the invisible status of the specified item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true.

Parameters:
item - the item
visible - true when the item should become invisible.

setVisible

public static void setVisible(List list,
                              int index,
                              boolean visible)
Sets the invisible status of the specified list-item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true.

Parameters:
list - the list
index - the index of the item
visible - true when the item should become invisible.

isVisible

public static boolean isVisible(Item item)
Gets the visible status of the specified item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true (and the J2ME Polish UI is used).

Parameters:
item - the item that might be invisible
Returns:
true when this item is visible.

isVisible

public static boolean isVisible(List list,
                                int index)
Gets the visible status of the specified list-item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true.

Parameters:
list - the list
index - the index of the item
Returns:
true when this item is visible.

setVisible

public static void setVisible(Item item,
                              boolean visible)
Sets the visible status of the specified item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true (and the J2ME Polish UI is used).

Parameters:
item - the item
visible - true when the item should be visible.

setVisible

public static void setVisible(List list,
                              int index,
                              boolean visible)
Sets the invisible status of the specified list-item. Invisible items occupy no space on the UI screen and cannot be focused/traversed. Invisible items are only supported when the preprocessing variable polish.supportInvisibleItems is true.

Parameters:
list - the list
index - the index of the item
visible - true when the item should become invisible.

indexOf

public static int indexOf(Item item,
                          Screen screen)
Retrieves the index of the specified item in the screen.

Parameters:
item - the item
screen - the screen
Returns:
the index of the item; -1 when the item is not part of the given screen

indexOf

public static int indexOf(Item item,
                          Screen screen)
Retrieves the index of the specified item in the screen.

Parameters:
item - the item
screen - the screen
Returns:
the index of the item; -1 when the item is not part of the given screen

indexOf

public static int indexOf(Item item,
                          Screen screen)
Retrieves the index of the specified item in the screen.

Parameters:
item - the item
screen - the screen
Returns:
the index of the item; -1 when the item is not part of the given screen

indexOf

public static int indexOf(Item item,
                          Screen screen)
Retrieves the index of the specified item in the screen.

Parameters:
item - the item
screen - the screen
Returns:
the index of the item; -1 when the item is not part of the given screen

getRgbData

public static int[] getRgbData(Item item)
Retrieves the RGB data of the specified item. This method only works on MIDP 2.0+ devices.

Parameters:
item - the item
Returns:
the RGB data as an int array.

getRgbData

public static int[] getRgbData(Item item,
                               int opacity)
Retrieves the RGB data of the specified item. This method only works on MIDP 2.0+ devices.

Parameters:
item - the item
opacity - The opacity of the item between 0 (fully transparent) and 255 (fully opaque)
Returns:
the RGB data as an int array.

getRgbData

public static int[] getRgbData(Item item)
Retrieves the RGB data of the specified item. This method only works on MIDP 2.0+ devices.

Parameters:
item - the item
Returns:
the RGB data as an int array.

getRgbData

public static int[] getRgbData(Item item,
                               int opacity)
Retrieves the RGB data of the specified item. This method only works on MIDP 2.0+ devices.

Parameters:
item - the item
opacity - The opacity of the item between 0 (fully transparent) and 255 (fully opaque)
Returns:
the RGB data as an int array.

getRgbDataOfContent

public static int[] getRgbDataOfContent(Item item)
Retrieves the RGB data of the specified item's content without using a view-type/ItemView. This is often used by ItemView that want to change the original RGB data. In ItemView please ensure to call initContentByParent( item ) before using this function.

Parameters:
item - the item
Returns:
an int array containing the RGB data of that item

getRgbDataOfContent

public static int[] getRgbDataOfContent(Item item)
Retrieves the RGB data of the specified item's content without using a view-type/ItemView. This is often used by ItemView that want to change the original RGB data. In ItemView please ensure to call initContentByParent( item ) before using this function.

Parameters:
item - the item
Returns:
an int array containing the RGB data of that item (null on MIDP 1.0 devices)

getRgbDataOfContent

public static void getRgbDataOfContent(Item item,
                                       int[] rgbData,
                                       int x,
                                       int y,
                                       int width)
Retrieves the RGB data of the specified item's content without using a view-type/ItemView. This is often used by ItemView that want to change the original RGB data. In ItemView please ensure to call initContentByParent( item ) before using this function.

Parameters:
item - the item
rgbData - an int array in which the RGB data of the item's content is written
x - the horizontal start position for the RGB data
y - the vertical start position for the RGB data
width - the width of a single row in the rgbData

getRgbDataOfContent

public static void getRgbDataOfContent(Item item,
                                       int[] rgbData,
                                       int x,
                                       int y,
                                       int width)
Retrieves the RGB data of the specified item's content without using a view-type/ItemView. This is often used by ItemView that want to change the original RGB data. In ItemView please ensure to call initContentByParent( item ) before using this function.

Parameters:
item - the item
rgbData - an int array in which the RGB data of the item's content is written
x - the horizontal start position for the RGB data
y - the vertical start position for the RGB data
width - the width of a single row in the rgbData

setPredictiveDictionary

public static void setPredictiveDictionary(TextField field,
                                           String[] words)
Allows the given words for the specified textfield. Note that you need to enable the predictive input mode using the preprocessing variable polish.TextField.usePredictiveInputMode.

Parameters:
field - the textfield
words - array of allowed words - use null to reset the allowed words to the default RMS dictionary

setPredictiveDictionary

public static void setPredictiveDictionary(TextField field,
                                           String[] words)
Allows the given words for the specified textfield. Note that you need to enable the predictive input mode using the preprocessing variable polish.TextField.usePredictiveInputMode.

Parameters:
field - the textfield
words - array of allowed words - use null to reset the allowed words to the default RMS dictionary

getPredictiveMatchingWords

public static ArrayList getPredictiveMatchingWords(TextField field)
Retrieves matching words for the specified textfield. Note that you need to enable the predictive input mode using the preprocessing variable polish.TextField.usePredictiveInputMode.

Parameters:
field - the textfield
Returns:
ArrayList of allowed words - null when no preditive mode is used

getPredictiveMatchingWords

public static ArrayList getPredictiveMatchingWords(TextField field)
Retrieves matching words for the specified textfield. Note that you need to enable the predictive input mode using the preprocessing variable polish.TextField.usePredictiveInputMode.

Parameters:
field - the textfield
Returns:
ArrayList of allowed words - null when no predictive mode is used

setTextfieldInfo

public static void setTextfieldInfo(TextField field,
                                    String info)

setTextfieldInfo

public static void setTextfieldInfo(TextField field,
                                    String info)

setTextfieldInfoItem

public static void setTextfieldInfoItem(TextField field,
                                        StringItem infoItem)
Sets the item responsible for displaying the current input mode like Abc, ABC, 123, and so on. This feature requires that the preprocessing variable "polish.TextField.useExternalInfo" is set to "true".

Parameters:
field - the TextField
infoItem - the StringItem that should be used for rendering the current input mode.

setTextfieldInfoItem

public static void setTextfieldInfoItem(TextField field,
                                        StringItem infoItem)
Sets the item responsible for displaying the current input mode like Abc, ABC, 123, and so on. This feature requires that the preprocessing variable "polish.TextField.useExternalInfo" is set to "true".

Parameters:
field - the TextField
infoItem - the StringItem that should be used for rendering the current input mode.

setTextfieldHelp

public static void setTextfieldHelp(TextField field,
                                    String text)
Sets the help text for the specified TextField. This text will be shown when the TextField's content is null. This can only be called when the preprocessing variable "polish.TextField.showHelpText" is true.

Parameters:
field - the TextField
text - the help text

setTextfieldHelp

public static void setTextfieldHelp(TextField field,
                                    String text)
Sets the help text for the specified TextField. This text will be shown when the TextField's content is null. This can only be called when the preprocessing variable "polish.TextField.showHelpText" is true.

Parameters:
field - the TextField
text - the help text

setSuppressCommands

public static void setSuppressCommands(TextField field,
                                       boolean suppress)
Can be used to deactivate or activate commands for a specific TextField. This has no effect when commands are globally suppressed by settting the preprocessing variable "polish.TextField.suppressCommands" to "true".

Parameters:
field - the TextField
suppress - true when commands should be surpressed

setSuppressCommands

public static void setSuppressCommands(TextField field,
                                       boolean suppress)
Can be used to deactivate or activate commands for a specific TextField. This has no effect when commands are globally suppressed by settting the preprocessing variable "polish.TextField.suppressCommands" to "true".

Parameters:
field - the TextField
suppress - true when commands should be surpressed

setItemStateListener

public static void setItemStateListener(Item item,
                                        ItemStateListener listener)
Sets an ItemStateListener specifically for this item. Change events are forwarded to both this listener as well as a possibly set listener of the corresponding screen.

Parameters:
item - the item
listener - the listener

setItemStateListener

public static void setItemStateListener(Item item,
                                        ItemStateListener listener)
Sets an ItemStateListener specifically for this item. Change events are forwarded to both this listener as well as a possibly set listener of the corresponding screen.

Parameters:
item - the item
listener - the listener

showNotify

public static void showNotify(Item item)
Calls show notify on the specified item.

Parameters:
item - the item

showNotify

public static void showNotify(Item item)
Calls show notify on the specified item.

Parameters:
item - the item

showNotify

public static void showNotify(Screen screen,
                              Item item)
Calls show notify on the specified item.

Parameters:
screen - the corresponding screen of that item
item - the item

showNotify

public static void showNotify(Screen screen,
                              Item item)
Calls show notify on the specified item.

Parameters:
screen - the corresponding screen of that item
item - the item

hideNotify

public static void hideNotify(Item item)
Calls hide notify on the specified item.

Parameters:
item - the item

hideNotify

public static void hideNotify(Item item)
Calls hide notify on the specified item.

Parameters:
item - the item

setWordNotFound

public static void setWordNotFound(TextField field,
                                   Alert alert)
Set the word-not-found box in the textfield

Parameters:
field - the textfield
alert - the alert

setWordNotFound

public static void setWordNotFound(TextField field,
                                   Alert alert)
Set the word-not-found box in the textfield

Parameters:
field - the textfield
alert - the alert

setCycling

public static void setCycling(Container container,
                              boolean cycling)
Specifies if the given contain is allowed to cycle through its items.

Parameters:
container - the container
cycling - true, if cycling should be allowed, otherwise false

setCycling

public static void setCycling(FramedForm form,
                              boolean cycling)
Specifies if the given FramedForm is allowed to cycle through its items. Needs polish.FramedForm.allowCycling to be set to true.

Parameters:
form - the FramedForm
cycling - true, if cycling should be allowed, otherwise false

getContentX

public static int getContentX(Screen screen)
Retrieves the horizontal content start for the given screen.

Parameters:
screen - the screen
Returns:
the horizontal start position in pixels from the left, -1 when it is unknown

getContentY

public static int getContentY(Screen screen)
Retrieves the vertical content start for the given screen.

Parameters:
screen - the screen
Returns:
the vertical start position in pixels from the top, -1 when it is unknown

getContentWidth

public static int getContentWidth(Screen screen)
Retrieves the horizontal content width for the given screen.

Parameters:
screen - the screen
Returns:
the horizontal content width in pixels, -1 when it is unknown

getContentHeight

public static int getContentHeight(Screen screen)
Retrieves the vertical content width for the given screen.

Parameters:
screen - the screen
Returns:
the vertical content width in pixels, -1 when it is unknown

getContentX

public static int getContentX(Screen screen)
Retrieves the horizontal content start for the given screen.

Parameters:
screen - the screen
Returns:
the horizontal start position in pixels from the left, -1 when it is unknown

getContentY

public static int getContentY(Screen screen)
Retrieves the vertical content start for the given screen.

Parameters:
screen - the screen
Returns:
the vertical start position in pixels from the top, -1 when it is unknown

getContentWidth

public static int getContentWidth(Screen screen)
Retrieves the horizontal content width for the given screen.

Parameters:
screen - the screen
Returns:
the horizontal content width in pixels, -1 when it is unknown

getContentHeight

public static int getContentHeight(Screen screen)
Retrieves the vertical content width for the given screen.

Parameters:
screen - the screen
Returns:
the vertical content width in pixels, -1 when it is unknown

setEventHandled

public void setEventHandled(CustomItem item)
Notifies the specified CustomItem that a key or pointer event has been processed and that it should not be processed by other components. This is useful when overriding keyPressed, keyReleased, keyRepeated or pointerPressed in CustomItems - these methods do not have a return value that indicates if the event has been handled by the CustomItem. In J2ME Polish there are protected boolean handleKeyPressed(int keyCode, int gameAction ) etc methods for this purpose, however in a CustomItem these will call protected void keyPressed(int keyCode) etc. To abort processing of the event, you either have to call invalidate(), repaint() or UiAccess.setEventHandled( CustomItem item )

Parameters:
item - the CustomItem which just handled an user input event within keyPressed/keyReleased/pointerPressed/etc.

getTextFieldSymbols

public static List getTextFieldSymbols()
Initializes the symbols list and returns it

Returns:
the symbols list

setEventHandled

public void setEventHandled(CustomItem item)
Notifies the specified CustomItem that a key or pointer event has been processed and that it should not be processed by other components. This is useful when overriding keyPressed, keyReleased, keyRepeated or pointerPressed in CustomItems - these methods do not have a return value that indicates if the event has been handled by the CustomItem. In J2ME Polish there are protected boolean handleKeyPressed(int keyCode, int gameAction ) etc methods for this purpose, however in a CustomItem these will call protected void keyPressed(int keyCode) etc. To abort processing of the event, you either have to call invalidate() or UiAccess.setEventHandled( CustomItem item )

Parameters:
item - the CustomItem which just handled an user input event within keyPressed/keyReleased/pointerPressed/etc.

emitKeyPress

public static void emitKeyPress(int keyCode)
Simulates a keyPressed event. The event will be forwarded to the current screen.

Parameters:
keyCode - the keyCode

emitKeyRepeated

public static void emitKeyRepeated(int keyCode)
Simulates a keyRepeated event. The event will be forwarded to the current screen.

Parameters:
keyCode - the keyCode

emitGameActionPress

public static void emitGameActionPress(int gameAction)
Simulates a keyPressed event. The event will be forwarded to the current screen.

Parameters:
gameAction - the game action that should be triggered, e.g. Canvas.DOWN or Canvas.FIRE

emitKeyRelease

public static void emitKeyRelease(int keyCode)
Simulates a keyReleased event. The event will be forwarded to the current screen.

Parameters:
keyCode - the keyCode

emitGameActionRelease

public static void emitGameActionRelease(int gameAction)
Simulates a keyReleased event. The event will be forwarded to the current screen.

Parameters:
gameAction - the game action that should be triggered, e.g. Canvas.DOWN or Canvas.FIRE

cast

public static Command cast(Command cmd)
Casts the given MIDP command into a J2ME Polish command

Parameters:
cmd - the command
Returns:
the casted command

cast

public static Command cast(Command cmd)
Casts the given J2ME Polish command into a MIDP command

Parameters:
cmd - the command
Returns:
the casted command

cast

public static CommandListener cast(CommandListener cmd)
Casts the given MIDP CommandListener into a J2ME Polish CommandListener

Parameters:
cmd - the CommandListener
Returns:
the casted CommandListener

cast

public static CommandListener cast(CommandListener cmd)
Casts the given J2ME Polish CommandListener into a MIDP CommandListener

Parameters:
cmd - the CommandListener
Returns:
the casted CommandListener

cast

public static Displayable cast(Displayable disp)
Casts the given MIDP Displayable into a J2ME Polish Displayable

Parameters:
disp - the displayable
Returns:
the casted displayable

cast

public static Displayable cast(Displayable disp)
Casts the given J2ME Polish Displayable into a MIDP Displayable

Parameters:
disp - the displayable
Returns:
the casted displayable

cast

public static Item cast(Item item)
Casts the given LCDUI item into a J2ME Polish item

Parameters:
item - the LCDUI item
Returns:
the corresponding J2ME Polish item, null when no cast is possible

cast

public static Item cast(Item item)
Casts the given J2ME Polish item into a LCDUI item

Parameters:
item - the J2ME Polish item
Returns:
the corresponding LCDUI item, null when no cast is possible

cast

public static Item[] cast(Item[] items)
Casts the given LCDUI items into J2ME Polish items

Parameters:
items - the LCDUI items
Returns:
the corresponding J2ME Polish item, null when no cast is possible

cast

public static Item[] cast(Item[] items)
Casts the given J2ME Polish items into a LCDUI items

Parameters:
items - the J2ME Polish items
Returns:
the corresponding LCDUI item, null when no cast is possible

setScreenOrientation

public static void setScreenOrientation(Screen screen,
                                        int degrees)
Deprecated. use setScreenOrientation(int degress) instead

Sets the screen orientation in 90 degrees steps. The preprocessing variable "polish.ScreenOrientationCanChangeManually" needs to be set to "true" for supporting this mode.

Parameters:
screen - the screen
degrees - the screen orientation in degrees: 90, 180, 270 or 0
See Also:
setScreenOrientation(int)

setScreenOrientation

public static void setScreenOrientation(int degrees)
Sets the screen orientation in 90 degrees steps. The preprocessing variable "polish.ScreenOrientationCanChangeManually" needs to be set to "true" for supporting this mode.

Parameters:
degrees - the screen orientation in degrees: 90, 180, 270 or 0

setScreenOrientation

public static void setScreenOrientation(Screen screen,
                                        int degrees)
Deprecated. use setScreenOrientation(int degress) instead

Sets the screen orientation in 90 degrees steps.

Parameters:
screen - the screen
degrees - the screen orientation in degrees: 90, 180, 270 or 0
See Also:
setScreenOrientation(int)

isSoftKeyLeft

public static boolean isSoftKeyLeft(int keyCode,
                                    Screen screen)
Determines whether the given key code is the left soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyRight

public static boolean isSoftKeyRight(int keyCode,
                                     Screen screen)
Determines whether the given key code is the right soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyMiddle

public static boolean isSoftKeyMiddle(int keyCode,
                                      Screen screen)
Determines whether the given key code is the middle soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the middle soft key

isSoftKey

public static boolean isSoftKey(int keyCode,
                                Screen screen)
Determines whether the given key code is a soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the middle soft key

isSoftKeyLeft

public static boolean isSoftKeyLeft(int keyCode,
                                    int gameAction,
                                    Screen screen)
Determines whether the given key code is the left soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyRight

public static boolean isSoftKeyRight(int keyCode,
                                     int gameAction,
                                     Screen screen)
Determines whether the given key code is the right soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyMiddle

public static boolean isSoftKeyMiddle(int keyCode,
                                      int gameAction,
                                      Screen screen)
Determines whether the given key code is the middle soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the middle soft key

isSoftKey

public static boolean isSoftKey(int keyCode,
                                int gameAction,
                                Screen screen)
Determines whether the given key code is a soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the middle soft key

isSoftKeyLeft

public static boolean isSoftKeyLeft(int keyCode,
                                    Screen screen)
Determines whether the given key code is the left soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyRight

public static boolean isSoftKeyRight(int keyCode,
                                     Screen screen)
Determines whether the given key code is the right soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyMiddle

public static boolean isSoftKeyMiddle(int keyCode,
                                      Screen screen)
Determines whether the given key code is the middle soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the middle soft key

isSoftKey

public static boolean isSoftKey(int keyCode,
                                Screen screen)
Determines whether the given key code is the middle soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
screen - the screen
Returns:
true when the given key is the middle soft key

isSoftKeyLeft

public static boolean isSoftKeyLeft(int keyCode,
                                    int gameAction,
                                    Screen screen)
Determines whether the given key code is the left soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyRight

public static boolean isSoftKeyRight(int keyCode,
                                     int gameAction,
                                     Screen screen)
Determines whether the given key code is the right soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the right soft key

isSoftKeyMiddle

public static boolean isSoftKeyMiddle(int keyCode,
                                      int gameAction,
                                      Screen screen)
Determines whether the given key code is the middle soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the middle soft key

isSoftKey

public static boolean isSoftKey(int keyCode,
                                int gameAction,
                                Screen screen)
Determines whether the given key code is a soft key for the given screen. If the screen is rotated, the key detection might also change.

Parameters:
keyCode - the keyCode value
gameAction - the corresponding game action
screen - the screen
Returns:
true when the given key is the middle soft key

isGameActionFire

public static boolean isGameActionFire(int keyCode,
                                       int gameAction,
                                       Screen screen)
Determines whether the given key is really a Canvas.FIRE game action

Parameters:
keyCode - the key code
gameAction - the game action
screen - the screen
Returns:
true when the gameAction is Canvas.FIRE and the given key is not '5' or a soft key

isGameActionFire

public static boolean isGameActionFire(int keyCode,
                                       int gameAction,
                                       Screen screen)
Determines whether the given key is really a Canvas.FIRE game action

Parameters:
keyCode - the key code
gameAction - the game action
screen - the screen
Returns:
true when the gameAction is Canvas.FIRE and the given key is not '5' or a soft key

setMenuBarStyle

public static void setMenuBarStyle(Screen screen)
Set the style of the specified screen's menubar. A full style is only applied when the external menubar is used, set the preprocessing variable polish.MenuBar.useExtendedMenuBar to true for this. Specify the style with a //#style preprocessing directive, e.g.
 //#style newMenuBarStyle
 UiAccess.setMenuBarStyle( myScreen );
 

Parameters:
screen - the screen

setMenuBarStyle

public static void setMenuBarStyle(Screen screen,
                                   Style style)
Set the style of the specified screen's menubar. A full style is only applied when the external menubar is used, set the preprocessing variable polish.MenuBar.useExtendedMenuBar to true for this.

Parameters:
screen - the screen
style - the style

setMenuBarStyle

public static void setMenuBarStyle(Screen screen)
Set the style of the specified screen's menubar. A full style is only applied when the external menubar is used, set the preprocessing variable polish.MenuBar.useExtendedMenuBar to true for this. Specify the style with a //#style preprocessing directive, e.g.
 //#style newMenuBarStyle
 UiAccess.setMenuBarStyle( myScreen );
 

Parameters:
screen - the screen

setMenuBarStyle

public static void setMenuBarStyle(Screen screen,
                                   Style style)
Set the style of the specified screen's menubar. A full style is only applied when the external menubar is used, set the preprocessing variable polish.MenuBar.useExtendedMenuBar to true for this.

Parameters:
screen - the screen
style - the style

getText

public static String getText(Item item)
Retrieves text from a J2ME Polish item.

Parameters:
item - the item
Returns:
the text within the item, e.g. a StringItem or a TextField

getText

public static String getText(Item item)
Retrieves text from a J2ME Polish item.

Parameters:
item - the item
Returns:
the text within the item, e.g. a StringItem or a TextField

getTitleHeight

public static int getTitleHeight(Screen screen)
Determines the height of the title of the specified screen. This gives only a result after the screen has been shown.

Parameters:
screen - the screen
Returns:
the screen's title height or 0 when the the screen has not been initialized or J2ME Polish is not used in fullscreen mode

getTitleHeight

public static int getTitleHeight(Screen screen)
Determines the height of the title of the specified screen. This gives only a result after the screen has been shown.

Parameters:
screen - the screen
Returns:
the screen's title height or 0 when the the screen has not been initialized or J2ME Polish is not used in fullscreen mode

setItemScreen

public static void setItemScreen(Item item,
                                 Screen screen)
Sets the 'screen' property of the specified item to the given item

Parameters:
item - the item
screen - the screen

setItemScreen

public static void setItemScreen(Item item,
                                 Screen screen)
Sets the 'screen' property of the specified item to the given item

Parameters:
item - the item
screen - the screen

delete

public static boolean delete(Form form,
                             Item item)
Deletes the specified item from the form

Parameters:
form - the form
item - the item that should be deleted
Returns:
true when the delete was successful

delete

public static boolean delete(Form form,
                             Item item)
Deletes the specified item from the form

Parameters:
form - the form
item - the item that should be deleted
Returns:
true when the delete was successful

getTitleItem

public static Item getTitleItem(Screen screen)
Retrieves the title of the specified screen as an Item

Parameters:
screen - the screen
Returns:
the screen's title as an Item
See Also:
setTitle(Screen, Item), setTitle(Screen, Item, Style)

getTitleItem

public static Item getTitleItem(Screen screen)
Retrieves the title of the specified screen as an Item

Parameters:
screen - the screen
Returns:
the screen's title as an Item
See Also:
setTitle(javax.microedition.lcdui.Screen, Item), setTitle(javax.microedition.lcdui.Screen, javax.microedition.lcdui.Item)

setTextEffect

public static void setTextEffect(StringItem item,
                                 TextEffect effect)
Specifies a new text effect for the specified string item. Note that this method is only accessible when you use the 'text-effect' CSS property in your polish.css.

Parameters:
item - the string item
effect - the effect that should be applied

setTextEffect

public static void setTextEffect(StringItem item,
                                 TextEffect effect)
Specifies a new text effect for the specified string item. Note that this method is only accessible when you use the 'text-effect' CSS property in your polish.css.

Parameters:
item - the string item
effect - the effect that should be applied

fireEvent

public static void fireEvent(String name,
                             Screen screen,
                             Object data)
Fires an event for the specified screen and all its components. This is typically used for triggering animations within screen components like its title or menubar. Since all screen components fire events, this method should be called within a background thread and never from within a de.enough.polish.event.EventListener.

Parameters:
name - the name of the event
screen - the source of the event
data - the event's data, can be null
See Also:
fireEventForTitleAndMenubar(String, Screen, Object)

fireEventForTitleAndMenubar

public static void fireEventForTitleAndMenubar(String name,
                                               Screen screen,
                                               Object data)
Fires an event for the title and menubar of the specified screen. This is typically used for triggering animations for the title and/or menubar. Since all these screen components fire events, this method should be called within a background thread and never from within a de.enough.polish.event.EventListener. This method is not cycling through all screen components and its subcomponents, so it is a multitude faster than UiAccess.fireEvent( String name, Screen screen, Object data ).

Parameters:
name - the name of the event
screen - the source of the event
data - the event's data, can be null

fireEvent

public static void fireEvent(String name,
                             Item item,
                             Object data)
Fires an event for the specified item and all its subitems. This is typically used for triggering animations within item components like ChoiceItems within a ChoiceGroup, etc. Since all subitem fire events, this method should be called within a background thread and never from within a de.enough.polish.event.EventListener.

Parameters:
name - the name of the event
item - the source of the event
data - the event's data, can be null

fireEvent

public static void fireEvent(String name,
                             Screen screen,
                             Object data)
Fires an event for the specified screen and all its components. This is typically used for triggering animations within screen components like its title or menubar. Since all screen components fire events, this method should be called within a background thread and never from within a de.enough.polish.event.EventListener.

Parameters:
name - the name of the event
screen - the source of the event
data - the event's data, can be null

fireEventForTitleAndMenubar

public static void fireEventForTitleAndMenubar(String name,
                                               Screen screen,
                                               Object data)
Fires an event for the title and menubar of the specified screen. This is typically used for triggering animations for the title and/or menubar. Since all these screen components fire events, this method should be called within a background thread and never from within a de.enough.polish.event.EventListener.

Parameters:
name - the name of the event
screen - the source of the event
data - the event's data, can be null
See Also:
fireEventForTitleAndMenubar(String, javax.microedition.lcdui.Screen, Object)

fireEvent

public static void fireEvent(String name,
                             Item item,
                             Object data)
Fires an event for the specified item and all its subitems. This is typically used for triggering animations within item components like ChoiceItems within a ChoiceGroup, etc. Since all subitem fire events, this method should be called within a background thread and never from within a de.enough.polish.event.EventListener. This method is not cycling through all screen components and its subcomponents, so it is a multitude faster than UiAccess.fireEvent( String name, Screen screen, Object data ).

Parameters:
name - the name of the event
item - the source of the event
data - the event's data, can be null

getScreenContainer

public static Container getScreenContainer(Screen screen)
Retrieves the container of the screen. Note that this might be null on some screens.

Parameters:
screen - the screen
Returns:
the container belonging to the given screen

getScreenContainer

public static Container getScreenContainer(Screen screen)
Retrieves the container of the screen. Note that this might be null on some screens.

Parameters:
screen - the screen
Returns:
the container belonging to the given screen

getPaintLock

public static Object getPaintLock(Screen screen)
Retrieves the lock object for the paint thread. You can use this paint lock to synchronize with the paint method of the specified screen.

Parameters:
screen - the screen for which the paint lock should be retrieved.
Returns:
the paint lock object

getPaintLock

public static Object getPaintLock(Screen screen)
Retrieves the lock object for the paint thread. You can use this paint lock to synchronize with the paint method of the specified screen.

Parameters:
screen - the screen for which the paint lock should be retrieved.
Returns:
the paint lock object

init

public static void init(Item item,
                        int firstLineWidth,
                        int availWidth,
                        int availHeight)
Intializes the specified item with the specified dimensions

Parameters:
item - the item
firstLineWidth - the first line width
availWidth - the available width
availHeight - the available height

init

public static void init(Item item,
                        int firstLineWidth,
                        int availWidth,
                        int availHeight)
Intializes the specified item with the specified dimensions

Parameters:
item - the item
firstLineWidth - the first line width
availWidth - the available width
availHeight - the available height

init

public static void init(Screen screen)
Intializes the specified screen

Parameters:
screen - the screen

notifyItemPressedStart

public static void notifyItemPressedStart(Item item)
Makes the notifyItemPressedStart method publicly available.

Parameters:
item - the item which is pressed

notifyItemPressedStart

public static void notifyItemPressedStart(Item item)
Makes the notifyItemPressedStart method publicly available.

Parameters:
item - the item which is pressed

notifyItemPressedEnd

public static void notifyItemPressedEnd(Item item)
Makes the notifyItemPressedEnd method publicly available.

Parameters:
item - the item which is not pressed anymore

notifyItemPressedEnd

public static void notifyItemPressedEnd(Item item)
Makes the notifyItemPressedEnd method publicly available.

Parameters:
item - the item which is not pressed anymore

setNoNewLine

public static void setNoNewLine(TextField textField,
                                boolean noNewLine)
Set if the textfield should accept the enter key as an input which results in a new line.

Parameters:
textField - the text field
noNewLine - set if new lines should be ignored

setNoNewLine

public static void setNoNewLine(TextField textField,
                                boolean noNewLine)
Set if the textfield should accept the enter key as an input which results in a new line.

Parameters:
textField - the text field
noNewLine - set if new lines should be ignored

enableScreenChangeAnimations

public static void enableScreenChangeAnimations(boolean enable)
Enables or disables screen change animations

Parameters:
enable - true if screen change animations should be run otherwise false

enableScreenChangeAnimation

public static void enableScreenChangeAnimation(Screen screen,
                                               boolean enable)
Enables or disables screen change animations for the specified screen

Parameters:
screen - the screen
enable - true if screen change animations should be run otherwise false

enableScreenChangeAnimation

public static void enableScreenChangeAnimation(Screen screen,
                                               boolean enable)
Enables or disables screen change animations for the specified screen

Parameters:
screen - the screen
enable - true if screen change animations should be run otherwise false

setUserInputValidator

public static void setUserInputValidator(Display.UserInputValidator validator)
Sets the key validator for the current display. MUST be set after first Display.getDisplay().

Parameters:
validator - the key validator

repaint

public static void repaint(Item item)
Repaints the specified item

Parameters:
item - the item

repaint

public static void repaint(Item item)
Repaints the specified item

Parameters:
item - the item

setUiEventListener

public static void setUiEventListener(Screen screen,
                                      UiEventListener listener)
Sets an UiEventListener for the specified screen and its items.

Parameters:
screen - the screen
listener - the listener, use null to remove a listener

setUiEventListener

public static void setUiEventListener(Item item,
                                      UiEventListener listener)
Sets an UiEventListener for the specified item and its children.

Parameters:
item - the item for which the listener should be registered
listener - the listener, use null to remove a listener

getUiEventListener

public static UiEventListener getUiEventListener(Screen screen)
Retrieves an UiEventListener for the specified screen and its items.

Parameters:
screen - the screen
Returns:
the listener or null

getUiEventListener

public static UiEventListener getUiEventListener(Item item)
Retrieves an UiEventListener for the specified item

Parameters:
item - the item
Returns:
the listener of the item or one of its parents or null

setUiEventListener

public static void setUiEventListener(Screen screen,
                                      UiEventListener listener)
Sets an UiEventListener for the specified screen and its items.

Parameters:
screen - the screen
listener - the listener, use null to remove a listener

setUiEventListener

public static void setUiEventListener(Item item,
                                      UiEventListener listener)
Sets an UiEventListener for the specified item and its children.

Parameters:
item - the item for which the listener should be registered
listener - the listener, use null to remove a listener

getUiEventListener

public static UiEventListener getUiEventListener(Screen screen)
Retrieves an UiEventListener for the specified screen and its items.

Parameters:
screen - the screen
Returns:
the listener or null

getUiEventListener

public static UiEventListener getUiEventListener(Item item)
Retrieves an UiEventListener for the specified item

Parameters:
item - the item
Returns:
the listener of the item or one of its parents or null