com.mot.lnf
Interface DateItemLNF


public interface DateItemLNF

Methods needed to customize look and feel of a DateItem. The DateItem is what is used to edit the date portion of a DateField.


Method Summary
 int getDefaultFocus()
          Get the default focus area, one of Calendar.DATE, Calendar.MONTH, Calendar.YEAR
 java.util.Date getEditedDate(javax.microedition.lcdui.Displayable editScreen)
          Get the date value from the edit screen
 javax.microedition.lcdui.Displayable getEditScreen(java.util.Calendar c)
          Get the screen to be used for editing the date.
 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 DateItem.
 

Method Detail

getDefaultFocus

public int getDefaultFocus()
Get the default focus area, one of Calendar.DATE, Calendar.MONTH, Calendar.YEAR
Returns:
the default focus area of the DateItem

getEditedDate

public java.util.Date getEditedDate(javax.microedition.lcdui.Displayable editScreen)
Get the date value from the edit screen
Parameters:
editScreen - the edit screen to retrieve date information
Returns:
Date object containing the date 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 date. Returns null if a separate editing screen is not required
Parameters:
c - Calendar containing date information for this DateItem
Returns:
the screen to use for editing the date

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.DATE, Calendar.MONTH, or Calendar.YEAR
dir - direction to move the focus, one of Canvas.RIGHT or Canvas.LEFT
Returns:
new area that has focus, one of Calendar.DATE, Calendar.MONTH or Calendar.YEAR

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.DATE, Calendar.MONTH, or Calendar.YEAR
x - x location where pointer was released
y - y location where pointer was released
Returns:
new area that has focus, one of Calendar.DATE, Calendar.MONTH or Calendar.YEAR

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 DateItem.
Parameters:
g - Graphics object to use for drawing
c - Calendar containing date information for this DateItem
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.YEAR, Calendar.MONTH, or Calendar.DATE, or 0 to indicate none have focus