Class Terminal

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class Terminal extends JFrame

Terminal.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
See Also:
  • Field Details

    • textArea

      private static TextArea textArea
      The text area.
    • reading

      private boolean reading
      Used by KeyListener and read()
    • keyin

      private char keyin
      Used by KeyListener and read()
  • Constructor Details

    • Terminal

      public Terminal(String title)
      Create a new Terminal
      Parameters:
      title - the title of the Terminal frame
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      SimulaEditor: Main Entry for TESTING ONLY.
      Parameters:
      args - the arguments
      Throws:
      IOException - if an IOException occur
    • print

      public void print(String s)
      Writes a string to this Terminal.
      Parameters:
      s - the String to write
    • println

      public void println(String s)
      Writes a string to this Terminal and terminate the line.
      Parameters:
      s - the String to write
    • write

      public void write(String s)
      Write a string
      Parameters:
      s - the string to write
    • read

      public char read()
      Reads a single character.
      Returns:
      The character read
    • readLine

      public String readLine()
      Reads a line
      Returns:
      the line String read
    • getReader

      public Reader getReader()
      Get a reader suitable for reading from this terminal
      Returns:
      a reader
    • getInputStream

      public InputStream getInputStream()
      Get a InputStream suitable for reading from this terminal
      Returns:
      a OutputStream
    • getOutputStream

      public PrintStream getOutputStream()
      Get a PrintStream suitable for writing on this terminal
      Returns:
      a OutputStream
    • getWriter

      public Writer getWriter()
      Get a writer suitable for writing on this terminal
      Returns:
      a writer