com.mot.lnf
Interface TimeItemLNF


public interface TimeItemLNF

Methods needed to customize look and feel of a TimeItem


Method Summary
 int getDefaultFocus()
          Get the default focus area, one of Calendar.HOUR, Calendar.HOUR_OF_DAY, Calendar.MINUTE or Calendar.AM_PM
 java.util.Date getEditedDate(javax.microedition.lcdui.Displayable editScreen)
          Get the time value from the edit screen
 javax.microedition.lcdui.Displayable getEditScreen(java.util.Calendar c)
          Get the screen to be used for editing the time.
 int getFocus(int currentFocus, int dir)
          Get the new focused area, if the RIGHT or LEFT keys were pressed
 int getFocus(int currentFocus, int x, int y)
          Get the new focused area, when the pointer was released
 int getMinimumHeight()
          Get the minimum height of this component
 int getMinimumWidth()
          Get the minimum width of this component
 int getPreferredHeight(int width)
          Get the preferred height of this component
 int getPreferredWidth(int height)
          Get the preferred width of this component
 void paint(javax.microedition.lcdui.Graphics g, java.util.Calendar c, int width, int height, int focus)
          Method to be used for drawing a TimeItem.
 

Method Detail

getDefaultFocus

public int getDefaultFocus()
Get the default focus area, one of Calendar.HOUR, Calendar.HOUR_OF_DAY, Calendar.MINUTE or Calendar.AM_PM
Returns:
the default focus area of the TimeItem

getEditedDate

public java.util.Date getEditedDate(javax.microedition.lcdui.Displayable editScreen)
Get the time value from the edit screen
Parameters:
editScreen - the edit screen to retrieve time information
Returns:
Date object containing the time set in the edit screen

getEditScreen

public javax.microedition.lcdui.Displayable getEditScreen(java.util.Calendar c)
Get the screen to be used for editing the time. Returns null if a separate editing screen is not required
Parameters:
c - Calendar containing date information for this TimeItem
Returns:
the screen to use for editing the time

getFocus

public int getFocus(int currentFocus,
                    int dir)
Get the new focused area, if the RIGHT or LEFT keys were pressed
Parameters:
currentFocus - the area which currently has focus, one of Calendar.HOUR, Calendar.HOUR_OF_DAY, Calendar.MINUTE or Calendar.AM_PM
dir - direction to move the focus, one of Canvas.RIGHT or Canvas.LEFT
Returns:
new area that has focus, one of Calendar.HOUR, Calendar.HOUR_OF_DAY, Calendar.MINUTE or Calendar.AM_PM

getFocus

public int getFocus(int currentFocus,
                    int x,
                    int y)
Get the new focused area, when the pointer was released
Parameters:
currentFocus - the area which currently has focus, one of Calendar.HOUR, Calendar.HOUR_OF_DAY, Calendar.MINUTE or Calendar.AM_PM
x - x location where pointer was released
y - y location where pointer was released
Returns:
new area that has focus, one of Calendar.HOUR, Calendar.HOUR_OF_DAY, Calendar.MINUTE or Calendar.AM_PM

getMinimumHeight

public int getMinimumHeight()
Get the minimum height of this component
Returns:
minimum height, in pixels

getMinimumWidth

public int getMinimumWidth()
Get the minimum width of this component
Returns:
minimum width, in pixels

getPreferredHeight

public int getPreferredHeight(int width)
Get the preferred height of this component
Parameters:
width - the tentative content width in pixels, or -1 if a tentative width has not been computed
Returns:
preferred height, in pixels

getPreferredWidth

public int getPreferredWidth(int height)
Get the preferred width of this component
Parameters:
height - the tentative content height in pixels, or -1 if a tentative height has not been computed
Returns:
preferred width, in pixels

paint

public void paint(javax.microedition.lcdui.Graphics g,
                  java.util.Calendar c,
                  int width,
                  int height,
                  int focus)
Method to be used for drawing a TimeItem.
Parameters:
g - Graphics object to use for drawing
c - Calendar containing date information for this TimeItem
width - the assigned width of this check box
height - the assigned height of this check box
focus - Integer indicating which portion of the date item has cursor focus. One of Calendar.HOUR, Calendar.MINUTE, or Calendar.AM_PM, or 0 to indicate none have focus