|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--danger.app.Listener
|
+--danger.ui.View
Some call it a Widget, Gadget, or Component. Here at Danger the basic building block of the UI toolkit is the View. Views describe a rectangular surface upon which drawing may occur with the use of a Pen. The upper left and lower right corners of a View are defined by parent-relative coordinates.
| Field Summary | |
protected int |
mOriginX
|
protected int |
mOriginY
|
protected Style |
mStyle
|
static int |
STATE_CAN_FOCUS
|
static int |
STATE_DEBUG_BOUNDS
|
static int |
STATE_ENABLED
|
static int |
STATE_FOCUSED
|
static int |
STATE_TRANSPARENT
|
static int |
STATE_VISIBLE
|
| Constructor Summary | |
View()
Create a new View with initial position of 0,0 and no width and no height. |
|
View(int left,
int top,
int right,
int bottom)
Create a new View, initially not attached to any parent, with the specified bounds |
|
View(Rect bounds)
Create a new View, initially not attached to any parent, with bounds specified by the provided Rect |
|
| Method Summary | |
void |
addChild(View child)
Add a View as a child to this View. |
boolean |
childIsOnScreen(View child)
|
void |
clear(Pen pen)
|
Style |
copyStyle()
|
void |
disable()
|
void |
enable()
|
boolean |
eventKeyDown(char c,
Event event)
|
boolean |
eventKeyHeld(char c,
Event event)
|
boolean |
eventKeyRepeat(char c,
Event event)
|
boolean |
eventKeyUp(char c,
Event event)
|
boolean |
eventPeriodicPulse(int timestamp)
|
boolean |
eventShortcut(char inKey)
|
boolean |
eventWidgetDown(int widget,
Event event)
|
boolean |
eventWidgetHeld(int widget,
Event event)
|
boolean |
eventWidgetUp(int widget,
Event event)
|
boolean |
getAcceptFocus()
|
int |
getBackgroundColor()
|
int |
getBottom()
|
View |
getBottomChild()
Find the child view that has the lowest bottom bound |
Rect |
getBounds()
Gets the size of this View as a rectangle located at (0, 0) |
Rect |
getBounds(Rect r)
Gets the size of this View as a rectangle located at (0, 0) |
View |
getFirstChild()
Get the first child of this View. |
View |
getFocusedChild()
|
Rect |
getFrame()
Gets the position and size of this View in terms of its parent's coordinate space |
Rect |
getFrame(Rect r)
Gets the position and size of this View in terms of its parent's coordinate space |
int |
getHeight()
|
Rect |
getInterestingRect()
|
Rect |
getInterestingRect(Rect outRect)
|
View |
getLastChild()
Get the last child of this View. |
int |
getLeft()
Get the x-position of this View relative to its parent's coordinate system |
Point |
getOrigin()
|
Point |
getOrigin(Point outPoint)
|
int |
getOriginX()
|
int |
getOriginY()
|
View |
getParent()
|
int |
getRight()
|
View |
getSibling()
Get the next View in the list of Views belonging to this View's parent. |
Style |
getStyle()
|
int |
getStyleColor(int attribute)
|
Font |
getStyleFont(int attribute)
|
int |
getTop()
Get the y-position of this View relative to its parent's coordinate system |
int |
getWidth()
|
Window |
getWindow()
|
Rect |
globalToLocal(Rect inRect)
|
void |
hide()
|
void |
invalidate()
Cause this View to be repainted at the earliest opportunity, provided it is VISIBLE and not entirely obscured. |
void |
invalidate(int left,
int top,
int right,
int bottom)
|
void |
invalidate(Rect r)
|
boolean |
isEnabled()
|
boolean |
isFocusable()
|
boolean |
isFocused()
|
boolean |
isOnScreen()
|
boolean |
isTransparent()
|
boolean |
isVisible()
Returns the VISIBLE state of this View. |
boolean |
keepRectInView(View inChangingView,
Rect inImportantRect)
|
Point |
localToGlobal(Point inPoint)
|
Rect |
localToGlobal(Rect inRect)
|
Rect |
localToWindow(Rect inRect)
|
void |
loseFocus()
|
void |
moveBy(int h,
int v)
|
void |
offsetOrigin(int inDeltaY)
|
void |
offsetOrigin(int inDeltaX,
int inDeltaY)
|
void |
onAddedToParent()
|
void |
onDecoded()
|
protected void |
onPeriodicPulse()
|
void |
onRemovedFromParent()
|
protected void |
onStyleChanged(int attribute)
|
protected void |
onWindowPaint()
|
void |
paint(Pen pen)
Draw the contents of this View. |
protected boolean |
receiveEventInternal(Event event)
Internal entry point for event processing. |
void |
reflowChildren(View inBaseChild,
int inAmount)
|
void |
removeChild(View child)
Removes a child View from this View. |
void |
resetOrigin()
|
void |
sendEventToWindow(Event event)
|
void |
setAcceptFocus(boolean acceptFocus)
|
void |
setBackgroundColor(int inColor)
|
void |
setBottom(int inBottom)
|
void |
setDebugBounds(boolean debugBounds)
|
void |
setEnabled(boolean enabled)
|
void |
setFrame(Rect frame)
|
void |
setHeight(int inHeight)
|
void |
setKeyedValue(int key,
int value)
|
void |
setLeft(int inLeft)
|
void |
setOrigin(int inY)
|
void |
setOrigin(int x,
int y)
|
void |
setPosition(int x,
int y)
Moves this View to a new position specified in its parent's coordinate system |
void |
setRight(int inRight)
|
void |
setSize(int width,
int height)
|
void |
setStyle(Style style)
|
void |
setStyleColor(int attribute,
int color)
|
void |
setStyleFont(int attribute,
Font font)
|
void |
setStyleFrameColor(int color)
|
void |
setTop(int inTop)
|
void |
setTransparent(boolean transparent)
|
void |
setVisible(boolean visible)
|
void |
setWidth(int inWidth)
|
void |
setWindow(Window inWindow)
|
protected boolean |
shouldDropEvent(Event event)
|
void |
show()
|
boolean |
styleIsDefault()
|
void |
takeFocus(boolean inFromAbove)
|
boolean |
willFocusWithin(Rect r)
|
Rect |
windowToLocal(Rect inRect)
|
| Methods inherited from class danger.app.Listener |
cancelEvents, receiveEvent, sendEvent, sendEvent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int mOriginX
protected int mOriginY
protected Style mStyle
public static final int STATE_VISIBLE
public static final int STATE_FOCUSED
public static final int STATE_ENABLED
public static final int STATE_CAN_FOCUS
public static final int STATE_TRANSPARENT
public static final int STATE_DEBUG_BOUNDS
| Constructor Detail |
public View()
public View(Rect bounds)
public View(int left,
int top,
int right,
int bottom)
| Method Detail |
public void onDecoded()
public void setKeyedValue(int key,
int value)
public Rect getInterestingRect()
public Rect getInterestingRect(Rect outRect)
public final View getParent()
public final View getSibling()
public View getFirstChild()
public View getLastChild()
public View getBottomChild()
public void addChild(View child)
public void removeChild(View child)
public void reflowChildren(View inBaseChild,
int inAmount)
public boolean childIsOnScreen(View child)
public boolean isOnScreen()
public final Rect getFrame(Rect r)
public final Rect getFrame()
public final Rect getBounds(Rect r)
public final Rect getBounds()
public final int getWidth()
public final int getHeight()
public final int getLeft()
public final int getRight()
public final int getTop()
public final int getBottom()
public void setPosition(int x,
int y)
public void setSize(int width,
int height)
public void setFrame(Rect frame)
public void setWidth(int inWidth)
public void setHeight(int inHeight)
public Point localToGlobal(Point inPoint)
public Rect localToGlobal(Rect inRect)
public Rect globalToLocal(Rect inRect)
public Rect localToWindow(Rect inRect)
public Rect windowToLocal(Rect inRect)
public void paint(Pen pen)
public void clear(Pen pen)
public void invalidate()
public void invalidate(int left,
int top,
int right,
int bottom)
public void invalidate(Rect r)
public boolean isVisible()
public void show()
public void hide()
public final void setVisible(boolean visible)
public boolean isEnabled()
public void enable()
public void disable()
public final void setEnabled(boolean enabled)
public View getFocusedChild()
public boolean isFocused()
public void takeFocus(boolean inFromAbove)
public void loseFocus()
public void setTransparent(boolean transparent)
public boolean isTransparent()
public void setAcceptFocus(boolean acceptFocus)
public boolean getAcceptFocus()
public boolean isFocusable()
public void setBackgroundColor(int inColor)
public int getBackgroundColor()
public void setDebugBounds(boolean debugBounds)
public void onAddedToParent()
public void onRemovedFromParent()
protected void onWindowPaint()
protected void onPeriodicPulse()
protected boolean shouldDropEvent(Event event)
protected final boolean receiveEventInternal(Event event)
ListenerreceiveEventInternal in class Listenerdanger.app.Listenere - An Event containing the event to be sent.
public boolean eventKeyDown(char c,
Event event)
public boolean eventKeyRepeat(char c,
Event event)
public boolean eventKeyUp(char c,
Event event)
public boolean eventKeyHeld(char c,
Event event)
public boolean eventWidgetUp(int widget,
Event event)
public boolean eventWidgetDown(int widget,
Event event)
public boolean eventWidgetHeld(int widget,
Event event)
public boolean eventShortcut(char inKey)
public boolean eventPeriodicPulse(int timestamp)
public final void sendEventToWindow(Event event)
public void moveBy(int h,
int v)
public void setTop(int inTop)
public void setBottom(int inBottom)
public void setLeft(int inLeft)
public void setRight(int inRight)
public void setOrigin(int x,
int y)
public void setOrigin(int inY)
public void resetOrigin()
public final Point getOrigin()
public final Point getOrigin(Point outPoint)
public final int getOriginX()
public final int getOriginY()
public void offsetOrigin(int inDeltaX,
int inDeltaY)
public void offsetOrigin(int inDeltaY)
public Window getWindow()
public void setWindow(Window inWindow)
public boolean willFocusWithin(Rect r)
public boolean keepRectInView(View inChangingView,
Rect inImportantRect)
public Style getStyle()
public void setStyle(Style style)
public Style copyStyle()
public boolean styleIsDefault()
public void setStyleColor(int attribute,
int color)
public void setStyleFont(int attribute,
Font font)
public int getStyleColor(int attribute)
public Font getStyleFont(int attribute)
public void setStyleFrameColor(int color)
protected void onStyleChanged(int attribute)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||