# Class ControlPanel

    java.lang.Object
       |
       +----java.awt.Component
               |
               +----java.awt.Container
                       |
                       +----java.awt.Panel
                               |
                               +----ControlPanel

public class ControlPanel
extends Panel

This class extends the `java.awt.Panel` class to form a panel which holds the buttons that control the animation of the algorithm.

In this particular application, it only consists of four image buttons, namely, `run, stop, step,` and `skip`.

See Also:
  Panel

##

ControlPanel(AlgAnimFrame, String)
  Creates a panel to hold the control buttons of the animation tool.

##

action(Event, Object)
  Action handler for the buttons and choice buttons in the control panel.
getRunButton()
  Returns an instance of the run `ImageButton`, which is casted to `java.awt.Button`
getSkipButton()
  Returns an instance of the skip `ImageButton`, which is casted to `java.awt.Button`
getStepButton()
  Returns an instance of the step `ImageButton`, which is casted to `java.awt.Button`
getStopButton()
  Returns an instance of the stop `ImageButton`, which is casted to `java.awt.Button`
refreshButtons()
  Perform a `repaint()` on each of the image buttons.

##

ControlPanel

     public ControlPanel(AlgAnimFrame frame,
                         String algname)

  Creates a panel to hold the control buttons of the animation tool.

  Parameters:
    frame - The parent window frame that contains this panel
    algname - The algorithm name parsed from the applet parameter

##

refreshButtons

     public void refreshButtons()

  Perform a `repaint()` on each of the image buttons.

action

     public boolean action(Event e,
                           Object arg)

  Action handler for the buttons and choice buttons in the control panel.

  Parameters:
    e - Event invoked
    arg - Object that invokes the event
  Overrides:
    action in class Component

getRunButton

     public Button getRunButton()

  Returns an instance of the run `ImageButton`, which is casted to `java.awt.Button`

  Returns:
    Run button to initiate the animation of the algorithm.

getStopButton

     public Button getStopButton()

  Returns an instance of the stop `ImageButton`, which is casted to `java.awt.Button`

  Returns:
    Stop button to terminate the execution of algorithm.

getStepButton

     public Button getStepButton()

  Returns an instance of the step `ImageButton`, which is casted to `java.awt.Button`

  Returns:
    Step button to trace through the execution of the algorithm. If the `Run` button has already been pressed, the execution mode will be switched from `RUN` to `STEP`.

getSkipButton

     public Button getSkipButton()

  Returns an instance of the skip `ImageButton`, which is casted to `java.awt.Button`

  Returns:
    Skip button to bypass the animation of the algorithm.