de.enough.polish.ui
Class FramedForm

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by de.enough.polish.ui.Canvas
              extended by de.enough.polish.ui.Screen
                  extended by de.enough.polish.ui.Form
                      extended by de.enough.polish.ui.FramedForm
All Implemented Interfaces:
Animatable, CycleListener, Displayable, UiElement
Direct Known Subclasses:
KeyboardView

public class FramedForm
extends Form
implements CycleListener

Allows to split up a form into several frames.

The main frame is used for the normal content. Additional frames can be used for keeping GUI elements always in the same position, regardless whether the form is scrolled.

Copyright (c) Enough Software 2005 - 2011

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
protected  boolean allowCycling
           
protected  Container bottomFrame
           
protected  Container currentlyActiveContainer
           
static int FRAME_BOTTOM
          the frame positioned at the bottom
static int FRAME_CENTER
          the frame positioned at the center (the scrollable view)
static int FRAME_LEFT
          the frame positioned at the left
static int FRAME_RIGHT
          the frame positioned at the right
static int FRAME_TOP
          the frame positioned at the top
protected  Container leftFrame
           
protected  Container rightFrame
           
protected  Container topFrame
           
 
Fields inherited from class de.enough.polish.ui.Screen
background, backgroundHeight, backgroundWidth, backgroundX, backgroundY, border, container, contentBackground, contentBackgroundAnchor, contentBackgroundHeight, contentBackgroundWidth, contentBgBorder, contentBorder, contentHeight, contentWidth, contentX, contentY, cssSelector, enableScreenChangeAnimation, fullScreenHeight, ignoreRepaintRequests, infoHeight, isAnimated, isInitRequested, isRepaintRequested, isScrollBackground, itemStateListener, keyPressedProcessed, keyReleasedProcessed, landscapeStyle, lastAnimateTime, lastInteractionTime, lastTriggeredCommand, menuBarHeight, originalScreenHeight, paintScrollBarOnRightSide, portraitStyle, previousScreenOverlayBackground, repaintPreviousScreen, screenHeight, screenStateListener, screenWidth, scrollBar, scrollBarVisible, style, subTitleHeight, title, titleHeight, triggerReleasedKeyCode, triggerReleasedTime, userEventRepaintRegion
 
Fields inherited from class de.enough.polish.ui.Canvas
_commands, DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP
 
Fields inherited from interface de.enough.polish.ui.CycleListener
DIRECTION_BOTTOM_TO_TOP, DIRECTION_LEFT_TO_RIGHT, DIRECTION_RIGHT_TO_LEFT, DIRECTION_TOP_TO_BOTTOM
 
Constructor Summary
FramedForm(String title)
          Creates a new FramedForm
FramedForm(String title, Style style)
          Creates a new FramedForm
 
Method Summary
protected  void adjustContentArea(int x, int y, int width, int height, Container cont)
          Subclasses may override this to adjust the content area of a screen.
 void animate(long currentTime, ClippingRegion repaintRegion)
          Animates this screen.
 void append(int frameOrientation, Item item)
          Adds the given item to the specified frame.
 void append(int frameOrientation, Item item)
          Adds the given item to the specified frame.
 void append(int frameOrientation, Item item, Style itemStyle)
          Adds the given item to the specified frame.
 int append(Item item)
          Adds an Item into the Form.
protected  boolean checkForRequestInit(Item source)
          Checks if this screen's content area should be refreshed when the specified item has changed it's size.
 void delete(int frameOrientation, int itemNum)
          Removes the given item from the specified frame.
 void deleteAll()
          Deletes all the items from all frames of this FramedForm, leaving it with zero items.
 void deleteAll(int frameOrientation)
          Removes all items from the specified frame.
 boolean deleteFrame(int frameOrientation)
          Deletes a complete frame.
 void destroy()
          Destroys the screen
 void focus(Item item, boolean force)
          Focuses the specified item.
 void focus(Item item, boolean force, boolean keepCurrentFrame)
          Focuses the specified item and optionally keeps the current frame focused
 void focusByAction(int gameAction, Container cont)
          Focuses the first resp.
 Item getCurrentItem()
          Retrieves the currently focused item.
 Container getFrame(int x, int y)
          Looks up the frame around the given position
 Item getItemAt(int x, int y)
          Locates and returns the item at the given coordinate.
protected  Item[] getRootItems()
          Retrieves all root-items of this screen.
protected  boolean handleCommand(Command cmd)
          Tries to handle the specified command.
protected  boolean handleKeyPressed(int keyCode, int gameAction)
          Handles the key-pressed event.
protected  boolean handleKeyReleased(int keyCode, int gameAction)
          Handles the key-released event.
protected  boolean handleKeyRepeated(int keyCode, int gameAction)
          Handles the key-repeated event.
protected  boolean handlePointerDragged(int x, int y, ClippingRegion repaintRegion)
          Handles the dragging/movement of a pointer.
protected  boolean handlePointerPressed(int x, int y)
          Handles the pressing of a pointer.
protected  boolean handlePointerReleased(int x, int y)
          Handles the release of a pointer.
 boolean handlePointerTouchDown(int x, int y)
          Handles a touch down/press event.
 boolean handlePointerTouchUp(int x, int y)
          Handles a touch up/release event.
 boolean onCycle(Item item, int direction)
          Notifies the listener about a cycle action.
protected  void paintScreen(Graphics g)
          Paints the screen.
 void releaseResources()
          Releases all (memory intensive) resources such as images or RGB arrays of this item.
 void set(int frameOrientation, int itemNumber, Item item)
          Updates an existing item in the specified frame
 void set(int frameOrientation, int itemNum, Item item)
          Updates an existing item in the specified frame
 void set(int itemNumber, Item item)
          Updates an existing item in the content frame
protected  void setActiveFrame(Container newFrame, boolean keepMainFocus)
          Activates another frame.
protected  void setActiveFrame(Container newFrame, boolean keepMainFocus, int direction)
          Activates another frame.
 void setActiveFrame(int frameOrientation)
          Focuses the specified frame.
 void setActiveFrame(int frameOrientation, boolean keepMainFocus)
          Focuses the specified frame while optionally keeping the focus on the main content frame.
 void setFrameStyle(int frameOrientation)
          Sets a style for the specified frame programmatically.
 void setFrameStyle(int frameOrientation, Style style)
          Sets the style for the specified frame programmatically
protected  void setItemCommands(ArrayList commandsList, Item item)
          Sets the commands of the given item
 void setItemStateListener(ItemStateListener iListener)
          Sets the ItemStateListener for the Screen, replacing any previous ItemStateListener.
 void setStyle(Style style)
          Sets the style of this screen.
 void setStyle(Style style, boolean resetStyle)
          Sets the style with animatable CSS attributes of this user interface element.
 int size(int frameOrientation)
          Retrieves the size of the specified frame.
 void sizeChanged(int width, int height)
          Adjusts the size of this screen.
 
Methods inherited from class de.enough.polish.ui.Form
append, append, append, append, append, append, createCssSelector, delete, get, insert, insert, insert, set, set, size
 
Methods inherited from class de.enough.polish.ui.Screen
_keyPressed, _keyReleased, _keyRepeated, _pointerDragged, _pointerPressed, _pointerReleased, addCommand, addCommand, addCommand, addCommandSeparator, addCommandSeparator, addCommandsLayer, addPermanentNativeItem, addRelativeToContentRegion, addRepaintArea, addSubCommand, addSubCommand, animate, calculateContentArea, callCommandListener, canScrollDown, canScrollUp, clearItemCommands, closeMenu, commandAction, fireEvent, fireEventForTitleAndMenubar, focus, focus, focus, focus, getAvailableHeight, getCommandItem, getCommandListener, getCommands, getCurrentIndex, getDefaultCommand, getKeyStates, getMenuBar, getNativeScreen, getPaintLock, getPolishTicker, getRootContainer, getScreenContentHeight, getScreenContentWidth, getScreenContentX, getScreenContentY, getScreenData, getScreenFullHeight, getScreenFullWidth, getScreenHeight, getScreenInitializerListener, getScreenStyle, getScrollBarWidth, getScrollDownBackgroundOffset, getScrollHeight, getScrollUpBackgroundOffset, getScrollYOffset, getStyle, getSubTitleItem, getTitle, getTitleHeight, getTitleItem, getUiEventListener, handleCommand, handlePointerDragged, handlePointerReleasedOutsideScreenArea, hideNotify, init, initContent, isActive, isGameActionFire, isInteracted, isKeyboardAccessible, isMenuOpened, isNativeUiShownFor, isSoftKey, isSoftKey, isSoftKeyLeft, isSoftKeyMiddle, isSoftKeyRight, notifyDefaultCommand, notifyFocusSet, notifyScreenStateChanged, notifyStateListener, paint, paintBackgroundAndBorder, paintMenuBar, paintScrollBar, paintTitleAndSubtitle, removeAllCommands, removeCommand, removeCommandsLayer, removeItemCommands, removePermanentNativeItem, removeSubCommand, requestInit, requestRepaint, requestRepaint, resetStyle, scrollRelative, scrollToBottom, setCommandListener, setCommandListener, setFullScreenMode, setInfo, setInfo, setItemStateListener, setLastInteractionTime, setMenuBarStyle, setMenuItemStyle, setNativeScreen, setPolishTicker, setPolishTicker, setRootContainer, setScreenData, setScreenInitializerListener, setScreenOrientation, setScreenStateListener, setScrollYOffset, setSubTitle, setTitle, setTitle, setTitle, setTitle, setUiEventListener, showNotify, toString
 
Methods inherited from class de.enough.polish.ui.Canvas
_hideNotify, _hideNotifyExternal, _showNotify, getGameAction, getHeight, getKeyCode, getKeyName, getWidth, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotifyExternal, isDoubleBuffered, isShown, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, setTicker
 
Methods inherited from class javax.microedition.lcdui.Canvas
repaint, repaint, serviceRepaints
 
Methods inherited from class javax.microedition.lcdui.Displayable
getTicker, removeCommand, setTicker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FRAME_TOP

public static final int FRAME_TOP
the frame positioned at the top

See Also:
Constant Field Values

FRAME_BOTTOM

public static final int FRAME_BOTTOM
the frame positioned at the bottom

See Also:
Constant Field Values

FRAME_LEFT

public static final int FRAME_LEFT
the frame positioned at the left

See Also:
Constant Field Values

FRAME_RIGHT

public static final int FRAME_RIGHT
the frame positioned at the right

See Also:
Constant Field Values

FRAME_CENTER

public static final int FRAME_CENTER
the frame positioned at the center (the scrollable view)

See Also:
Constant Field Values

leftFrame

protected Container leftFrame

rightFrame

protected Container rightFrame

topFrame

protected Container topFrame

bottomFrame

protected Container bottomFrame

allowCycling

protected boolean allowCycling

currentlyActiveContainer

protected Container currentlyActiveContainer
Constructor Detail

FramedForm

public FramedForm(String title)
Creates a new FramedForm

Parameters:
title - the title of this form

FramedForm

public FramedForm(String title,
                  Style style)
Creates a new FramedForm

Parameters:
title - the title of this form
style - the style of this form, usually set with a #style directive
Method Detail

getFrame

public Container getFrame(int x,
                          int y)
Looks up the frame around the given position

Parameters:
x - the absolute x position
y - the absolute y position
Returns:
the frame of the specified position, might be null

getItemAt

public Item getItemAt(int x,
                      int y)
Description copied from class: Screen
Locates and returns the item at the given coordinate.

Overrides:
getItemAt in class Screen
Parameters:
x - horizontal position in pixels
y - vertical position in pixels
Returns:
the found item or null when no item is at the specific coordinate

focus

public void focus(Item item,
                  boolean force)
Description copied from class: Screen
Focuses the specified item.

Overrides:
focus in class Screen
Parameters:
item - the item which is already shown on this screen.
force - true when the item should be focused even when it is inactive (like a label for example)

focus

public void focus(Item item,
                  boolean force,
                  boolean keepCurrentFrame)
Focuses the specified item and optionally keeps the current frame focused

Parameters:
item - the item
force - when the item should be focused even when it is not interactive
keepCurrentFrame - true when the currently active container should keep its focus

deleteAll

public void deleteAll()
Deletes all the items from all frames of this FramedForm, leaving it with zero items. This method does nothing if the FramedForm is already empty.

Overrides:
deleteAll in class Form
Since:
MIDP 2.0

deleteAll

public void deleteAll(int frameOrientation)
Removes all items from the specified frame.

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

append

public int append(Item item)
Description copied from class: Form
Adds an Item into the Form. The newly added Item becomes the last Item in the Form, and the size of the Form grows by one. This method is only provided for being able to add native items as well as custom items to a J2ME Polish form within an IDE.

Overrides:
append in class Form
Parameters:
item - the Item to be added.
Returns:
the assigned index of the Item

set

public void set(int frameOrientation,
                int itemNumber,
                Item item)
Updates an existing item in the specified frame

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
itemNumber - the index of the previous item
item - the new item
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

set

public void set(int itemNumber,
                Item item)
Updates an existing item in the content frame

Overrides:
set in class Form
Parameters:
itemNumber - the index of the previous item
item - the new item

append

public void append(int frameOrientation,
                   Item item)
Adds the given item to the specified frame.

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
item - the item
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

setItemStateListener

public void setItemStateListener(ItemStateListener iListener)
Sets the ItemStateListener for the Screen, replacing any previous ItemStateListener. If iListener is null, simply removes the previous ItemStateListener.

Overrides:
setItemStateListener in class Screen
Parameters:
iListener - the new listener, or null to remove it

append

public void append(int frameOrientation,
                   Item item)
Adds the given item to the specified frame.

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
item - the item
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

set

public void set(int frameOrientation,
                int itemNum,
                Item item)
Updates an existing item in the specified frame

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
itemNum - the index of the previous item
item - the new item
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

delete

public void delete(int frameOrientation,
                   int itemNum)
Removes the given item from the specified frame. The itemNum parameter must be within the range [0..size()-1], inclusive.

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
itemNum - the index of the item
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

size

public int size(int frameOrientation)
Retrieves the size of the specified frame.

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
Returns:
the size of the frame, -1 when the frame does not exist
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

deleteFrame

public boolean deleteFrame(int frameOrientation)
Deletes a complete frame.

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
Returns:
true when the frame could be deleted
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

append

public void append(int frameOrientation,
                   Item item,
                   Style itemStyle)
Adds the given item to the specified frame.

Parameters:
frameOrientation - either FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT or FRAME_CENTER for the content frame.
item - the item
itemStyle - the style for that item, is ignored when null
See Also:
FRAME_TOP, FRAME_BOTTOM, FRAME_LEFT, FRAME_RIGHT, FRAME_CENTER

adjustContentArea

protected void adjustContentArea(int x,
                                 int y,
                                 int width,
                                 int height,
                                 Container cont)
Description copied from class: Screen
Subclasses may override this to adjust the content area of a screen. The default implementation informs a ScreenInitializerListener

Overrides:
adjustContentArea in class Screen
Parameters:
x - the contentX field
y - the contentY field
width - the contentWidth field
height - the contentHeight field
cont - the container, may be null
See Also:
Screen.setScreenInitializerListener(ScreenInitializerListener)

checkForRequestInit

protected boolean checkForRequestInit(Item source)
Description copied from class: Screen
Checks if this screen's content area should be refreshed when the specified item has changed it's size.

Overrides:
checkForRequestInit in class Screen
Parameters:
source - the source of the event
Returns:
true when the source is a directly visible element (default container or title, for example)

paintScreen

protected void paintScreen(Graphics g)
Description copied from class: Screen
Paints the screen. This method also needs to set the protected variables paintScrollIndicator, paintScrollIndicatorUp and paintScrollIndicatorDown.

Overrides:
paintScreen in class Screen
Parameters:
g - the graphics on which the screen should be painted
See Also:
Screen.contentX, Screen.contentY, Screen.contentWidth, Screen.contentHeight, Screen.paintScrollIndicator, Screen.paintScrollIndicatorUp, Screen.paintScrollIndicatorDown

handleKeyPressed

protected boolean handleKeyPressed(int keyCode,
                                   int gameAction)
Description copied from class: Screen
Handles the key-pressed event. Please note, that implementation should first try to handle the given key-code, before the game-action is processed.

Overrides:
handleKeyPressed in class Screen
Parameters:
keyCode - the code of the pressed key, e.g. Canvas.KEY_NUM2
gameAction - the corresponding game-action, e.g. Canvas.UP
Returns:
true when the key-event was processed

focusByAction

public void focusByAction(int gameAction,
                          Container cont)
Focuses the first resp. last element of the container depending on the direction of the frame change

Parameters:
gameAction - the game action
cont - the container

handleKeyReleased

protected boolean handleKeyReleased(int keyCode,
                                    int gameAction)
Description copied from class: Screen
Handles the key-released event. Please note, that implementation should first try to handle the given key-code, before the game-action is processed.

Overrides:
handleKeyReleased in class Screen
Parameters:
keyCode - the code of the released key, e.g. Canvas.KEY_NUM2
gameAction - the corresponding game-action, e.g. Canvas.UP
Returns:
true when the key-event was processed

handleKeyRepeated

protected boolean handleKeyRepeated(int keyCode,
                                    int gameAction)
Description copied from class: Screen
Handles the key-repeated event. Please note, that implementation should first try to handle the given key-code, before the game-action is processed.

Overrides:
handleKeyRepeated in class Screen
Parameters:
keyCode - the code of the repeated key, e.g. Canvas.KEY_NUM2
gameAction - the corresponding game-action, e.g. Canvas.UP
Returns:
true when the key-event was processed

handleCommand

protected boolean handleCommand(Command cmd)
Description copied from class: Screen
Tries to handle the specified command. The default implementation forwards the call to the container. When the container is unable to process the command, it will be forwarded to an external command listener that has been set using setCommandListener(..)

Overrides:
handleCommand in class Screen
Parameters:
cmd - the command
Returns:
true when the command has been handled by this screen

getCurrentItem

public Item getCurrentItem()
Retrieves the currently focused item.

Overrides:
getCurrentItem in class Screen
Returns:
the currently focused item, null when none is focused.

setActiveFrame

public void setActiveFrame(int frameOrientation)
Focuses the specified frame.

Parameters:
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT, Graphics.RIGHT or -1 for the main/scrollable frame

setActiveFrame

public void setActiveFrame(int frameOrientation,
                           boolean keepMainFocus)
Focuses the specified frame while optionally keeping the focus on the main content frame.

Parameters:
frameOrientation - either Graphics.TOP, Graphics.BOTTOM, Graphics.LEFT, Graphics.RIGHT or -1 for the main/scrollable frame
keepMainFocus - true when the focus should be kept on the main container at the same time.

setActiveFrame

protected void setActiveFrame(Container newFrame,
                              boolean keepMainFocus)
Activates another frame.

Parameters:
newFrame - the next frame
keepMainFocus - true when the focus should be kept on the main container at the same time.

setActiveFrame

protected void setActiveFrame(Container newFrame,
                              boolean keepMainFocus,
                              int direction)
Activates another frame.

Parameters:
newFrame - the next frame
keepMainFocus - true when the focus should be kept on the main container at the same time.
direction - the direction that should be used. e.g. Canvas.UP, DOWN

handlePointerPressed

protected boolean handlePointerPressed(int x,
                                       int y)
Description copied from class: Screen
Handles the pressing of a pointer. This method should be overwritten only when the polish.hasPointerEvents preprocessing symbol is defined. When the screen could handle the pointer pressing, it needs to return true. The default implementation returns the result of calling the container's handlePointerPressed-method

Overrides:
handlePointerPressed in class Screen
Parameters:
x - the absolute x position of the pointer pressing
y - the absolute y position of the pointer pressing
Returns:
true when the pressing of the pointer was actually handled by this screen.

handlePointerDragged

protected boolean handlePointerDragged(int x,
                                       int y,
                                       ClippingRegion repaintRegion)
Description copied from class: Screen
Handles the dragging/movement of a pointer. This method should be overwritten only when the polish.hasPointerEvents preprocessing symbol is defined. When the screen could handle the pointer drag event, it needs to return true. The default implementation returns the result of calling the container's handlePointerDragged-method

Overrides:
handlePointerDragged in class Screen
Parameters:
x - the absolute x position of the pointer movement
y - the absolute y position of the pointer movement
Returns:
true when the dragging of the pointer was actually handled by this screen.

handlePointerReleased

protected boolean handlePointerReleased(int x,
                                        int y)
Description copied from class: Screen
Handles the release of a pointer. This method should be overwritten only when the polish.hasPointerEvents preprocessing symbol is defined. When the screen could handle the pointer release, it needs to return true. The default implementation returns the result of calling the container's handlePointerReleased-method

Overrides:
handlePointerReleased in class Screen
Parameters:
x - the absolute x position of the pointer release
y - the absolute y position of the pointer release
Returns:
true when releasing the pointer was actually handled by this screen.

handlePointerTouchDown

public boolean handlePointerTouchDown(int x,
                                      int y)
Description copied from class: Screen
Handles a touch down/press event. This is similar to a pointerPressed event, however it is only available on devices with screens that differentiate between press and touch events (read: BlackBerry Storm).

Overrides:
handlePointerTouchDown in class Screen
Parameters:
x - the absolute horizontal pixel position of the touch event
y - the absolute vertical pixel position of the touch event
Returns:
true when the event was handled

handlePointerTouchUp

public boolean handlePointerTouchUp(int x,
                                    int y)
Description copied from class: Screen
Handles a touch up/release event. This is similar to a pointerReleased event, however it is only available on devices with screens that differentiate between press and touch events (read: BlackBerry Storm).

Overrides:
handlePointerTouchUp in class Screen
Parameters:
x - the absolute horizontal pixel position of the touch event
y - the absolute vertical pixel position of the touch event
Returns:
true when the event was handled

animate

public void animate(long currentTime,
                    ClippingRegion repaintRegion)
Description copied from class: Screen
Animates this screen. Subclasses can override this method to create animations. All embedded items are also animated.

Specified by:
animate in interface Animatable
Overrides:
animate in class Screen
Parameters:
currentTime - the current time in milliseconds
repaintRegion - the repaint area that needs to be updated when this item is animated
See Also:
Item.addRelativeToContentRegion(ClippingRegion, int, int, int, int)

getRootItems

protected Item[] getRootItems()
Description copied from class: Screen
Retrieves all root-items of this screen. The root items are those in first hierarchy, in a Form this is a Container for example. The default implementation does return an empty array, since apart from the container no additional items are used. Subclasses which use more root items than the container needs to override this method.

Overrides:
getRootItems in class Screen
Returns:
the root items an array, the array can be empty but not null.

setStyle

public void setStyle(Style style)
Description copied from class: Screen
Sets the style of this screen.

Specified by:
setStyle in interface UiElement
Overrides:
setStyle in class Screen
Parameters:
style - the style
See Also:
Screen.setStyle(Style, boolean)

setStyle

public void setStyle(Style style,
                     boolean resetStyle)
Description copied from interface: UiElement
Sets the style with animatable CSS attributes of this user interface element.

Specified by:
setStyle in interface UiElement
Overrides:
setStyle in class Screen
Parameters:
style - the new style for this element.
resetStyle - true when style settings should be resetted. This is not the case when styles are animated, for example.

setFrameStyle

public void setFrameStyle(int frameOrientation)
Sets a style for the specified frame programmatically. The style has to be defined using the //#style preprocessing directive, e.g.
 //#style dynamicTopFrame
 framedForm.setFrameOrientation( Graphics.TOP );
 

Parameters:
frameOrientation - the frame, e.g. Graphics.TOP

setFrameStyle

public void setFrameStyle(int frameOrientation,
                          Style style)
Sets the style for the specified frame programmatically

Parameters:
frameOrientation - the frame, e.g. Graphics.TOP
style - the style for the frame

setItemCommands

protected void setItemCommands(ArrayList commandsList,
                               Item item)
Description copied from class: Screen
Sets the commands of the given item

Overrides:
setItemCommands in class Screen
Parameters:
commandsList - the commands that are added
item - the item which contains the specified commands
See Also:
Screen.removeItemCommands(Item)

sizeChanged

public void sizeChanged(int width,
                        int height)
Description copied from class: Screen
Adjusts the size of this screen.

Specified by:
sizeChanged in interface Displayable
Overrides:
sizeChanged in class Screen
Parameters:
width - the new width of the screen
height - the new height of the screen
See Also:
in class Displayable

releaseResources

public void releaseResources()
Description copied from class: Screen
Releases all (memory intensive) resources such as images or RGB arrays of this item. The default implementation does release any background resources. This method must not be called from within a paint call, as this will result in a dead lock.

Overrides:
releaseResources in class Screen

destroy

public void destroy()
Description copied from class: Screen
Destroys the screen

Overrides:
destroy in class Screen

onCycle

public boolean onCycle(Item item,
                       int direction)
Description copied from interface: CycleListener
Notifies the listener about a cycle action.

Specified by:
onCycle in interface CycleListener
Parameters:
item - the item that cycles
direction - the direction
Returns:
true when the cycling can continue, false when the cycling should be aborted.