package curve;

import view.WindowFrame;
import java.util.Collection;
import gradebook.ClassGradebook;
import charts.*;
import view.Window;

/**
 * Windows for the 3/8 A's Curve.
 * Derived from Section 2.6.3.1 of the requirements.
 * @author crahm
 */
public abstract class CurveThreeEigthsAsWindow extends WindowFrame
{
   /**
    * A-boundary representing the top three-eigths of the class.
    */
   LetterGradeBoundary topThreeEigths;
   
   /**
    * Histogram that contains the proposed curve to model.
    */
   Histogram histo;
	
   /**
    * Set 3/8 Curve Window
    */
    SetThreeEigthsAsCurveWindow setWindow;
   
   /**
    * Opens the SetThreeEigthsAsCurveWindow window.  Triggered by the button.
    */
   /*@
     ensures
     //
     // Set 3/8 A's Curving Window is opened.
     //
     (\exists Window w ;
        (w.open.contains(setWindow) && (setWindow != null)));
     @*/
   abstract void setCurve();
}

/**
 * Window for setting the 3/8 A's curve.
 */
abstract class SetThreeEigthsAsCurveWindow extends WindowFrame
{
   /**
    * The tentative curve.
    */
   GradeCurve tentativeLetterGrades;
   
   /**
    * This method applies the 3/8 get A's curve.
    */
   /*@
    ensures
    //
    //Curve is applied to Histogram, Pie Chart, and Gradebook
    //
    (\exists Histogram h;
       (h.curve.equals(tentativeLetterGrades))) &&
    (\exists PieChart p ;
       (p.curve.equals(tentativeLetterGrades))) &&
    (\exists ClassGradebook g ;
       (g.gradeCurve.equals(tentativeLetterGrades)));
    @*/
   abstract void applyCurve();
}