Just An Application

July 21, 2009

What’s New In MIDP 3.0 ? Part 27: LCDUI – IdleItem

Filed under: Java, JME, LCDUI, MIDP, MIDP3, MIDP3LCDUI — Tags: , , , , , , — Simon Lewis @ 10:41 pm

1. IdleItem

An IdleItem is a UI element which supports MIDlet access to the ‘idle screen’ associated with a Display on a device.

2. Display Support

A Display may not support the use of IdleItems. This can be determined by calling the Display.getCapabilities() method.

3. Functionality

The UI functionality available via IdleItem is equivalent to that of a CustomItem since the IdleItem is a sub-class of the CustomItem class.

The IdleItem class is abstract and must be sub-classed to be used.

4. Getting IdleItem Related UI Characteristics

4.1 Colours

The foreground, background and highlighted foreground and background colours on an idle screen associated with a given Display can be obtained by calling that Display’s

    public int getColor(int colorSpecifier)

method, passing one of the following Display constants

  • COLOR_IDLE_FOREGROUND

  • COLOR_IDLE_BACKGROUND

  • COLOR_IDLE_HIGHLIGHTED_FOREGROUND

  • COLOR_IDLE_HIGHLIGHTED_BACKGROUND

4.2 Fonts

The Fonts for text and highlighted text on an idle screen can be obtained by calling the Font method

    public static Font getFont(int fontSpecifier)

passing the constant

    Font.FONT_IDLE_TEXT

or

    Font.FONT_IDLE_HIGHLIGHTED_TEXT

respectively.

5. Getting The Current IdleItem On A Given Display

A MIDlet can get the IdleItem, if any, currently associated with a given Display by calling that
Display’s

    public IdleItem getIdleItem()

method.

6. Setting The Current IdleItem On A Given Display

A MIDlet can request that an IdleItem should appear on the idle screen associated with a given
Display by calling that Display’s

    public void setIdleItem(IdleItem idleItem)

method.

If there is an existing associated IdleItem it is removed.

The idleItem argument may be null.

It is an error if the Display does not support IdleItems and a DisplayCapabilityException will be thrown.

It is an error if the specified IdleItem is currently associated with another Display and an IllegalStateException.

Note

  • The method documentation actually says that an IllegalStateException will be thrown if

    If the item is already owned by a Form or Display.

    which seems to indicate that it should be possible to add an IdleItem to a Form and that an IdleItem cannot both be a member of a Form and associated with a Display. Presumably the converse also applies.

7. Notification Methods

If after being passed to the Display.setIdleItem(IdleItem) method of a Display
it is added to the idle screen assciated with that Display, then the IdleItem’s

    protected void addedToDisplay(Display display)

method will be called.

If having been added it is subsequently removed from idle screen associated with the
Display then the IdleItem’s

    protected void removedFromDisplay(Display display)

method will be called.


Copyright (c) 2009 By Simon Lewis. All Rights Reserved.

Advertisements

2 Comments »

  1. […] TextEditor is a UI element which can be used in conjunction with a Canvas, CustomItem, or IdleItem to display and obtain text input from the […]

    Pingback by What’s New In MIDP 3.0 ? Part 32: LCDUI – TextEditor « Just An Application — July 23, 2009 @ 7:15 am

  2. […] What’s New In MIDP 3.0 ? Part 33: LCDUI – KeyListener Filed under: JME, Java, LCDUI, MIDP, MIDP3, MIDP3LCDUI — Tags: Java, JME, LCDUI, LCDUIKeyListener, MIDP, MIDP3, MIDP3LCDUI — Simon Lewis @ 7:19 am The KeyListener interface enables an object to listen for key events associated with a Canvas, CustomItem, or IdleItem […]

    Pingback by What’s New In MIDP 3.0 ? Part 33: LCDUI – KeyListener « Just An Application — July 23, 2009 @ 7:19 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: