Skip to content

Input Validator Pane

John Clevenger edited this page Jul 27, 2020 · 1 revision

Overview

InputValidatorPane is a GUI class designed to support configuration and management of Input Validators in PC2. An instance of InputValidatorPane appears as a tab in an Edit Problem Pane (although in principle, since InputValidatorPane is a PC2 JPanePlugin, it could appear anywhere a javax.swing.JPanel can appear; see UI Design Elements).

After an Edit Problem Pane constructs an InputValidatorPane, it subsequently invokes the InputValidatorPane's setContestAndController() method, giving the InputValidatorPane access to the current contest model and contest controller. The Edit Problem Pane also invokes the setParentPane() method in the InputValidatorPane, giving the InputValidatorPane access back to the EditProblemPane which created it. The InputValidatorPane uses these references to support user GUI interaction in configuring the Input Validator(s) for the contest problem on which the Edit Problem Pane is operating.

Input Validator Pane Operations

An InputValidatorPane provides support for choosing one of three options for the Input Validator to be used by the contest problem:

  • No Input Validator
  • VIVA Input Validator
  • Custom (user-supplied) Input Validator

In addition, the InputValidatorPane provides buttons to run the (currently selected) Input Validator, and to display the results of the most recently executed Input Validator.

Results Display

When an InputValidatorPane is constructed, one of the things it does is create an instance of class InputValidationResultFrame. This class is a subclass of java.swing.JFrame and implements the PC2 interface UIPlugin. The InputValidatorPane invokes the setContestAndController() and setParentPane() methods in the InputValidatorResultFrame, giving the InputValidationResultFrame access to the contest model and controller as well as to the parent InputValidatorPane.

Contained within the InputValidatorResultFrame is an instance of a PC2 InputValidationResultPane, which has a reference to its parent (InputValidatorResultFrame). This allows the embedded InputValidationResultsPane to obtain information about the current contest problem through the child/parent/grandparent linkage from the InputValidationResultFrame to the InputValidatorPane to the EditProblemPane.

Each press of the Run Input Validator button on the InputValidatorPane generates Input Validation results by executing a new Swing worker thread which runs the selected Input Validator on each Test Data Set and publishes the result to the InputValidationResultFrame's InputValidatorResultPane.

See Also

UI Design Elements

Edit Problem Pane

PC2 Logo

Clone this wiki locally