danger.ui
Class ScrollView

java.lang.Object
  |
  +--danger.app.Listener
        |
        +--danger.ui.View
              |
              +--danger.ui.Container
                    |
                    +--danger.ui.ScrollView
Direct Known Subclasses:
ListContainer

public class ScrollView
extends Container


Field Summary
protected  int mThumbHeight
           
protected  int mThumbTop
           
protected  Bitmap mTrackBottom
           
protected  Bitmap mTrackTop
           
 
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
ScrollView()
           
ScrollView(int inLeft, int inTop, int inRight, int inBottom)
           
ScrollView(Rect r)
           
 
Method Summary
 void addChild(View child, int id)
           
protected  boolean advanceFocusOrScroll(int scrollMultiplier)
           
 void calcBottom()
           
protected  void drawScrollbar(Pen p)
           
 boolean eventWidgetDown(int inWhichWidget, Event event)
          Handle the pressing of a device widget
 boolean eventWidgetUp(int inWhichWidget, Event event)
          Handle the release of a device widget
protected  boolean focusChangedTo(View inView, boolean inFromAbove)
           
 int getContentWidth()
           
protected  View getFirstChildBelowTop()
          Return the first child view whose top is at or below the top of the container.
protected  View getFirstVisibleChild()
          Return the first child view that at least partially intersects the vertical bounds of the container.
 boolean getHasScrollbar()
           
protected  View getLastChildAboveBottom()
          Return the child view whose bottom is the lowest but still above the bottom of the container.
 boolean keepRectInView(View inChangingView, Rect inImportantRect)
           
 void offsetOriginAndSelect(int delta)
           
 boolean pageDown()
           
 boolean pageUp()
           
 void paint(Pen p)
          Draw the contents of this View.
 void reflowChildren(View inChangingChild, int inAmount)
           
 void removeAllChildren()
           
protected  boolean reverseFocusOrScroll(int scrollMultiplier)
           
 void setActualHeight(int h)
           
 void setActualSize(int w, int h)
           
 void setActualWidth(int w)
           
 void setHasScrollbar(boolean inHasScrollbar)
           
 void setOrigin(int inX, int inY)
           
 void setScrollDelta(int inDelta)
           
 void setSize(int w, int h)
           
 
Methods inherited from class danger.ui.Container
addChild, addChildAt, advanceFocus, childCount, childIsOnScreen, disable, enable, eventKeyDown, eventKeyHeld, eventKeyRepeat, eventKeyUp, eventPeriodicPulse, eventShortcut, eventWidgetHeld, getBottomChild, getChildAt, getChildIndex, getChildWithID, getDescendantWithID, getFirstChild, getFirstFocusableChild, getFocusedChild, getLastChild, getLastFocusableChild, hideAllChildren, loseFocus, moveChildToIndex, paintChildren, receiveEvent, 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, 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, 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

mThumbHeight

protected int mThumbHeight

mThumbTop

protected int mThumbTop

mTrackTop

protected Bitmap mTrackTop

mTrackBottom

protected Bitmap mTrackBottom
Constructor Detail

ScrollView

public ScrollView()

ScrollView

public ScrollView(Rect r)

ScrollView

public ScrollView(int inLeft,
                  int inTop,
                  int inRight,
                  int inBottom)
Method Detail

reflowChildren

public void reflowChildren(View inChangingChild,
                           int inAmount)
Overrides:
reflowChildren in class Container

addChild

public void addChild(View child,
                     int id)
Overrides:
addChild in class Container

calcBottom

public void calcBottom()

removeAllChildren

public void removeAllChildren()
Overrides:
removeAllChildren in class Container

setSize

public void setSize(int w,
                    int h)
Overrides:
setSize in class View

setActualSize

public void setActualSize(int w,
                          int h)

setActualWidth

public void setActualWidth(int w)

setActualHeight

public void setActualHeight(int h)

eventWidgetDown

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

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

focusChangedTo

protected boolean focusChangedTo(View inView,
                                 boolean inFromAbove)

advanceFocusOrScroll

protected boolean advanceFocusOrScroll(int scrollMultiplier)

offsetOriginAndSelect

public void offsetOriginAndSelect(int delta)

pageUp

public boolean pageUp()

pageDown

public boolean pageDown()

getFirstChildBelowTop

protected View getFirstChildBelowTop()
Return the first child view whose top is at or below the top of the container.

getLastChildAboveBottom

protected View getLastChildAboveBottom()
Return the child view whose bottom is the lowest but still above the bottom of the container.

getFirstVisibleChild

protected View getFirstVisibleChild()
Return the first child view that at least partially intersects the vertical bounds of the container.

reverseFocusOrScroll

protected boolean reverseFocusOrScroll(int scrollMultiplier)

setOrigin

public void setOrigin(int inX,
                      int inY)
Overrides:
setOrigin in class View

keepRectInView

public boolean keepRectInView(View inChangingView,
                              Rect inImportantRect)
Overrides:
keepRectInView in class View

setScrollDelta

public void setScrollDelta(int inDelta)

setHasScrollbar

public void setHasScrollbar(boolean inHasScrollbar)

getHasScrollbar

public boolean getHasScrollbar()

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

drawScrollbar

protected void drawScrollbar(Pen p)

getContentWidth

public int getContentWidth()


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