Revision 1440
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/syntaxhighlight/JRSyntaxTextArea.java | ||
---|---|---|
6 | 6 |
import java.awt.Container; |
7 | 7 |
import java.awt.Cursor; |
8 | 8 |
import java.awt.Dimension; |
9 |
import java.awt.Font; |
|
9 | 10 |
import java.awt.Point; |
10 | 11 |
import java.awt.Rectangle; |
11 | 12 |
import java.awt.event.ActionEvent; |
... | ... | |
39 | 40 |
import javax.swing.JViewport; |
40 | 41 |
import javax.swing.KeyStroke; |
41 | 42 |
import javax.swing.SwingUtilities; |
43 |
import javax.swing.UIDefaults; |
|
42 | 44 |
import javax.swing.UIManager; |
43 | 45 |
import javax.swing.event.CaretEvent; |
44 | 46 |
import javax.swing.event.CaretListener; |
... | ... | |
132 | 134 |
private final String tag; |
133 | 135 |
|
134 | 136 |
public Line(String tag, final int lineno, int posy, Color color, String tooltip) { |
137 |
UIDefaults uidefaults = UIManager.getLookAndFeel().getDefaults(); |
|
138 |
this.setBackground((Color) uidefaults.get("EditorPane.background")); |
|
139 |
this.setForeground((Color) uidefaults.get("EditorPane.foreground")); |
|
140 |
|
|
135 | 141 |
this.lineno = lineno; |
136 |
this.tag = tag; |
|
142 |
this.tag = tag;
|
|
137 | 143 |
this.setBackground(color); |
138 | 144 |
this.setBounds(0, posy, 15, 2); |
139 | 145 |
this.setOpaque(true); |
... | ... | |
294 | 300 |
|
295 | 301 |
this.textArea = new RSyntaxTextArea(20, 60); |
296 | 302 |
|
303 |
UIDefaults uidefaults = UIManager.getLookAndFeel().getDefaults(); |
|
304 |
|
|
305 |
// https://alvinalexander.com/java/java-uimanager-color-keys-list/ |
|
306 |
this.textArea.setBackground((Color) uidefaults.get("EditorPane.background")); |
|
307 |
this.textArea.setForeground((Color) uidefaults.get("EditorPane.foreground")); |
|
308 |
this.textArea.setFont((Font) uidefaults.get("EditorPane.font")); |
|
309 |
|
|
297 | 310 |
this.init(); |
298 | 311 |
lineTrackerPanel = new LineTrackerPanel(); |
299 |
scrollPanel = new RTextScrollPane(this.textArea); |
|
300 |
scrollPanel.setIconRowHeaderEnabled(true); |
|
301 |
scrollPanel.setLineNumbersEnabled(true); |
|
302 |
scrollPanel.setFoldIndicatorEnabled(true); |
|
312 |
this.scrollPanel = new RTextScrollPane(this.textArea); |
|
313 |
this.scrollPanel.setBackground((Color) uidefaults.get("EditorPane.background")); |
|
314 |
this.scrollPanel.setForeground((Color) uidefaults.get("EditorPane.foreground")); |
|
315 |
this.scrollPanel.setFont((Font) uidefaults.get("EditorPane.font")); |
|
316 |
this.scrollPanel.setIconRowHeaderEnabled(true); |
|
317 |
this.scrollPanel.setLineNumbersEnabled(true); |
|
318 |
this.scrollPanel.setFoldIndicatorEnabled(true); |
|
303 | 319 |
|
304 | 320 |
panel = new JPanel(); |
305 | 321 |
panel.setLayout(new BorderLayout()); |
Also available in: Unified diff