@@ -58,6 +58,9 @@ public static void setCurrentEditorConsole(EditorConsole console) {
58
58
private final DefaultStyledDocument document ;
59
59
private final JTextPane consoleTextPane ;
60
60
61
+ private SimpleAttributeSet stdOutStyle ;
62
+ private SimpleAttributeSet stdErrStyle ;
63
+
61
64
public EditorConsole () {
62
65
document = new DefaultStyledDocument ();
63
66
@@ -74,7 +77,7 @@ public EditorConsole() {
74
77
Font editorFont = PreferencesData .getFont ("editor.font" );
75
78
Font actualFont = new Font (consoleFont .getName (), consoleFont .getStyle (), scale (editorFont .getSize ()));
76
79
77
- SimpleAttributeSet stdOutStyle = new SimpleAttributeSet ();
80
+ stdOutStyle = new SimpleAttributeSet ();
78
81
StyleConstants .setForeground (stdOutStyle , Theme .getColor ("console.output.color" ));
79
82
StyleConstants .setBackground (stdOutStyle , backgroundColour );
80
83
StyleConstants .setFontSize (stdOutStyle , actualFont .getSize ());
@@ -84,7 +87,7 @@ public EditorConsole() {
84
87
85
88
consoleTextPane .setParagraphAttributes (stdOutStyle , true );
86
89
87
- SimpleAttributeSet stdErrStyle = new SimpleAttributeSet ();
90
+ stdErrStyle = new SimpleAttributeSet ();
88
91
StyleConstants .setForeground (stdErrStyle , Theme .getColor ("console.error.color" ));
89
92
StyleConstants .setBackground (stdErrStyle , backgroundColour );
90
93
StyleConstants .setFontSize (stdErrStyle , actualFont .getSize ());
@@ -109,6 +112,18 @@ public EditorConsole() {
109
112
EditorConsole .init (stdOutStyle , System .out , stdErrStyle , System .err );
110
113
}
111
114
115
+ public void applyPreferences () {
116
+ Font consoleFont = Theme .getFont ("console.font" );
117
+ Font editorFont = PreferencesData .getFont ("editor.font" );
118
+ Font actualFont = new Font (consoleFont .getName (), consoleFont .getStyle (), scale (editorFont .getSize ()));
119
+
120
+ StyleConstants .setFontSize (stdOutStyle , actualFont .getSize ());
121
+ StyleConstants .setFontSize (stdErrStyle , actualFont .getSize ());
122
+
123
+ out .setAttibutes (stdOutStyle );
124
+ err .setAttibutes (stdErrStyle );
125
+ }
126
+
112
127
public void clear () {
113
128
try {
114
129
document .remove (0 , document .getLength ());
0 commit comments