⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 algae.java

📁 ALGAE是一个快速创建算法演示的框架。目前支持的算法实现语言包括java和c
💻 JAVA
字号:
package edu.odu.cs.zeil.AlgAE.Server;import edu.odu.cs.zeil.AlgAE.Termination;import edu.odu.cs.zeil.AlgAE.Server.MenuFunction;import edu.odu.cs.zeil.AlgAE.Server.Server;import edu.odu.cs.zeil.AlgAE.Server.ServerThread;import java.io.InputStream;import java.io.PrintStream;/** *  AlgAE basic animation controls * *  These controls are all implemented as static functions (at some cost *  in implementation complexity) so that they can be called from within *  animated code without the need to explicitly pass AlgAE.Server objects to *  every function in the animated code. * *  @author Steven J Zeil **/public class algae{        /**   *  Declare a menu item to appear in the client's Algorithm menu   *  and a corresponding function to be executed here on the server   *  in response to a selection of that item.   *   * @param menuItemTitle The string to appear in the client's menu   * @param theOperation  code to invoke when the menu item is selected   **/  static public void menuItem (String menuItemTitle,			       MenuFunction theOperation)  {    server().menuItem (menuItemTitle, theOperation);  }  /**   *  Signal that a frame should be drawn, and the algorithm paused   *  until the client gives a "continue" signal.   *   *  @param frameidentifier  Unique string identifying this code location.   *  @param message          String to display in client's status line   **/  public static void FRAME (String frameIdentifier, String message)  {    server().FRAME(frameIdentifier, message);  }    /**   *  Signal that a frame should be drawn, and the algorithm paused   *  until the client gives a "continue" signal.   *   *  @param message          String to display in client's status line.   *                          Also used as the frame identifier.   **/  public static void FRAME (String message)  {    server().FRAME(message, message);  }    /**   *  Pop up a dialog box requesting some input from the person operating   *  the client.   *   * @param prompt    String to display in the dialog box   * @return          the user's response.   **/  static public String promptForInput (String prompt)  {   return server().promptForInput (prompt);  }      /**   *  Restore any highlighted nodes and edges to their "normal" colors.   *   **/  static public void unHighlightAll()  {   server().unHighlightAll();  }  /**   *  Pop up a dialog box presenting some message to the person operating   *  the client.   *   * @param prompt    String to display in the dialog box   **/  public void message (String msg)  {    server().message (msg);  }    /**   *  Replacement for System.in - reads information from the Client's   *  std I/O window.   **/  static public InputStream in()  {    return server().in;  }    /**   *  Replacement for System.out - sends information to the Client's   *  std I/O window.   **/  static public PrintStream out()  {    return server().out;  }      /**   *  Shutdown and Exit.   **/  public static void exit (int statusCode)  {    ServerThread st = (ServerThread)Thread.currentThread();    st.getApplication().exit(statusCode);  }    private static Server server()  {    ServerThread st = (ServerThread)Thread.currentThread();    return st.getServer();  }  }  

⌨️ 快捷键说明

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