danger.ui
Class DateTimeEditor

java.lang.Object
  |
  +--danger.app.Listener
        |
        +--danger.ui.View
              |
              +--danger.ui.Container
                    |
                    +--danger.ui.Control
                          |
                          +--danger.ui.DateTimeEditor

public class DateTimeEditor
extends Control


Field Summary
static int kFormat_DateLong
           
static int kFormat_DateMedium
           
static int kFormat_DateShort
           
static int kFormat_None
           
static int kFormat_TimeLong
           
protected  StaticText mAMPMTextView
           
protected  StaticText mCommaTextView
           
protected  danger.internal.Date mDate
           
protected  StaticText mDayTextView
           
protected  int mFormat
           
protected  StaticText mHourTextView
           
protected  Alarm mKeyInputAlarm
           
protected  java.lang.String mKeyString
           
protected  int mLastKeyTime
           
protected  danger.internal.Date mMaxDate
           
protected  danger.internal.Date mMinDate
           
protected  StaticText mMinuteTextView
           
protected  StaticText mMonthTextView
           
protected  StaticText mYearTextView
           
protected static int STD_HEIGHT
           
protected static int STD_WIDTH
           
 
Fields inherited from class danger.ui.Control
mValue
 
Fields inherited from class danger.ui.View
mOriginX, mOriginY, mStyle, STATE_CAN_FOCUS, STATE_DEBUG_BOUNDS, STATE_ENABLED, STATE_FOCUSED, STATE_TRANSPARENT, STATE_VISIBLE
 
Constructor Summary
DateTimeEditor()
           
DateTimeEditor(danger.internal.Date inDate)
           
DateTimeEditor(danger.internal.Date inDate, int inFormat)
           
 
Method Summary
protected  void adjustPickerWindow(PickerWindow pw, View inAlignView)
           
 void disable()
           
protected  void drawBackground(Pen p, Rect inRect)
           
 void enable()
           
 void enforceLimitsAndUpdate()
           
protected  void enforceMaxLimit()
           
protected  void enforceMinLimit()
           
 boolean eventKeyDown(char c, Event event)
           
 boolean eventKeyUp(char c, Event event)
          Processes key releases directed at this container.
 boolean eventWidgetDown(int widget, Event event)
          Handle the pressing of a device widget
 boolean eventWidgetUp(int widget, Event event)
          Handle the release of a device widget
 danger.internal.Date getDate()
           
protected  java.lang.String getMonthString()
           
protected  java.lang.String getMonthString(int inMonth)
           
protected  void layoutDate()
           
protected  void layoutTime()
           
 void limitToDangerEpoch()
           
 void limitToUnixEpoch()
           
 void max(danger.internal.Date inMaxDate)
           
 void min(danger.internal.Date inMinDate)
           
 void paint(Pen p)
          Draw the contents of this View.
 boolean receiveEvent(Event e)
          Entry point for event processing.
protected  void reflowDateLayout(int inAmount)
           
 void setDate(danger.internal.Date inDate)
           
 void setFormat(int inFormat)
           
 void setSize(int inWidth, int inHeight)
           
protected  void showAMPMPicker()
           
protected  void showDayPicker()
           
protected  void showHourPicker()
           
protected  void showMinutePicker()
           
protected  void showMonthPicker()
           
protected  void showYearPicker()
           
protected  void update()
           
 
Methods inherited from class danger.ui.Control
drawFocusBox, drawIdleBox, drawIdleBox, getEvent, getEventListener, getEventType, getHasBorder, getString, getTitle, getValue, sendEvent, setEvent, setEvent, setEvent, setEvent, setEvent, setEventListener, setHasBorder, setTitle, setValue
 
Methods inherited from class danger.ui.Container
addChild, addChild, addChildAt, advanceFocus, childCount, childIsOnScreen, eventKeyHeld, eventKeyRepeat, eventPeriodicPulse, eventShortcut, eventWidgetHeld, getBottomChild, getChildAt, getChildIndex, getChildWithID, getDescendantWithID, getFirstChild, getFirstFocusableChild, getFocusedChild, getLastChild, getLastFocusableChild, hideAllChildren, loseFocus, moveChildToIndex, paintChildren, reflowChildren, removeAllChildren, removeChild, reverseFocus, setFocusedChild, setFocusedChild, setWindow, showAllChildren, snapToChildren, takeFocus
 
Methods inherited from class danger.ui.View
clear, copyStyle, getAcceptFocus, getBackgroundColor, getBottom, getBounds, getBounds, getFrame, getFrame, getHeight, getInterestingRect, getInterestingRect, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getRight, getSibling, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, hide, invalidate, invalidate, invalidate, isEnabled, isFocusable, isFocused, isOnScreen, isTransparent, isVisible, keepRectInView, localToGlobal, localToGlobal, localToWindow, moveBy, offsetOrigin, offsetOrigin, onAddedToParent, onDecoded, onPeriodicPulse, onRemovedFromParent, onStyleChanged, onWindowPaint, receiveEventInternal, resetOrigin, sendEventToWindow, setAcceptFocus, setBackgroundColor, setBottom, setDebugBounds, setEnabled, setFrame, setHeight, setKeyedValue, setLeft, setOrigin, setOrigin, setPosition, setRight, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setTransparent, setVisible, setWidth, shouldDropEvent, show, styleIsDefault, willFocusWithin, windowToLocal
 
Methods inherited from class danger.app.Listener
cancelEvents, sendEvent, sendEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mDate

protected danger.internal.Date mDate

mMaxDate

protected danger.internal.Date mMaxDate

mMinDate

protected danger.internal.Date mMinDate

mFormat

protected int mFormat

mLastKeyTime

protected int mLastKeyTime

mKeyString

protected java.lang.String mKeyString

mKeyInputAlarm

protected Alarm mKeyInputAlarm

mMonthTextView

protected StaticText mMonthTextView

mDayTextView

protected StaticText mDayTextView

mYearTextView

protected StaticText mYearTextView

mHourTextView

protected StaticText mHourTextView

mMinuteTextView

protected StaticText mMinuteTextView

mAMPMTextView

protected StaticText mAMPMTextView

mCommaTextView

protected StaticText mCommaTextView

kFormat_None

public static final int kFormat_None

kFormat_DateShort

public static final int kFormat_DateShort

kFormat_DateMedium

public static final int kFormat_DateMedium

kFormat_DateLong

public static final int kFormat_DateLong

kFormat_TimeLong

public static final int kFormat_TimeLong

STD_HEIGHT

protected static final int STD_HEIGHT

STD_WIDTH

protected static final int STD_WIDTH
Constructor Detail

DateTimeEditor

public DateTimeEditor()

DateTimeEditor

public DateTimeEditor(danger.internal.Date inDate)

DateTimeEditor

public DateTimeEditor(danger.internal.Date inDate,
                      int inFormat)
Method Detail

setDate

public void setDate(danger.internal.Date inDate)

setFormat

public void setFormat(int inFormat)

getDate

public danger.internal.Date getDate()

enforceLimitsAndUpdate

public void enforceLimitsAndUpdate()

enable

public void enable()
Overrides:
enable in class Container

disable

public void disable()
Overrides:
disable in class Container

layoutDate

protected void layoutDate()

layoutTime

protected void layoutTime()

reflowDateLayout

protected void reflowDateLayout(int inAmount)

update

protected void update()

setSize

public void setSize(int inWidth,
                    int inHeight)
Overrides:
setSize in class View

receiveEvent

public boolean receiveEvent(Event e)
Description copied from class: Listener
Entry point for event processing. Default behaviour is to do nothing and return false. Normally this method is called from a Dispatcher when it discovers an Event in its queue that is targetted at this Listener.
Overrides:
receiveEvent in class Container

adjustPickerWindow

protected void adjustPickerWindow(PickerWindow pw,
                                  View inAlignView)

showMonthPicker

protected void showMonthPicker()

showDayPicker

protected void showDayPicker()

showYearPicker

protected void showYearPicker()

showHourPicker

protected void showHourPicker()

showMinutePicker

protected void showMinutePicker()

showAMPMPicker

protected void showAMPMPicker()

getMonthString

protected java.lang.String getMonthString()

getMonthString

protected java.lang.String getMonthString(int inMonth)

paint

public void paint(Pen p)
Description copied from class: View
Draw the contents of this View. This method is called by the graphics system when the View needs to be repainted. A Pen will be provided which is appropriately clipped and translated for drawing on this View.
Overrides:
paint in class Container

drawBackground

protected final void drawBackground(Pen p,
                                    Rect inRect)

eventKeyUp

public boolean eventKeyUp(char c,
                          Event event)
Description copied from class: Container
Processes key releases directed at this container.
Overrides:
eventKeyUp in class Container
Following copied from class: danger.ui.Container
Parameters:
c - the character being released.

eventKeyDown

public boolean eventKeyDown(char c,
                            Event event)
Overrides:
eventKeyDown in class Container

eventWidgetUp

public boolean eventWidgetUp(int widget,
                             Event event)
Description copied from class: Container
Handle the release of a device widget
Overrides:
eventWidgetUp in class Container
Following copied from class: danger.ui.Container
Parameters:
inWidget - the widget that went down
Returns:
whether or not the event was consumed

eventWidgetDown

public boolean eventWidgetDown(int widget,
                               Event event)
Description copied from class: Container
Handle the pressing of a device widget
Overrides:
eventWidgetDown in class Container
Following copied from class: danger.ui.Container
Parameters:
inWidget - the widget that went up
Returns:
whether or not the event was consumed

max

public final void max(danger.internal.Date inMaxDate)

min

public final void min(danger.internal.Date inMinDate)

limitToUnixEpoch

public final void limitToUnixEpoch()

limitToDangerEpoch

public final void limitToDangerEpoch()

enforceMinLimit

protected final void enforceMinLimit()

enforceMaxLimit

protected final void enforceMaxLimit()


Danger Confidential. Copyright © 2000-2003, Danger Inc.