package profiles.uitest;

import java.awt.*;
import javax.swing.*;

/**
 * Il frame principale per la dimostrazione degli algoritmi.
 * @author Lorenzo Moretti
 * @version 1.0
 */
public class TestFrame extends JFrame {
  static JTextArea messages = new JTextArea(10, 80);

  public TestFrame() {
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setTitle("Profiles TestFrame");
    getContentPane().setLayout(new BorderLayout());

    getContentPane().add(new SimulationPanel(), BorderLayout.CENTER);
    getContentPane().add(new JScrollPane(messages), BorderLayout.SOUTH);
    messages.setEditable(false);
  }

  public static void main(String[] args) {
    TestFrame testFrame = new TestFrame();
    testFrame.pack();
    testFrame.setVisible(true);
  }

  public static void appendMessage(String msg) {
    if (messages != null)
      messages.append(msg+"\n");
  }
}