Class PiParallelAWT

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PiParallelAWT extends PiAWT
Graphical AWT elements for calculating pi using multiple threads in parallel.
Version:
1.9.0
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • threadsLabel

      private Label threadsLabel
    • threadsField

      private TextField threadsField
  • Constructor Details

    • PiParallelAWT

      public PiParallelAWT(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)
      Description copied from class: PiAWT
      Initialize the "threads" section GUI elements. Elements should be added for the remainder of the width of the container.
      Overrides:
      initThreads in class PiAWT
      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()
      Description copied from class: PiAWT
      Validates the input fields.
      Overrides:
      isInputValid in class PiAWT
      Returns:
      true if all input fields contain valid values, otherwise false.
    • getOperation

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