content: /**
   * This file is part of Aion-Lightning <aion-lightning.org>.
   *
   *  Aion-Lightning is free software: you can redistribute it and/or modify
   *  it under the terms of the GNU General Public License as published by
   *  the Free Software Foundation, either version 3 of the License, or
   *  (at your option) any later version.
   *
   *  Aion-Lightning is distributed in the hope that it will be useful,
   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   *  GNU General Public License for more details. *
   *  You should have received a copy of the GNU General Public License
   *  along with Aion-Lightning.
   *  If not, see <http://www.gnu.org/licenses/>.
   */
  
  
  /*
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation; either version 2, or (at your option)
   * any later version.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with this program; if not, write to the Free Software
   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   * 02111-1307, USA.
   *
   * http://www.gnu.org/copyleft/gpl.html
   */
  package com.aionemu.packetsamurai.gui;
  
  import java.awt.GridBagConstraints;
  import java.awt.GridBagLayout;
  import java.awt.Insets;
  
  import javax.swing.JPanel;
  import javax.swing.JScrollPane;
  import javax.swing.JTextArea;
  import javax.swing.text.DefaultCaret;
  
  /**
   * @author Ulysses R. Ribeiro
   *
   */
  @SuppressWarnings("serial")
  public class ConsoleTab extends JPanel
  {
  	private GridBagConstraints _cons = new GridBagConstraints();
  	private GridBagLayout _layout = new GridBagLayout();
  	
      private JTextArea _textPane;
      
  	public ConsoleTab()
  	{
  		this.setLayout(_layout);
  		_cons.fill = GridBagConstraints.BOTH;
  		_cons.weightx = 1;
  		_cons.weighty = 1;
  		_cons.insets = new Insets(5,5,5,5);
  		_textPane = new JTextArea();
  		_textPane.setEditable(false);
  		DefaultCaret caret = (DefaultCaret)_textPane.getCaret();
  		caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
  		this.add(new JScrollPane(_textPane,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED),_cons);
  	}
  
  	public void addText(String text)
  	{
          _textPane.append(text+"\n");
  	}
  
  }
  