Package apps

Class SystemConsole


  • public final class SystemConsole
    extends java.lang.Object
    Class to direct standard output and standard error to a ( JTextArea ) TextAreaFIFO . This allows for easier clipboard operations etc.
    This file is part of JMRI.

    JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

    JMRI 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.

    • Method Detail

      • getInstance

        public static SystemConsole getInstance()
        Get current SystemConsole instance. If one doesn't yet exist, create it.
        Returns:
        current SystemConsole instance
      • getConsole

        public static javax.swing.JFrame getConsole()
        Return the JFrame containing the console
        Returns:
        console JFrame
      • getFrame

        public javax.swing.JFrame getFrame()
      • setFontSize

        public void setFontSize​(int size)
        Set the console font size
        Parameters:
        size - point size of font between 6 and 24 point
      • getFontSize

        public int getFontSize()
        Retrieve the current console font size (default 12 point)
        Returns:
        selected font size in points
      • setFontStyle

        public void setFontStyle​(int style)
        Set the console font style
        Parameters:
        style - one of Font.BOLD, Font.ITALIC, Font.PLAIN (default)
      • getFontStyle

        public int getFontStyle()
        Retrieve the current console font style
        Returns:
        selected font style - one of Font.BOLD, Font.ITALIC, Font.PLAIN (default)
      • setScheme

        public void setScheme​(int which)
        Set the console colour scheme
        Parameters:
        which - the scheme to use
      • close

        public void close()
        Stop logging System output and error streams to the console.
      • open

        public void open()
        Start logging System output and error streams to the console.
      • getScheme

        public int getScheme()
        Retrieve the current console colour scheme
        Returns:
        selected colour scheme