/** @author Scott Marshall @author University of Glasgow, MSc IT Project 2001 @author Building an OnLine Course in Computing Fundamentals */ package ukacgla_3inputKMap; import ukacgla_KMap.*; import java.util.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.table.TableColumn; import javax.swing.table.AbstractTableModel; import javax.swing.SwingUtilities; import java.awt.*; import java.awt.event.*; import java.applet.Applet; public class Ex05_Frame extends KMap_Frame { Ex05_Random rand; private int noOfRows; private int noOfCols; public Ex05_Frame(JApplet m, int n, int o, String[] c){ super(m, n, o, c); columnNames = c; this.noOfRows = n; this.noOfCols = o; noOfOptions = 5; //number of checkboxes mkUI(); } /** Builds a new table model, calculates the answers, and redraws the panel on the screen. */ protected void newTable() { table.setModel(model = new KMapTableModel(columnNames)); model.proofReadTable(); buildAnswers(); mkCheckBoxPanel(); } /** Builds the answers for the K Map. One will be correct, the rest will be incorrect. */ protected void buildAnswers() { Vector oneCells = new Vector(); //Cells in this vector will result in a one Vector zeroCells = new Vector(); //Cells in this vector will result in a zero answers = new Vector(); //will hold all 4 minterms generated /** Find expressions and place into correct vectors. Will get the row headers for x, column headers for y and column footers for z */ for (int a=1; a