?? algae.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(); } }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -