📄 alganimframe.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><!--NewPage--><html><head><!-- Generated by javadoc on Tue Nov 03 15:31:36 EST 1998 --><title> Class AlgAnimFrame</title></head><body><a name="_top_"></a><h1> Class AlgAnimFrame</h1><pre>java.lang.Object | +----java.awt.Component | +----java.awt.Container | +----java.awt.Window | +----java.awt.Frame | +----AlgAnimFrame</pre><hr><dl> <dt> public class <b>AlgAnimFrame</b> <dt> extends Frame</dl>The <code>AlgAnimFrame</code> class is a top-level window with a title and border. The layout used is BorderLayout. There is a menubar created at the north part of the panel. The drawing panel is at the center and a commentary panel is located at the south. <p> This extended frame class holds a set references to the panel/frame objects used in the algorithm animation.<p><dl> <dt> <b>See Also:</b> <dd> Frame</dl><hr><a name="index"></a><h2> <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index"></h2><dl> <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o "> <a href="#AlgAnimFrame(AlgAnimApp, java.net.URL)"><b>AlgAnimFrame</b></a>(AlgAnimApp, URL) <dd> Creates and shows the frame consists of a drawing panel, commentary panel and control panel.</dl><h2> <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></h2><dl> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#action(java.awt.Event, java.lang.Object)"><b>action</b></a>(Event, Object) <dd> Action handler for the buttons and choice buttons in the control panel. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#finishAlg()"><b>finishAlg</b></a>() <dd> This method is invoked at the end of the animation or when the <b>stop</b> button is pressed. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getAlg()"><b>getAlg</b></a>() <dd> Returns the reference to the AlgThread which contains the details and execution sequences of the algorithm. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getApplet()"><b>getApplet</b></a>() <dd> Get the applet which contains a button to start up this window. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getComPanel()"><b>getComPanel</b></a>() <dd> Get the commentary panel that displays messages of any type. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDataChoice()"><b>getDataChoice</b></a>() <dd> Get the index of selected choice from the 'Select' pull menu. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDelay()"><b>getDelay</b></a>() <dd> Get the delay for highlighting text. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDisableAnim()"><b>getDisableAnim</b></a>() <dd> Get the menu item which specify if the animation is disabled. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDrawingPanel()"><b>getDrawingPanel</b></a>() <dd> Returns an instance of the drawing panel which is cast to its super class <code>Panel</code>. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getEnableAnim()"><b>getEnableAnim</b></a>() <dd> Get the menu item which specify if the animation is enabled. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getRunItem()"><b>getRunItem</b></a>() <dd> Get the run button from the control panel. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getSkipItem()"><b>getSkipItem</b></a>() <dd> Get the skip button from the control panel. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getStopItem()"><b>getStopItem</b></a>() <dd> Get the stop button from the control panel. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getTextFrame()"><b>getTextFrame</b></a>() <dd> Returns an instance of the <code>TextFrame</code> used to set the layout constraints and highlight certain lines of the source code. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#handleEvent(java.awt.Event)"><b>handleEvent</b></a>(Event) <dd> Event handler of the frame. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#Highlight(int)"><b>Highlight</b></a>(int) <dd> Highlights the specified line of the source code on the text panel. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#isNoAnim()"><b>isNoAnim</b></a>() <dd> Obtain the status of the preferred animation style. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#preferredSize()"><b>preferredSize</b></a>() <dd> Returns the preferred size of the frame. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#restoreDrawingPanel()"><b>restoreDrawingPanel</b></a>() <dd> Restore the drawing panel at the end of the animation or during initialization. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDelay(int)"><b>setDelay</b></a>(int) <dd> Set the delay for highlighting text. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDimension(java.awt.Dimension)"><b>setDimension</b></a>(Dimension) <dd> Sets the size of the frame. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDrawingPanel(DrawingPanel)"><b>setDrawingPanel</b></a>(DrawingPanel) <dd> Sets the drawing panel which is cast to its super class <code>Panel</code>. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setSkip(boolean)"><b>setSkip</b></a>(boolean) <dd> Sets the attribute which indicate if the <b>skip</b> execution mode is current. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setStep(boolean)"><b>setStep</b></a>(boolean) <dd> Sets the attribute which indicate if the <b>step</b> execution mode is current. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setText(int, java.lang.String)"><b>setText</b></a>(int, String) <dd> Sets the text string to be displayed on a specific text field on the commentary panel return from <code>getComPanel</code>. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#startAlg()"><b>startAlg</b></a>() <dd> Start the animation algorithm if the <b>run</b> or <b>step</b> button is pressed. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#waitSkip()"><b>waitSkip</b></a>() <dd> This method is called when the <b>skip</b> execution mode is used. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#waitStep()"><b>waitStep</b></a>() <dd> This method is called when the <b>step</b> execution mode is used.</dl><a name="constructors"></a><h2> <img src="images/constructors.gif" width=231 height=38 alt="Constructors"></h2><a name="AlgAnimFrame"></a><a name="AlgAnimFrame(AlgAnimApp, java.net.URL)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a><b>AlgAnimFrame</b><pre> public AlgAnimFrame(<a href="AlgAnimApp.html#_top_">AlgAnimApp</a> parentApp, URL sourceURL)</pre><dl> <dd> Creates and shows the frame consists of a drawing panel, commentary panel and control panel. The text frame is now displayed on a separate window.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> parentApp - The applet which results in the creation of this frame <dd> sourceURL - The URL of the source code to be displayed on the text frame <dt> <b>See Also:</b> <dd> URL </dl></dd></dl><a name="methods"></a><h2> <img src="images/methods.gif" width=151 height=38 alt="Methods"></h2><a name="preferredSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="preferredSize"><b>preferredSize</b></a><pre> public Dimension preferredSize()</pre><dl> <dd> Returns the preferred size of the frame. By default, it is set to 850x700. It can be modified based on the specific application.<p> <dd><dl> <dt> <b>Returns:</b> <dd> the dimension of the frame <dt> <b>Overrides:</b> <dd> <a href="java.awt.Container.html#preferredSize()">preferredSize</a> in class Container </dl></dd></dl><a name="setDimension(java.awt.Dimension)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setDimension"><b>setDimension</b></a><pre> public void setDimension(Dimension size)</pre><dl> <dd> Sets the size of the frame.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> size - The desired sized of the frame. </dl></dd></dl><a name="handleEvent(java.awt.Event)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="handleEvent"><b>handleEvent</b></a><pre> public boolean handleEvent(Event event)</pre><dl> <dd> Event handler of the frame. The main purpose of this method is to perform the cleanup statements upon receival of the WINDOW_DESTROY event message.<p> <dd><dl> <dt> <b>Overrides:</b> <dd> <a href="java.awt.Component.html#handleEvent(java.awt.Event)">handleEvent</a> in class Component </dl></dd></dl><a name="action(java.awt.Event, java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="action"><b>action</b></a><pre> public boolean action(Event e, Object arg)</pre><dl> <dd> Action handler for the buttons and choice buttons in the control panel.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> e - Event invoked <dd> arg - Object that invokes the event <dt> <b>Overrides:</b> <dd> <a href="java.awt.Component.html#action(java.awt.Event, java.lang.Object)">action</a> in class Component </dl></dd></dl><a name="setText(int, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setText"><b>setText</b></a><pre> public void setText(int n, String s)</pre><dl> <dd> Sets the text string to be displayed on a specific text field on the commentary panel return from <code>getComPanel</code>.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> n - The text field to display the string. First is <b>0</b>. <dd> s - The string to be displayed. <dt> <b>See Also:</b> <dd> <a href="#getComPanel">getComPanel</a> </dl></dd></dl><a name="Highlight(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="Highlight"><b>Highlight</b></a><pre> public void Highlight(int n)</pre><dl> <dd> Highlights the specified line of the source code on the text panel. If the line is beyond the scroll pane, it will be scrolled to the center of the window.<p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -