Class PiAWT

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
PiParallelAWT

public class PiAWT extends Panel
Graphical AWT elements for calculating pi using four different algorithms.
Version:
1.9.1
Author:
Mikko Tommila
See Also:
Serialized Form
  • Constructor Details

    • PiAWT

      public PiAWT(PiAWT.StatusIndicator statusIndicator)
      Construct a panel with graphical elements.
      Parameters:
      statusIndicator - Handler for showing error messages in the application.
  • Method Details

    • initThreads

      protected void initThreads(Container container, GridBagConstraints constraints)
      Initialize the "threads" section GUI elements. Elements should be added for the remainder of the width of the container.
      Parameters:
      container - The container where the elements are to be added.
      constraints - The constraints with which the elements are to be added to the container.
    • isInputValid

      protected boolean isInputValid()
      Validates the input fields.
      Returns:
      true if all input fields contain valid values, otherwise false.
    • showStatus

      protected void showStatus(String status)
      Show the specified error status.
      Parameters:
      status - The status.
    • getOperation

      protected Operation<Apfloat> getOperation(long precision, int radix) throws ApfloatRuntimeException
      Get the calculation operation to execute.
      Parameters:
      precision - The precision to be used.
      radix - The radix to be used.
      Returns:
      The calculation operation to execute.
      Throws:
      ApfloatRuntimeException