Package apps
Class SystemConsole
java.lang.Object
apps.SystemConsole
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.
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classClass to deal with handling popup menustatic final classClass holding details of each scheme -
Field Summary
FieldsModifier and TypeFieldDescriptionint(package private) static final ResourceBundlestatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stop logging System output and error streams to the console.static JFrameReturn the JFrame containing the consoleintRetrieve the current console font size (default 12 point)intRetrieve the current console font stylegetFrame()static SystemConsoleGet current SystemConsole instance.intRetrieve the current console colour schemeintRetrieve the current console wrapping stylevoidopen()Start logging System output and error streams to the console.voidsetFontSize(int size) Set the console font sizevoidsetFontStyle(int style) Set the console font stylevoidsetScheme(int which) Set the console colour schemevoidsetWrapStyle(int style) Set the console wrapping style to one of the following:
-
Field Details
-
rbc
-
WRAP_STYLE_NONE
- See Also:
-
WRAP_STYLE_LINE
- See Also:
-
WRAP_STYLE_WORD
- See Also:
-
MAX_CONSOLE_LINES
-
-
Method Details
-
getInstance
Get current SystemConsole instance. If one doesn't yet exist, create it.- Returns:
- current SystemConsole instance
-
getConsole
Return the JFrame containing the console- Returns:
- console JFrame
-
getFrame
-
setWrapStyle
Set the console wrapping style to one of the following:- Parameters:
style- one of the defined style attributes - one ofWRAP_STYLE_NONENo wrappingWRAP_STYLE_LINEWrap at end of lineWRAP_STYLE_WORDWrap by word boundaries
-
getWrapStyle
Retrieve the current console wrapping style- Returns:
- current wrapping style - one of
WRAP_STYLE_NONENo wrappingWRAP_STYLE_LINEWrap at end of lineWRAP_STYLE_WORDWrap by word boundaries (default)
-
setFontSize
Set the console font size- Parameters:
size- point size of font between 6 and 24 point
-
getFontSize
Retrieve the current console font size (default 12 point)- Returns:
- selected font size in points
-
setFontStyle
Set the console font style- Parameters:
style- one ofFont.BOLD,Font.ITALIC,Font.PLAIN(default)
-
getFontStyle
Retrieve the current console font style- Returns:
- selected font style - one of
Font.BOLD,Font.ITALIC,Font.PLAIN(default)
-
setScheme
Set the console colour scheme- Parameters:
which- the scheme to use
-
getOutputStream
-
getErrorStream
-
close
Stop logging System output and error streams to the console. -
open
Start logging System output and error streams to the console. -
getScheme
Retrieve the current console colour scheme- Returns:
- selected colour scheme
-
getSchemes
-