www.pudn.com > Bluegammon蓝牙的应用编程.rar > MenuPainter.java
// Copyright (c) 2005 Sony Ericsson Mobile Communications AB // // This software is provided "AS IS," without a warranty of any kind. // ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, // INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. // // THIS SOFTWARE IS COMPLEMENTARY OF JAYWAY AB (www.jayway.se) package bluegammon.gui.menu; import javax.microedition.lcdui.Graphics; /** * TheMenuPainterinterface defines high-level methods * when drawing contents of aMenu, which consists of *MenuPages andPageItems. An implementation * of this interface is provided when constructing aMenu. * @author Peter Andersson */ public interface MenuPainter { /** * Paints a static menu. * * @param g The graphics context to draw to. * @param menu The menu to draw. * @param x Offset x coordinate. * @param y Offset y coordinate. * @param width The width of the menu. * @param height The height of the menu. */ public void paintMenu(Graphics g, MenuPage menu, int x, int y, int width, int height); /** * Paints a transition between menus. * * @param g The graphics context to draw to. * @param fromMenu Source menu. * @param toMenu Destination menu. * @param x Offset x coordinate. * @param y Offset y coordinate. * @param width The width of the menu. * @param height The height of the menu. * @param frame Current frame (0 - frames). * @param frames Maximum frames in this transition. * @param back True if going back to a page, false otherwise. */ public void paintTransition(Graphics g, MenuPage fromMenu, MenuPage toMenu, int x, int y, int width, int height, int frame, int frames, boolean back); }