de.enough.polish.ui

Class TabbedPane

    • Constructor Detail

      • TabbedPane

        public TabbedPane(java.lang.String title)
        Creates a new, empty TabbedPane, specifying its title.
        Parameters:
        title - the screen's title (see Displayable).
        See Also:
        Displayable.setTitle(String)
      • TabbedPane

        public TabbedPane(java.lang.String title,
                  Style style)
        Creates a new, empty TabbedPane, specifying its title.
        Parameters:
        title - the screen's title (see Displayable).
        style - the design
        See Also:
        Displayable.setTitle(String)
      • TabbedPane

        public TabbedPane(java.lang.String title,
                  Displayable[] tabs,
                  javax.microedition.lcdui.Image[] tabIcons,
                  boolean useTabTitle)
        Creates a new TabbedPane, specifying its title and an array of tab elements and images to be used as its initial content.
        Parameters:
        title - the screen's title (see Displayable).
        tabs - set of tab elements (Screen objects) which will be part of TabbedPane or null.
        tabIcons - set of images which will be part of each tab element.
        useTabTitle - a boolean value representing the state of the screen's title. true - indicates that title will be set according to tab element's title (current tab), ignoring any title set on the TabbedPane object. false - indicates that title will be fixed, set on the TabbedPane object.
        Throws:
        java.lang.NullPointerException - if tabs contains any null elements.
        java.lang.NullPointerException - if tabIcons contains any null elements.
      • TabbedPane

        public TabbedPane(java.lang.String title,
                  Displayable[] tabs,
                  javax.microedition.lcdui.Image[] tabIcons,
                  boolean useTabTitle,
                  Style style)
        Creates a new TabbedPane, specifying its title and an array of tab elements and images to be used as its initial content.
        Parameters:
        title - the screen's title (see Displayable).
        tabs - set of tab elements (Screen objects) which will be part of TabbedPane or null.
        tabIcons - set of images which will be part of each tab element.
        useTabTitle - a boolean value representing the state of the screen's title. true - indicates that title will be set according to tab element's title (current tab), ignoring any title set on the TabbedPane object. false - indicates that title will be fixed, set on the TabbedPane object.
        style - the design
        Throws:
        java.lang.NullPointerException - if tabs contains any null elements.
        java.lang.NullPointerException - if tabIcons contains any null elements.
    • Method Detail

      • addTab

        public void addTab(Displayable tab,
                  javax.microedition.lcdui.Image icon)
        Adds a tab element to the TabbedPane.
        Parameters:
        tab - screen object (tab element) to be added.
        icon - image part of the tab element.
        Throws:
        java.lang.NullPointerException - if either tab or icon is null.
      • addTab

        public void addTab(javax.microedition.lcdui.Displayable tab,
                  javax.microedition.lcdui.Image icon)
      • addTab

        public void addTab(Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text)
        Adds a tab element to the TabbedPane.
        Parameters:
        tab - screen object (tab element) to be added.
        icon - image part of the tab element.
        text - the text that should be shown in the tab
        Throws:
        java.lang.NullPointerException - if either tab is or icon and text are null.
      • addTab

        public void addTab(javax.microedition.lcdui.Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text)
      • addTab

        public void addTab(Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text,
                  Style tabIconStyle)
        Adds a tab element to the TabbedPane.
        Parameters:
        tab - screen object (tab element) to be added.
        icon - image part of the tab element.
        text - the text that should be shown in the tab
        tabIconStyle - the style for tab icon
        Throws:
        java.lang.NullPointerException - if either tab is or icon and text are null.
      • addTab

        public void addTab(javax.microedition.lcdui.Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text,
                  Style tabIconStyle)
      • addTab

        public void addTab(Displayable tab,
                  IconItem iconItem)
        Adds a tab element to the TabbedPane.
        Parameters:
        tab - screen object (tab element) to be added.
        iconItem - the icon item for the tab
        Throws:
        java.lang.NullPointerException - if either tab or iconItem is null.
      • addTab

        public void addTab(javax.microedition.lcdui.Displayable tab,
                  IconItem iconItem)
      • addTab

        public void addTab(Displayable tab,
                  IconItem iconItem,
                  Style tabIconStyle)
        Adds a tab element to the TabbedPane.
        Parameters:
        tab - screen object (tab element) to be added.
        iconItem - the icon item for the tab
        tabIconStyle - the style for tab icon
        Throws:
        java.lang.NullPointerException - if either tab or iconItem is null.
      • addTab

        public void addTab(javax.microedition.lcdui.Displayable tab,
                  IconItem iconItem,
                  Style tabIconStyle)
      • addTabListener

        public void addTabListener(TabListener listener)
        Sets a listener for focus change to this TabbedPane, replacing any previous TabListener. A null reference is allowed and has the effect of removing any existing listener.
        Parameters:
        listener - The new listener or null.
      • setTabListener

        public void setTabListener(TabListener tabListener)
        Sets a listener for focus change to this TabbedPane, replacing any previous TabListener. A null reference is allowed and has the effect of removing any existing listener.
        Parameters:
        tabListener - The new listener or null.
      • setTabbedFormListener

        public void setTabbedFormListener(TabbedFormListener listener)
        Sets the TabbedFormListener to be notified when tab changes happen.
        Parameters:
        listener - the listener that is notified whenever the user selects another tab,
      • insertTab

        public void insertTab(int index,
                     Displayable tab,
                     javax.microedition.lcdui.Image icon)
        Inserts a tab element into the TabbedPane prior to the element specified.
        Parameters:
        index - - the index of the tab where insertion is to occur.
        tab - - the tab object (Screen) to be inserted.
        icon - - the image part of the tab element.
        Throws:
        java.lang.IndexOutOfBoundsException - - if index is invalid.
        java.lang.NullPointerException - - if either tab or icon is null.
      • insertTab

        public void insertTab(int index,
                     javax.microedition.lcdui.Displayable tab,
                     javax.microedition.lcdui.Image icon)
      • insertTab

        public void insertTab(int index,
                     Displayable tab,
                     javax.microedition.lcdui.Image icon,
                     java.lang.String text)
        Inserts a tab element into the TabbedPane prior to the element specified.
        Parameters:
        index - the index of the tab where insertion is to occur.
        tab - the tab object (Screen) to be inserted.
        icon - the image part of the tab element.
        text - the text for the tab
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • insertTab

        public void insertTab(int index,
                     javax.microedition.lcdui.Displayable tab,
                     javax.microedition.lcdui.Image icon,
                     java.lang.String text)
      • insertTab

        public void insertTab(int index,
                     Displayable tab,
                     javax.microedition.lcdui.Image icon,
                     java.lang.String text,
                     Style tabIconStyle)
        Inserts a tab element into the TabbedPane prior to the element specified.
        Parameters:
        index - the index of the tab where insertion is to occur.
        tab - the tab object (Screen) to be inserted.
        icon - the image part of the tab element.
        text - the text for the tab
        tabIconStyle - the style for the tab icon
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • insertTab

        public void insertTab(int index,
                     javax.microedition.lcdui.Displayable tab,
                     javax.microedition.lcdui.Image icon,
                     java.lang.String text,
                     Style tabIconStyle)
      • insertTab

        public void insertTab(int index,
                     Displayable tab,
                     IconItem tabIconItem)
        Inserts a tab element into the TabbedPane prior to the element specified.
        Parameters:
        index - the index of the tab where insertion is to occur.
        tab - the tab object (Screen) to be inserted.
        tabIconItem - the item visualizing the tab
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • insertTab

        public void insertTab(int index,
                     javax.microedition.lcdui.Displayable tab,
                     IconItem tabIconItem)
      • insertTab

        public void insertTab(int index,
                     Displayable tab,
                     IconItem tabIconItem,
                     Style tabIconStyle)
        Inserts a tab element into the TabbedPane prior to the element specified.
        Parameters:
        index - the index of the tab where insertion is to occur.
        tab - the tab object (Screen) to be inserted.
        tabIconItem - the item visualizing the tab
        tabIconStyle - the style for the tab icon
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • insertTab

        public void insertTab(int index,
                     javax.microedition.lcdui.Displayable tab,
                     IconItem tabIconItem,
                     Style tabIconStyle)
      • setTab

        public void setTab(int index,
                  Displayable tab)
        Replaces a tab element at the specified position without changing its icon.
        Parameters:
        index - the index of the tab which should be replaced
        tab - the tab object (Screen) to be inserted.
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • setTab

        public void setTab(int index,
                  javax.microedition.lcdui.Displayable tab)
      • setTab

        public void setTab(int index,
                  Displayable tab,
                  javax.microedition.lcdui.Image icon)
        Replaces a tab element at the specified position
        Parameters:
        index - the index of the tab which should be replaced
        tab - the tab object (Screen) to be inserted.
        icon - the image part of the tab element.
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • setTab

        public void setTab(int index,
                  javax.microedition.lcdui.Displayable tab,
                  javax.microedition.lcdui.Image icon)
      • setTab

        public void setTab(int index,
                  Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text)
        Replaces a tab element at the specified position
        Parameters:
        index - the index of the tab which should be replaced
        tab - the tab object (Screen) to be inserted.
        icon - the image part of the tab element.
        text - the text for the tab
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • setTab

        public void setTab(int index,
                  javax.microedition.lcdui.Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text)
      • setTab

        public void setTab(int index,
                  Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text,
                  Style tabIconStyle)
        Replaces a tab element at the specified position
        Parameters:
        index - the index of the tab which should be replaced
        tab - the tab object (Screen) to be inserted.
        icon - the image part of the tab element.
        text - the text for the tab
        tabIconStyle - the style for the tab icon
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • setTab

        public void setTab(int index,
                  javax.microedition.lcdui.Displayable tab,
                  javax.microedition.lcdui.Image icon,
                  java.lang.String text,
                  Style tabIconStyle)
      • setTab

        public void setTab(int index,
                  Displayable tab,
                  IconItem tabIconItem)
        Replaces a tab element at the specified position
        Parameters:
        index - the index of the tab which should be replaced
        tab - the tab object (Screen) to be inserted.
        tabIconItem - the item visualizing the tab
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • setTab

        public void setTab(int index,
                  javax.microedition.lcdui.Displayable tab,
                  IconItem tabIconItem)
      • setTab

        public void setTab(int index,
                  Displayable tab,
                  IconItem tabIconItem,
                  Style tabIconStyle)
        Replaces a tab element into the TabbedPane at specified position
        Parameters:
        index - the index of the tab which should be replaced
        tab - the tab object (Screen) to be inserted.
        tabIconItem - the item visualizing the tab
        tabIconStyle - the style for the tab icon
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        java.lang.NullPointerException - if either tab or icon is null.
      • setTab

        public void setTab(int index,
                  javax.microedition.lcdui.Displayable tab,
                  IconItem tabIconItem,
                  Style tabIconStyle)
      • setCurrentTab

        public void setCurrentTab(Displayable tab)
        Replaces the current tab element without changing its icon.
        Parameters:
        tab - the tab object (Screen) that should replace the current tab
        Throws:
        java.lang.NullPointerException - if either tab or icon is null.
      • setCurrentTab

        public void setCurrentTab(javax.microedition.lcdui.Displayable tab)
      • setCurrentTab

        public void setCurrentTab(Displayable tab,
                         javax.microedition.lcdui.Image icon)
        Replaces the current tab element.
        Parameters:
        tab - the tab object (Screen) that should replace the current tab
        icon - the image part of the tab element.
        Throws:
        java.lang.IndexOutOfBoundsException - if there is no tab present
        java.lang.NullPointerException - if either tab or icon is null.
      • setCurrentTab

        public void setCurrentTab(javax.microedition.lcdui.Displayable tab,
                         javax.microedition.lcdui.Image icon)
      • setCurrentTab

        public void setCurrentTab(Displayable tab,
                         javax.microedition.lcdui.Image icon,
                         java.lang.String text)
        Replaces the current tab element.
        Parameters:
        tab - the tab object (Screen) that should replace the current tab
        icon - the image part of the tab element.
        text - the text for the tab
        Throws:
        java.lang.IndexOutOfBoundsException - if there is no tab present
        java.lang.NullPointerException - if either tab or icon is null.
      • setCurrentTab

        public void setCurrentTab(javax.microedition.lcdui.Displayable tab,
                         javax.microedition.lcdui.Image icon,
                         java.lang.String text)
      • setCurrentTab

        public void setCurrentTab(Displayable tab,
                         javax.microedition.lcdui.Image icon,
                         java.lang.String text,
                         Style tabIconStyle)
        Replaces the current tab element.
        Parameters:
        tab - the tab object (Screen) that should replace the current tab
        icon - the image part of the tab element.
        text - the text for the tab
        tabIconStyle - the style for the tab icon
        Throws:
        java.lang.IndexOutOfBoundsException - if there is no tab present
        java.lang.NullPointerException - if either tab or icon is null.
      • setCurrentTab

        public void setCurrentTab(javax.microedition.lcdui.Displayable tab,
                         javax.microedition.lcdui.Image icon,
                         java.lang.String text,
                         Style tabIconStyle)
      • setCurrentTab

        public void setCurrentTab(Displayable tab,
                         IconItem tabIconItem)
        Replaces the current tab element.
        Parameters:
        tab - the tab object (Screen) that should replace the current tab
        tabIconItem - the item visualizing the tab
        Throws:
        java.lang.IndexOutOfBoundsException - if there is no tab present
        java.lang.NullPointerException - if either tab or icon is null.
      • setCurrentTab

        public void setCurrentTab(javax.microedition.lcdui.Displayable tab,
                         IconItem tabIconItem)
      • setCurrentTab

        public void setCurrentTab(Displayable tab,
                         IconItem tabIconItem,
                         Style tabIconStyle)
        Replaces the current tab element.
        Parameters:
        tab - the tab object (Screen) that should replace the current tab
        tabIconItem - the item visualizing the tab
        tabIconStyle - the style for the tab icon
        Throws:
        java.lang.IndexOutOfBoundsException - if there is no tab present
        java.lang.NullPointerException - if either tab or icon is null.
      • setCurrentTab

        public void setCurrentTab(javax.microedition.lcdui.Displayable tab,
                         IconItem tabIconItem,
                         Style tabIconStyle)
      • setCurrentTab

        public void setCurrentTab(int tabIndex)
        Sets the focus on a tab element. This method is included for compatibility reasons with TabbedList.
        Parameters:
        tabIndex - the index of the tab element to receive the focus.
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
        See Also:
        setFocus(int)
      • setFocus

        public void setFocus(int tabIndex)
        Sets the focus on a tab element.
        Parameters:
        tabIndex - the index of the tab element to receive the focus.
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
      • setTabIcon

        public void setTabIcon(int index,
                      javax.microedition.lcdui.Image icon)
        Sets the Image part of the tab element referenced by index, replacing the previous image of the tab. This method may also be used to update a tab that was created using a mutable Image; this method should be called with the same Image after its contents have been changed to update the appearance of the tab.
        Parameters:
        index - - the index of the tab element to be set.
        icon - - the new image of the tab element.
        Throws:
        java.lang.IndexOutOfBoundsException - - if index is invalid.
        java.lang.NullPointerException - - if icon is null.
      • removeTab

        public void removeTab(int index)
        Removes a tab element from TabbedPane. If the tab element is being shown on the display, the implementation should update the display as soon as it is feasible to do so.
        Parameters:
        index - the index number of the tab to be removed.
        Throws:
        java.lang.IndexOutOfBoundsException - if index is invalid.
      • getCount

        public int getCount()
        Gets the number of tab elements in the TabbedPane.
        Returns:
        the number of tab elements in the TabbedPane.
      • size

        public int size()
        Gets the number of tab elements in the TabbedPane.
        Returns:
        the number of tab elements in the TabbedPane.
      • getSelectedIndex

        public int getSelectedIndex()
        Returns the index number of a tab element (current tab) in the TabbedPane.
        Returns:
        index of selected tab, or -1 if none.
      • getScreen

        public Screen getScreen(int index)
        Gets the content for the tab references by the given index.
        Parameters:
        index - the index number of the tab to be returned.
        Returns:
        a Screen object (tab element) in the TabbedPane referenced by index, or null if index is invalid or when a Canvas is used.
        See Also:
        getDisplayable(int)
      • getDisplayable

        public Displayable getDisplayable(int index)
        Gets the content for the tab references by the given index.
        Parameters:
        index - the index number of the tab to be returned.
        Returns:
        a Screen object (tab element) in the TabbedPane referenced by index, or null if index is invalid or when a Canvas is used.
      • getTabIcon

        public javax.microedition.lcdui.Image getTabIcon(int index)
        Gets the Image for the tab referenced by the given index.
        Parameters:
        index - the index number of the tab to be queried.
        Returns:
        the image part of the tab referenced by index, or null if index is invalid or when the stored tab is not an IconItem.
      • getTabText

        public java.lang.String getTabText(int index)
        Gets the text for the tab referenced by the given index.
        Parameters:
        index - the index number of the tab to be queried.
        Returns:
        the text part of the tab referenced by index, or null if index is invalid or when the stored tab is not an IconItem.
      • getTabIconItem

        public IconItem getTabIconItem(int index)
        Gets the internal IconItem for the tab referenced by the given index.
        Parameters:
        index - the index number of the tab to be queried.
        Returns:
        the icon item of the tab referenced by index, or null if index is invalid or when the stored tab is not an IconItem.
      • createCssSelector

        protected java.lang.String createCssSelector()
        Description copied from class: Screen
        Retrieves the CSS selector for this screen. The CSS selector is used for the dynamic assignment of styles - that is the styles are assigned by the usage of the screen and not by a predefined style-name. With the #style preprocessing command styles are set in a static way, this method yields in a faster GUI and is recommended. When in a style-sheet dynamic styles are used, e.g. "form>p", than the selector of the screen is needed. This abstract method needs only be implemented, when dynamic styles are used: #ifdef polish.useDynamicStyles
        Specified by:
        createCssSelector in class Screen
        Returns:
        the name of the appropriate CSS Selector for this screen.
      • paintBackgroundAndBorder

        protected void paintBackgroundAndBorder(javax.microedition.lcdui.Graphics g)
        Description copied from class: Screen
        Paints the background and border for this screen.
        Overrides:
        paintBackgroundAndBorder in class Screen
        Parameters:
        g - the graphics context
      • paintMenuBar

        protected void paintMenuBar(javax.microedition.lcdui.Graphics g)
        Description copied from class: Screen
        Paints the menubar, if in fullscreen mode. Also scroll indicators are painted here, in case no scrollbar is being used
        Overrides:
        paintMenuBar in class Screen
        Parameters:
        g - the graphics context
      • paintScrollBar

        protected void paintScrollBar(javax.microedition.lcdui.Graphics g)
        Description copied from class: Screen
        Paints the scrollbar of this screen. Note: from J2ME Polish 2.2 this functionality will move into Item.
        Overrides:
        paintScrollBar in class Screen
        Parameters:
        g - the Graphics context
      • paintTitleAndSubtitle

        protected void paintTitleAndSubtitle(javax.microedition.lcdui.Graphics g)
        Description copied from class: Screen
        Paints the title (if in fullscreen mode) and the subtitle of this screen
        Overrides:
        paintTitleAndSubtitle in class Screen
        Parameters:
        g - the graphics context
      • init

        protected void init(int width,
                int height)
        Description copied from class: Screen
        Initializes this screen before it is painted for the first time.
        Overrides:
        init in class Screen
      • calculateContentArea

        protected void calculateContentArea(int x,
                                int y,
                                int width,
                                int height)
        Description copied from class: Screen
        Calculates and initializes the content area for this screen. Usually no items are painted outside of the specified area. This method knows about the title, subtitle, infoarea and ticker and adjusts the content area accordingly
        Overrides:
        calculateContentArea in class Screen
        Parameters:
        x - left start of the content area, might later be adjusted by an external scrollindicator
        y - top start of the content area, is adjusted by the top margin, title height, subtitle height, info height and maybe ticker height (when the ticker should be painted at the top).
        width - width of the content area, might later be adjusted by an external scrollindicator
        height - height of the content area, is adjusted by the title height, subtitle height, info height and ticker height.
      • setTabbarIsSelectable

        public void setTabbarIsSelectable(boolean isSelectable)
        Allows to specify whether the tabbar can be selected by the user with key events. By default this is not allowed. Note that this configuration method needs to be called before any tabs are added to this pane.
        Parameters:
        isSelectable - false when the tabbar should not be selectable.
      • 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.
      • _keyPressed

        public boolean _keyPressed(int keyCode)
        Description copied from class: Screen
        Handles key events. WARNING: When this method should be overwritten, one need to ensure that super.keyPressed( int ) is called!
        Overrides:
        _keyPressed in class Screen
        Parameters:
        keyCode - The code of the pressed key
        Returns:
        true when the event was handled/consumed
      • _keyRepeated

        public boolean _keyRepeated(int keyCode)
        Description copied from class: Screen
        Just maps the event to the the keyPressed method.
        Overrides:
        _keyRepeated in class Screen
        Parameters:
        keyCode - the code of the key, which is pressed repeatedly
        Returns:
        true when the event was handled/consumed
        See Also:
        Canvas.hasRepeatEvents()
      • _keyReleased

        public boolean _keyReleased(int keyCode)
        Description copied from class: Screen
        Is called when a key is released.
        Overrides:
        _keyReleased in class Screen
        Parameters:
        keyCode - the code of the key, which has been released
        Returns:
        true when the event was handled/consumed
      • _pointerDragged

        public boolean _pointerDragged(int x,
                              int y)
        Description copied from class: Canvas
        Called when the pointer is dragged. For backwards compatibility this method calls pointerDragged(int,int).
        Overrides:
        _pointerDragged in class Screen
        Parameters:
        x - the horizontal location where the pointer was dragged (relative to the Canvas)
        y - the vertical location where the pointer was dragged (relative to the Canvas)
      • _pointerPressed

        public boolean _pointerPressed(int x,
                              int y)
        Description copied from class: Canvas
        Called when the pointer is pressed. For backwards compatibility this method calls pointerPressed(int,int).
        Overrides:
        _pointerPressed in class Screen
        Parameters:
        x - - the horizontal location where the pointer was pressed (relative to the Canvas)
        y - - the vertical location where the pointer was pressed (relative to the Canvas)
      • _pointerReleased

        public boolean _pointerReleased(int x,
                               int y)
        Description copied from class: Canvas
        Called when the pointer is released. For backwards compatibility this method calls pointerReleased(int,int).
        Overrides:
        _pointerReleased in class Screen
        Parameters:
        x - the horizontal location where the pointer was released (relative to the Canvas)
        y - the vertical location where the pointer was released (relative to the Canvas)
      • 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
      • 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
      • notifyScreenStateChanged

        public void notifyScreenStateChanged()
        Description copied from class: Screen
        Notifies the screen state change listener about a change in this screen.
        Overrides:
        notifyScreenStateChanged in class Screen
      • notifyStateListener

        public void notifyStateListener(Item item)
        Description copied from class: Screen
        Adds the given item to the queue for state notifications. The ItemStateListener will be called at the next possibility.
        Overrides:
        notifyStateListener in class Screen
        Parameters:
        item - the item which contents have been edited.
      • hideNotify

        public void hideNotify()
        Description copied from class: Screen
        Unregisters this screen and notifies all items that they will not be shown anymore.
        Overrides:
        hideNotify in class Screen
      • showNotify

        public void showNotify()
        Description copied from class: Screen
        Initialises this screen and informs all items about being painted soon.
        Overrides:
        showNotify in class Screen
      • 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
      • 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
      • getCurrentIndex

        public int getCurrentIndex()
        Description copied from class: Screen
        Retrieves the index of the currently focused item.
        Overrides:
        getCurrentIndex in class Screen
        Returns:
        the index of the currently focused item, -1 when no item has been selected
      • getCurrentItem

        public Item getCurrentItem()
        Description copied from class: Screen
        Retrieves the currently focused item.
        Overrides:
        getCurrentItem in class Screen
        Returns:
        the currently focused item, null when none is focused.
      • setScrollYOffset

        public void setScrollYOffset(int offset,
                            boolean smooth)
        Description copied from class: Screen
        Sets the vertical scrolling offset of this screen.
        Overrides:
        setScrollYOffset in class Screen
        Parameters:
        offset - either the new offset
        smooth - scroll to this new offset smooth if allowed
        See Also:
        Screen.getScrollYOffset()
      • getScrollHeight

        public int getScrollHeight()
        Description copied from class: Screen
        Retrieves this screen's actual content's height
        Overrides:
        getScrollHeight in class Screen
        Returns:
        the content's height, 0 if unknown or not initialized yet
        See Also:
        Screen.getScrollYOffset()
      • getScreenContentWidth

        public int getScreenContentWidth()
        Description copied from class: Screen
        Retrieves the width of the content area.
        Overrides:
        getScreenContentWidth in class Screen
        Returns:
        the width available for the content
      • getScreenContentX

        public int getScreenContentX()
        Description copied from class: Screen
        Retrieves the horizontal start position of the screen's content area
        Overrides:
        getScreenContentX in class Screen
        Returns:
        the horizontal start in pixels from the left
      • getScreenContentY

        public int getScreenContentY()
        Description copied from class: Screen
        Retrieves the vertical start position of the screen's content area
        Overrides:
        getScreenContentY in class Screen
        Returns:
        the vertical start in pixels from the top
      • getRootContainer

        public Container getRootContainer()
        Description copied from class: Screen
        Retrieves the root container of this screen
        Overrides:
        getRootContainer in class Screen
        Returns:
        the root container, this might be null for some subclasses
      • notifyScreenInitialized

        public void notifyScreenInitialized(Screen scr)
        Description copied from interface: ScreenInitializerListener
        Is called after the screen's content has been initialized. The screen will have set the content area by then (contentX, cotentY, contentWidth and contentHeight).
        Specified by:
        notifyScreenInitialized in interface ScreenInitializerListener
        Parameters:
        scr - the screen
      • adjustContentArea

        public void adjustContentArea(Screen scr)
        Description copied from interface: ScreenInitializerListener
        Adjusts the content area of a screen during initialization. The screen will have set the content area (contentX, cotentY, contentWidth and contentHeight).
        Specified by:
        adjustContentArea in interface ScreenInitializerListener
        Parameters:
        scr - the screen that is currently being initialized