bluegammon.gui.menu
Class DefaultMenuPainter
java.lang.Object
bluegammon.gui.menu.DefaultMenuPainter
- All Implemented Interfaces:
- MenuPainter
- public class DefaultMenuPainter
- extends java.lang.Object
- implements MenuPainter
A default implementation of MenuPainter
. Transitions are implemented
as an horizontal movement. Items a rendered using normal MIDP text
methods.
- Author:
- Peter Andersson
Method Summary |
void |
paintMenu(javax.microedition.lcdui.Graphics g,
MenuPage menu,
int x,
int y,
int width,
int height)
Paints a static menu. |
void |
paintTransition(javax.microedition.lcdui.Graphics g,
MenuPage fromMenu,
MenuPage toMenu,
int x,
int y,
int width,
int height,
int frame,
int frames,
boolean back)
Calls paintMenu twice with the two pages, plus an x offset for each menu
to visualize the transition. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultMenuPainter
public DefaultMenuPainter()
paintMenu
public void paintMenu(javax.microedition.lcdui.Graphics g,
MenuPage menu,
int x,
int y,
int width,
int height)
- Description copied from interface:
MenuPainter
- Paints a static menu.
- Specified by:
paintMenu
in interface MenuPainter
- Parameters:
g
- The graphics context to draw to.menu
- The menu to draw.x
- Offset x coordinate.y
- Offset y coordinate.width
- The width of the menu.height
- The height of the menu.
paintTransition
public void paintTransition(javax.microedition.lcdui.Graphics g,
MenuPage fromMenu,
MenuPage toMenu,
int x,
int y,
int width,
int height,
int frame,
int frames,
boolean back)
- Calls paintMenu twice with the two pages, plus an x offset for each menu
to visualize the transition.
- Specified by:
paintTransition
in interface MenuPainter
- Parameters:
g
- The graphics context to draw to.fromMenu
- Source menu.toMenu
- Destination menu.x
- Offset x coordinate.y
- Offset y coordinate.width
- The width of the menu.height
- The height of the menu.frame
- Current frame (0 - frames).frames
- Maximum frames in this transition.back
- True if going back to a page, false otherwise.