package main;

import java.awt.Color;
import java.awt.Container;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class Ctrl {
	public JFrame form ;
	public Container container ;
	
	private JTextArea ta;

	private String w1 ="big7说: ";
	private String w2 ="画面说: ";
	private String w3 ="请说: ";
	private String w4 ="你说: ";
	Ctrl()
	{
		ta = new JTextArea();		
	}
	
	public void Show()
	{
		form = new JFrame("★big7★CommandLine");
		container= form.getContentPane();
		
		JScrollPane jsp = new JScrollPane(ta);//给文本区添加滚动条		
		container.add(jsp);
				
		ta.setBackground(Color.BLACK); 
		ta.setForeground(Color.WHITE);
		form.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		form.setVisible(true);	
		form.setSize(800, 600);	
		
		ta.append("欢迎使用Big7 开发者预览版\n");
		ta.append("\n");
		ta.append("Only For You!\n");
		ta.append("2017©沼泽肖吉子\n");
		ta.append("\n");
		ta.append("开启Big7内核...\n");
	}
	
	public void CoreSay(String str)
	{
		 String all = ta.getText();
		if(!all.substring(all.length()-1).equals("\n"))
		{
			ta.append("\n");
		}
		ta.append(w1 +str + "\n");
	}
	public void ShellSay(String str)
	{
		 String all = ta.getText();
		if(!all.substring(all.length()-1).equals("\n"))
		{
			ta.append("\n");
		}
		ta.append(w2 +str + "\n");
	}
	
}
