/**
 * File: KeyDisplay.java
 * @author A.Kurd <alan.kurd@trincoll.edu>
 * 
 * Description: Implements a Java 1.1 version of a GUI tool for displaying possible "candidate" keys.
 * Credits: This program is modelled after the frequency test of the CryptoToolJ program by Ralph Morelli.
 *
 * Copyright: This program is in the public domain. You can do whatever you want with
 *  it as long as I get credit for my work and as long as you offer your changes to me
 *  so I can possible add them to the "official" version.
 */
package analyzers;             // Analyzer plugins belong to this package

import hcrypto.analyzer.*;     // This is where Analyzer is
import java.awt.TextArea;
import hcrypto.cipher.*;
import java.awt.*;
import java.awt.event.*;   

public class KeyDisplay extends Frame implements Analyzer{

   public  Frame  frame;	//the frame where the output will be produced
   public  KeyCount kc= new KeyCount();	//the creation of the possible keys
   public  String output = "";	//the output were the "candidate" keys will be collected
   private TextArea text1;     // Pointers to the text to be analyzed
   private TextArea display1;  // And the window where results are displayed
   public int collect[];
   

   public  void KeyDisplay(String text){
   }//BigramDisplay

/*Necessary for the Analyzer package*/

   public void setup(TextArea text1, TextArea display1) { 
      this.text1 = text1;
      this.display1 = display1;
   }

/*First method called for this class*/

   public void run() {
      frame();
   }

//This method outputs the possible keys in a text box

   public  void frame(){   
      
      frame = new Frame ("Key");
      frame.setResizable(true);
      frame.setSize(400, 200);
      frame.setLocation(5, 10);
      frame.setVisible(true);

      for (int k=0; k <kc.key.length; k++){
         if (k%5 == 0)
            output = output + "" + "\n";
        output = output + "\t"+ (kc.key [k]);   }//for

      display1 = new TextArea (output);
      frame.add(display1);
      frame.show();
   }//frame
}//BigramDisplay Class