danger.ui
Class BatteryStatusView

java.lang.Object
  extended by danger.app.Listener
      extended by danger.ui.View
          extended by danger.ui.BatteryStatusView


public class BatteryStatusView
extends View

This view displays the current battery charge information, as seen in the top right of the title bar.


Field Summary
 
Fields inherited from class danger.ui.View
DEFAULT_SCROLL_FOCUS_MARGIN, FOCUS_DEFAULT, FOCUS_DOWNWARD, FOCUS_FROM_NOWHERE, FOCUS_LEFTWARD, FOCUS_NONE, FOCUS_RIGHTWARD, FOCUS_UPWARD, HEIGHT_AUTO, HEIGHT_FILL_TO_BOTTOM, HEIGHT_FILL_TO_TOP, HEIGHT_MATCH_CONTROL, HEIGHT_PERCENTAGE, POSITION_ABOVE, POSITION_ALIGN_BASELINE, POSITION_ALIGN_BOTTOM, POSITION_ALIGN_HORIZONTALLY, POSITION_ALIGN_LEFT, POSITION_ALIGN_PARENT_BOTTOM, POSITION_ALIGN_PARENT_RIGHT, POSITION_ALIGN_PARENT_TOP, POSITION_ALIGN_RIGHT, POSITION_ALIGN_TOP, POSITION_ALIGN_VERTICALLY, POSITION_BELOW, POSITION_BELOW_GROUP_BOX_HEADING, POSITION_CENTER_HORIZONTALLY, POSITION_CENTER_VERTICALLY, POSITION_TO_LEFT, POSITION_TO_RIGHT, PREFER_DIRECTION_NONE, PREFER_HORIZONTAL_DIRECTION, PREFER_VERTICAL_DIRECTION, STATE_AT_AND_SPACE_PAGE, STATE_CAN_FOCUS, STATE_DEBUG_BOUNDS, STATE_ENABLED, STATE_FOCUSED, STATE_MAKE_DING, STATE_PARTIAL_FOCUS_OK, STATE_TRANSPARENT, STATE_VISIBLE, WIDTH_AUTO, WIDTH_FILL_TO_LEFT, WIDTH_FILL_TO_RIGHT, WIDTH_MATCH_CONTROL, WIDTH_PERCENTAGE
 
Constructor Summary
BatteryStatusView()
          Construct an instance of BatteryStatusView.
 
Method Summary
 void invalidate()
          Cause this View to be repainted at the earliest opportunity, provided it is VISIBLE and not entirely obscured.
 void paint(Pen pen)
          Draw the contents of this View.
 boolean receiveEvent(Event event)
          Entry point for event processing.
 void setHeight(int height)
          BatteryStatusViews are fixed size.
 void setInChooser(boolean inChooser)
          This poorly-named method affects which bitmaps and colors are used.
 void setSize(int width, int height)
          BatteryStatusViews are fixed size.
 void setWidth(int width)
          BatteryStatusViews are fixed size.
protected static void update()
          Deprecated. For internal use only.
 
Methods inherited from class danger.ui.View
boundsIntersect, boundsIntersect, canLoseFocus, clear, clear, copyStyle, disable, enable, eventKeyDown, eventKeyHeld, eventKeyRepeat, eventKeyUp, eventPeriodicPulse, eventRawKeyDown, eventRawKeyHeld, eventRawKeyRepeat, eventRawKeyUp, eventShortcut, eventWidgetDown, eventWidgetHeld, eventWidgetUp, getAcceptFocus, getBackgroundColor, getBottom, getBounds, getBounds, getData, getFocusTraversalDirection, getFocusTraversalFrom, getFocusTraversalPolicy, getFrame, getFrame, getGlobalBottom, getGlobalLeft, getGlobalRight, getGlobalTop, getHeight, getID, getInterestingRect, getInterestingRect, getLabelFont, getLabelFont, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getParentContainer, getPartialFocusOK, getRight, getScrollFocusMargin, getSibling, getState, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, globalToLocalH, globalToLocalV, hide, invalidate, invalidate, invalidateIndependentOfOrigin, invalidateIndependentOfOrigin, isEnabled, isFocusable, isFocused, isObscured, isOnScreen, isTransparent, isVisible, isVisibleInHierarchy, isVisibleOnScreen, justSetVisible, localToGlobal, localToGlobal, localToGlobalH, localToGlobalV, localToWindow, loseFocus, moveBy, notifyWhenFocusChanges, notifyWhenObscurityChanges, notifyWhenParentSizeChanges, notifyWhenPositionChanges, notifyWhenSizeChanges, notifyWhenVisibilityChanges, offsetOrigin, offsetOrigin, onAddedToParent, onDecoded, onEnabledStateChanged, onHide, onPeriodicPulse, onPositionChanged, onRemovedFromParent, onShortcut, onShortcut, onShortcutConsumed, onShow, onSizeChanged, onStyleChanged, onSystemFontChanged, onViewFocusChanged, onViewObscurityChanged, onViewPositionChanged, onViewSizeChanged, onViewVisibilityChanged, onWindowPaint, pageToEnd, pageToHome, playLimitSound, receiveEventInternal, resetOrigin, sendEventToWindow, setAcceptFocus, setAtAndSpacePage, setBackground, setBackgroundColor, setBottom, setData, setDebugBounds, setDynamicHeight, setDynamicPosition, setDynamicWidth, setEnabled, setFocusTraversalDirection, setFocusTraversalFrom, setFocusTraversalPolicy, setFrame, setKeyedValue, setLabelFont, setLeft, setMakeLimitNoise, setOrigin, setOrigin, setPartialFocusOK, setPosition, setPreferredDirection, setRight, setScrollFocusMargin, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setTransparent, setVisible, setWindow, shouldDropEvent, show, showContextMenu, styleIsDefault, swapStyleColors, takeFocus, willFocusWithin, willFocusWithin, windowToLocal
 
Methods inherited from class danger.app.Listener
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatteryStatusView

public BatteryStatusView()
Construct an instance of BatteryStatusView.

Method Detail

setSize

public void setSize(int width,
                    int height)
BatteryStatusViews are fixed size. It is not valid to call setSize on one.

Overrides:
setSize in class View

setWidth

public void setWidth(int width)
BatteryStatusViews are fixed size. It is not valid to call setWidth on one.

Overrides:
setWidth in class View

setHeight

public void setHeight(int height)
BatteryStatusViews are fixed size. It is not valid to call setHeight on one.

Overrides:
setHeight in class View

paint

public void paint(Pen pen)
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.

The implementation of this method in this class will merely call clear() pen, if this View is opaque (not transparent), and will do nothing otherwise. If you don't need this behavior, then there is no point in calling super.paint() in an overriding method.

Overrides:
paint in class View
Parameters:
pen - non-null; the pen to use for drawing operations

receiveEvent

public boolean receiveEvent(Event event)
Description copied from class: Listener
Entry point for event processing. This method is called from a Dispatcher when it reads an Event in its queue that is targetted at this instance. This base class implementation handles event methods as specified by the eventMethod keyword in .rsrc files. If you override this method, be sure to call super.receiveEvent.

Overrides:
receiveEvent in class Listener
Parameters:
event - non-null; the event to process
Returns:
whether (true) or not (false) this method actually handled the event to completion

update

protected static void update()
Deprecated. For internal use only.


setInChooser

public void setInChooser(boolean inChooser)
This poorly-named method affects which bitmaps and colors are used. If inChooser is true, then the battery status view is drawn as in the title bar during normal use. If inChooser is false, then it is drawn with a white outline, as in the key guard screen.


invalidate

public void invalidate()
Description copied from class: View
Cause this View to be repainted at the earliest opportunity, provided it is VISIBLE and not entirely obscured.

Overrides:
invalidate in class View