/** * This class represents a Histogram which is a primary visual tool in * Project Grader. The Histogram is made up of HistoSegments and * grades along with a boolean isSpecific and a curve. */ package Visual; import Visual.*; import Grades.*; import Info.*; import Reports.*; import Assignments.*; import java.util.Collection; abstract class Histogram { /** * Boolean value whether or not speicific Histogram is displayer (ie. whether * or not all grades are shown or just one (A, A-, A+)). */ boolean isSpecific; /** * The Curve used for the current GradeBook. */ Curve curve; /** * The HistoSegments that make up the histogram. */ Collection segments; /** * Collection of grades that make up the Histogram. */ Collection grades; /** * createHistogram creates the Histogram with the proper cutoff and the proper * values for each bar in the histogram. * /* ensures // // Column height equals number of grades in the range // (\forall HistoSegment seg : segments; (\forall HistoRow row : seg.rows; row.num == \sum( 1 ; grades.grade <= row.maxVal && grades.grade > row.minVal ) ); ); */ abstract void createHistogram(); /** * moveCutoff moves a cutoff when the user drags the bar representing the cutoff. * /* ensures // // Cutoff is moved to it's proper value // (seg.cutoff == newVal) && // // Any cutoffs smaller than the current cutoff stay smaller than it // (\forall HistoSegment otherSeg ; otherSeg.cutoff < \old(seg.cutoff) ; otherSeg.cutoff <= seg.cutoff ) && // // Any cutoffs larger than the current cutoff stay larger than it // (\forall HistoSegment otherSeg ; otherSeg.cutoff > \old(seg.cutoff) ; (otherSeg.cutoff >= seg.cutoff) ); */ abstract void moveCutoff(HistoSegment seg, int newVal); }