// Path: src/us/pfrommer/insteon/terminal/console/Console.java
// public interface Console {
// 	public String readLine() throws IOException;
// 	public String readLine(String prompt) throws IOException;
// 	
// 	public void addConsoleListener(ConsoleListener l);
// 	public void removeConsoleListener(ConsoleListener l);
// 	
// 	public Reader in();
// 	public PrintStream out();
// 	public PrintStream err();
// 	
// 	public void clear();
// 	public void reset();
// }
// 
// Path: src/us/pfrommer/insteon/terminal/console/ConsoleListener.java
// public interface ConsoleListener {
// 	// callback for terminating the current running command
// 	public void terminate();
// }


import java.awt.Color;
import java.awt.Font;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PipedReader;
import java.io.PipedWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JTextPane;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import us.pfrommer.insteon.terminal.console.Console;
import us.pfrommer.insteon.terminal.console.ConsoleListener;
package	us.pfrommer.insteon.terminal.console.gui;




//A no-longer-used class which
//shows both the input and the output in the same text pane
public class FancyConsoleArea extends JTextPane implements Console, KeyListener {
	private static final long serialVersionUID = 1L;
	
	//A list sorted from most recent to least recent command
	private ArrayList<String> m_history = new ArrayList<String>();
	
	private int m_historyIndex = -1;
	
	private ConsoleStream m_in;
	
	private ConsolePrintStream m_out;
	private ConsolePrintStream m_err;

// Path: src/us/pfrommer/insteon/terminal/console/Console.java
// public interface Console {
// 	public String readLine() throws IOException;
// 	public String readLine(String prompt) throws IOException;
// 	
// 	public void addConsoleListener(ConsoleListener l);
// 	public void removeConsoleListener(ConsoleListener l);
// 	
// 	public Reader in();
// 	public PrintStream out();
// 	public PrintStream err();
// 	
// 	public void clear();
// 	public void reset();
// }
// 
// Path: src/us/pfrommer/insteon/terminal/console/ConsoleListener.java
// public interface ConsoleListener {
// 	// callback for terminating the current running command
// 	public void terminate();
// }


// Path: src/us/pfrommer/insteon/terminal/console/gui/FancyConsoleArea.java
import java.awt.Color;
import java.awt.Font;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PipedReader;
import java.io.PipedWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JTextPane;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import us.pfrommer.insteon.terminal.console.Console;
import us.pfrommer.insteon.terminal.console.ConsoleListener;

package	us.pfrommer.insteon.terminal.console.gui;




//A no-longer-used class which
//shows both the input and the output in the same text pane
public class FancyConsoleArea extends JTextPane implements Console, KeyListener {
	private static final long serialVersionUID = 1L;
	
	//A list sorted from most recent to least recent command
	private ArrayList<String> m_history = new ArrayList<String>();
	
	private int m_historyIndex = -1;
	
	private ConsoleStream m_in;
	
	private ConsolePrintStream m_out;
	private ConsolePrintStream m_err;

	private HashSet<ConsoleListener> m_listeners = new HashSet<ConsoleListener>();