|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Listener
danger.ui.View
danger.ui.Container
danger.ui.Window
danger.ui.BaseMenuWindow
public abstract class BaseMenuWindow
Base window type for the window that gets displayed for menus.
| Field Summary | |
|---|---|
protected MenuItem |
mAutoSelectItem
Deprecated. Use setAutoSelectItem(danger.ui.MenuItem) and
getAutoSelectItem() instead. |
| Fields inherited from class danger.ui.Window |
|---|
mBusyPaintCount, mDefaultListener, STATE_AUTO_HIDE_IF_IDLE, STATE_DROP_ORPHANED_EVENTS, STATE_FULLSCREEN, STATE_UNUSED1 |
| Constructor Summary | |
|---|---|
BaseMenuWindow(BaseMenu inParentMenu)
Create an instance. |
|
| Method Summary | |
|---|---|
protected void |
advanceHilite(int count)
Advance the selection by count menu items. |
protected void |
autoHide()
|
boolean |
blocksChooser()
Whether the window blocks from going to the chooser Some applications, such as security/passcode lock and registration block from going to the chooser when the JUMP button is pressed. |
protected void |
calcShortMenuHeight()
Calculate the height of the menu window when it is displaying the bottommost menu items. |
protected void |
completelyCloseMenu()
Close the menu window and any parent menu windows, as well. |
protected void |
drawMenuItem(Pen p,
int left,
int top,
int right,
int bottom,
MenuItem item,
int offset,
boolean inEnabled,
boolean inSelected)
Draw the specified menu item, including text, shortcut, bitmap, etc. |
protected void |
drawMenuText(MenuItem item,
CharSequence title,
Pen p,
int x,
int y,
int width,
boolean selected)
Draw the text of the specified menu item. |
protected void |
drawMenuText(MenuItem item,
Pen p,
int x,
int y,
int width,
boolean selected)
Draw the text of the specified menu item. |
void |
drawOpenMenuContents(Pen p,
int width,
int height)
Draw the contents of the menu window. |
void |
drawOpenMenuFrame(Pen p,
int width,
int height)
Draw the frame of the menu window. |
boolean |
eventKeyDown(char inChar,
Event event)
This method is called when the user presses a key. |
boolean |
eventKeyUp(char inChar,
Event event)
Processes key releases directed at this container. |
boolean |
eventShortcut(char shortcut,
Event event)
Handle a shortcut key. |
boolean |
eventWidgetDown(int inWhichWidget,
Event event)
Handle a button down event. |
boolean |
eventWidgetUp(int inWhichWidget,
Event event)
Handle the release of a device widget |
protected MenuItem |
getAutoSelectItem()
Get the item to select when first displaying the menu. |
protected int |
getMaxHeight()
Get the maximum height this menu window can be. |
BaseMenu |
getParentMenu()
Returns the parent menu, as specified by setParentMenu(danger.ui.BaseMenu)
or BaseMenuWindow(BaseMenu). |
protected MenuItem |
getSelectedItem()
Get the currently selected menu item. |
protected int |
getTitleHeight()
Get the height of the menu title. |
boolean |
getWrap()
Determine whether menu items are wrapped, as specified by setWrap(boolean). |
protected void |
hideActiveMenu(boolean onlyIfOrphaned)
|
protected void |
onHide()
This method is called when this view is hidden, via the method View.hide(). |
protected void |
onSelectionChanged()
This method is called whenever the selection has changed to a different menu item. |
protected void |
onSelectionRectChanged()
This method is called when the selection rect (the currently focused menu item) might have changed. |
protected void |
onShow()
This method is called when this view is shown, via the method View.show(). |
protected void |
pageDown()
|
protected void |
pageUp()
|
void |
paint(Pen p)
Draw the contents of this View. |
boolean |
receiveEvent(Event event)
Entry point for event processing. |
protected void |
reverseHilite(int count)
Reverse the selection by count menu items. |
void |
setAlwaysSendEvents(boolean alwaysSendEvents)
Specify that menu item events should always be sent when a menu item is executed. |
protected void |
setAutoSelectItem(MenuItem item)
Specify the menu item to select when first displaying the menu window. |
void |
setEnablePrefixHilite(boolean inEnablePrefixHilite)
Enable prefix highlighting. |
void |
setParentMenu(BaseMenu inParentMenu)
Specify the parent menu, which determines what is displayed in the window. |
protected void |
setSelection(int selection)
Select the specified menu item. |
void |
setWrap(boolean wrap)
Specify whether to wrap the menu items. |
void |
show()
Mark this view visible. |
void |
showToolTip()
This method should be implemented to actually display the tool tip, probably via a call to ToolTipWindow.showToolTip(danger.ui.MenuItem, int, int, int, danger.ui.Window). |
protected void |
updateFirstVisibleEntry()
Update which menu item is the topmost visible item on the screen. |
| 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 |
| Field Detail |
|---|
protected MenuItem mAutoSelectItem
setAutoSelectItem(danger.ui.MenuItem) and
getAutoSelectItem() instead.| Constructor Detail |
|---|
public BaseMenuWindow(BaseMenu inParentMenu)
| Method Detail |
|---|
protected void onShow()
ViewView.show(). It is called as the very last thing done by that method, and
it is only ever called if the view was not already visible.
Overriding this method is the recommended way to get special
behavior when a view gets shown.
The implementation in this class does nothin.
onShow in class Viewpublic void setWrap(boolean wrap)
public boolean getWrap()
setWrap(boolean).
public void setParentMenu(BaseMenu inParentMenu)
public BaseMenu getParentMenu()
setParentMenu(danger.ui.BaseMenu)
or BaseMenuWindow(BaseMenu).
public void show()
ViewWindow. If this view was not
already visible, this method will call View.onShow() as the last
thing it does before returning. If you wish to have special behavior
when a view becomes visible, it is recommended that you override
that method.
In a future revision of the library, it is likely that this method
will be final.
show in class Windowpublic void paint(Pen p)
ViewThe 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.
paint in class Containerp - non-null; the pen to use for drawing operationsprotected void onHide()
ViewView.hide(). It is called as the very last thing done by that
method, and it is only ever called if the view was not already
hidden. Overriding this method is the recommended way to get special
behavior when a view gets hidden .
The implementation in this class does nothin.
onHide in class View
public void drawOpenMenuFrame(Pen p,
int width,
int height)
paint(danger.ui.Pen).
protected void onSelectionRectChanged()
protected void drawMenuText(MenuItem item,
Pen p,
int x,
int y,
int width,
boolean selected)
item - the menu item to drawp - the pen to use to draw the menu itemx - the x coordinate of the menu item texty - the x coordinate of the menu item textwidth - the width of the menu item textselected - whether the menu item is currently selected
protected void drawMenuText(MenuItem item,
CharSequence title,
Pen p,
int x,
int y,
int width,
boolean selected)
item - the menu item to drawtitle - the text of the menu item to drawp - the pen to use to draw the menu itemx - the x coordinate of the menu item texty - the x coordinate of the menu item textwidth - the width of the menu item textselected - whether the menu item is currently selected
protected void drawMenuItem(Pen p,
int left,
int top,
int right,
int bottom,
MenuItem item,
int offset,
boolean inEnabled,
boolean inSelected)
p - the pen to use to draw the menu itemleft - the left coordinate of the menu item to drawtop - the top coordinate of the menu item to drawright - the right coordinate of the menu item to drawbottom - the bottom coordinate of the menu item to drawitem - the menu item to drawoffset - horizontal offset of the menu item bitmapinEnabled - whether the menu item is enabledinSelected - whether the menu item is currently selectedprotected void updateFirstVisibleEntry()
protected int getTitleHeight()
public void drawOpenMenuContents(Pen p,
int width,
int height)
paint(danger.ui.Pen).
protected int getMaxHeight()
protected void calcShortMenuHeight()
public boolean receiveEvent(Event event)
ListenerDispatcher when it reads an Event in its queue
that is targetted at this instance. The default behavior is to
do nothing and return false. Subclasses are expected
to override this method to do something more useful.
receiveEvent in class Containerevent - non-null; the event to process
true) or not (false) this
method actually handled the event to completion
public boolean eventWidgetDown(int inWhichWidget,
Event event)
Window
eventWidgetDown in class WindowinWhichWidget - the widget that went up
public boolean eventWidgetUp(int inWhichWidget,
Event event)
Container
eventWidgetUp in class WindowinWhichWidget - the widget that went down
public boolean eventKeyDown(char inChar,
Event event)
ViewView.setAtAndSpacePage(boolean).
eventKeyDown in class Container
public boolean eventKeyUp(char inChar,
Event event)
Container
eventKeyUp in class ContainerinChar - the character being released.
public boolean eventShortcut(char shortcut,
Event event)
ViewScreenWindow, DialogWindow,
BaseMenuWindow.
eventShortcut in class Containershortcut - the key that was pressedevent - the event associated with the key press
true if the shortcut was handledpublic final void setEnablePrefixHilite(boolean inEnablePrefixHilite)
protected void autoHide()
autoHide in class Windowprotected void pageUp()
protected void pageDown()
protected void advanceHilite(int count)
count menu items.
protected void reverseHilite(int count)
count menu items.
protected void setSelection(int selection)
selection is a
0-based index into the menu.
protected MenuItem getSelectedItem()
protected void completelyCloseMenu()
protected void onSelectionChanged()
public void setAlwaysSendEvents(boolean alwaysSendEvents)
PopupMenu and do not wish to receive
an event if the user views the menu but does not change the selection.
By default, this is enabled.
public boolean blocksChooser()
Window
blocksChooser in class Windowprotected final void hideActiveMenu(boolean onlyIfOrphaned)
hideActiveMenu in class Windowprotected void setAutoSelectItem(MenuItem item)
protected final MenuItem getAutoSelectItem()
setAutoSelectItem(danger.ui.MenuItem)public void showToolTip()
ToolTipOwnerToolTipWindow.showToolTip(danger.ui.MenuItem, int, int, int, danger.ui.Window).
showToolTip in interface ToolTipOwner
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||