Module Simula

Class ConsolePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public final class ConsolePanel extends JPanel
a Console panel.

Link to GitHub: Source File.

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

    • textPane

      private static JTextPane textPane
      The text pane.
    • doc

      private StyledDocument doc
      the StyledDocument showed in this panel
    • styleRegular

      private Style styleRegular
      Regular style
    • styleWarning

      private Style styleWarning
      Warning style
    • styleError

      private Style styleError
      Error style
    • popupMenu

      private JPopupMenu popupMenu
      the Popup Menu
    • clearItem

      private JMenuItem clearItem
      Menu item clear
    • copyItem

      private JMenuItem copyItem
      Menu item copy
    • reading

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

      private char keyin
      Used by KeyListener and read()
    • mouseListener

      MouseListener mouseListener
      the MouseListener
    • actionListener

      ActionListener actionListener
      the ActionListener
    • listener

      private KeyListener listener
      the KeyListener
  • Constructor Details

    • ConsolePanel

      public ConsolePanel()
      Create a new ConsolePanel.
  • Method Details

    • read

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

      public OutputStream getOutputStream()
      Get a OutputStream suitable for writing on this panel
      Returns:
      a OutputStream
    • getErrorStream

      public OutputStream getErrorStream()
      Get a OutputStream suitable for writing errors on this panel
      Returns:
      a OutputStream
    • write

      public void write(String s)
      Write a string on this panel using styleRegular.
      Parameters:
      s - a string to write
    • writeError

      void writeError(String s)
      Write a string on this panel using styleError.
      Parameters:
      s - a string to write
    • writeWarning

      void writeWarning(String s)
      Write a string on this panel using styleWarning.
      Parameters:
      s - a string to write
    • write

      private void write(String s, Style style)
      Write a string onto this Console.
      Parameters:
      s - the string to write
      style - the style
    • clear

      private void clear()
      Clear the Console.
    • IERR

      private static void IERR(String msg, Throwable e)
      Utility method IERR
      Parameters:
      msg - error message
      e - the underlying cause
    • popup

      public void popup()
      popup this Console Panel
    • addStylesToDocument

      private void addStylesToDocument(StyledDocument doc)
      Utility to add styles to the document
      Parameters:
      doc - the document