danger.ui
Class StaticText

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

public class StaticText
extends Control


Field Summary
static int kHAlignCenter
           
static int kHAlignLeft
           
static int kHAlignRight
           
protected  Font mFont
          Holds the text for the control
 
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
StaticText()
           
StaticText(java.lang.String inText)
           
StaticText(java.lang.String inText, Font inFont)
           
 
Method Summary
 void calcSizeToFit()
           
 boolean eventKeyUp(char inChar, Event event)
          Processes key releases directed at this container.
 boolean eventWidgetUp(int inWhichWidget, Event event)
          Handle the release of a device widget
 void fitTextToWidth()
           
 int getAlignment()
           
 java.lang.String getText()
           
 void paint(Pen p)
          Draw the contents of this View.
 void setAcceptFocus(boolean inCanTakeFocus)
           
 void setAlignment(int flag)
           
 void setFont(Font newFont)
           
 void setText(java.lang.String inText)
           
 
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, disable, enable, eventKeyDown, eventKeyHeld, eventKeyRepeat, eventPeriodicPulse, eventShortcut, eventWidgetDown, eventWidgetHeld, getBottomChild, getChildAt, getChildIndex, getChildWithID, getDescendantWithID, getFirstChild, getFirstFocusableChild, getFocusedChild, getLastChild, getLastFocusableChild, hideAllChildren, loseFocus, moveChildToIndex, paintChildren, receiveEvent, 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, setBackgroundColor, setBottom, setDebugBounds, setEnabled, setFrame, setHeight, setKeyedValue, setLeft, setOrigin, setOrigin, setPosition, setRight, setSize, 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

mFont

protected Font mFont
Holds the text for the control

kHAlignLeft

public static final int kHAlignLeft

kHAlignRight

public static final int kHAlignRight

kHAlignCenter

public static final int kHAlignCenter
Constructor Detail

StaticText

public StaticText()

StaticText

public StaticText(java.lang.String inText)

StaticText

public StaticText(java.lang.String inText,
                  Font inFont)
Method Detail

calcSizeToFit

public void calcSizeToFit()

fitTextToWidth

public void fitTextToWidth()

setAcceptFocus

public void setAcceptFocus(boolean inCanTakeFocus)
Overrides:
setAcceptFocus in class View

setText

public void setText(java.lang.String inText)

getText

public java.lang.String getText()

setFont

public void setFont(Font newFont)

setAlignment

public void setAlignment(int flag)

getAlignment

public int getAlignment()

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

eventWidgetUp

public boolean eventWidgetUp(int inWhichWidget,
                             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

eventKeyUp

public boolean eventKeyUp(char inChar,
                          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.


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