menulistener.java

来自「手机应用程序之蓝牙编程源代码。。蓝牙编程爱好者课用」· Java 代码 · 共 58 行

JAVA
58
字号
// 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;

/**
 * This interface is used by applications which need to receive high-level events 
 * concerning a <code>Menu</code>. An instance of <code>MenuListener</code> is specified
 * to a <code>Menu</code> using the <code>setListener</code> method in <code>Menu</code>.
 * @author Peter Andersson
 */
public interface MenuListener
{
  /**
   * Called when a new page is shown.
   * @param fromPage	Old page or null.
   * @param toPage		New page.
   * @param back		true if user steps back, false if active choice forwards.
   */
  public void newPage(MenuPage fromPage, MenuPage toPage, boolean back);
  /**
   * Called when a item is selected in a page.
   * @param page		The page in which the item is selected.
   * @param oldItem		The item that is deselected or null if no such item.
   * @param newItem		The item that is selected.
   */
  public void itemSelected(MenuPage page, PageItem oldItem, PageItem newItem);
  /**
   * Called when an ItemAction is invoked.
   * @param page	The page in which the action was invoked.
   * @param item	The item the action belongs to.
   * @param action	The action.
   */
  public void actionCalled(MenuPage page, PageItem item, ItemAction action);
  /**
   * Called when a transition is started on a new page selection.
   * @param fromPage	Old page or null.
   * @param toPage		New page.
   * @param delay		Delay between each transition frame in milliseconds.
   * @param frames		Number of frames in this transition.
   * @param back		True if this is transition back to a previous page.
   */
  public void transitionStarted(MenuPage fromPage, MenuPage toPage,
      long delay, int frames, boolean back);
  /**
   * Called when a transition is finished.
   * @param fromPage	Old page or null.
   * @param toPage		New page.
   */
  public void transitionStopped(MenuPage fromPage, MenuPage toPage);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?