| Revision | 9e1b6fe609c53166c39913064663f5b75bccc585 (tree) |
|---|---|
| Time | 2015-12-25 16:05:57 |
| Author | Mirrgie Riana @ Kurilab ASUS |
| Commiter | Mirrgie Riana @ Kurilab ASUS |
FrameFormula: use: rsyntaxtextarea
| @@ -20,6 +20,7 @@ | ||
| 20 | 20 | testCompile group: 'junit', name: 'junit', version: '4.+' |
| 21 | 21 | |
| 22 | 22 | compile 'org.eclipse.jdt:org.eclipse.jdt.annotation:2.0.0' |
| 23 | + compile group: 'com.fifesoft', name: 'rsyntaxtextarea', version: 'r239' | |
| 23 | 24 | |
| 24 | 25 | compile group: 'mirrg', name: 'mirrg.struct.hydrogen-1.0', version: '+' |
| 25 | 26 | compile group: 'mirrg', name: 'mirrg.swing.neon-1.1', version: '+' |
| @@ -2,6 +2,7 @@ | ||
| 2 | 2 | |
| 3 | 3 | import java.awt.CardLayout; |
| 4 | 4 | import java.awt.Color; |
| 5 | +import java.awt.Font; | |
| 5 | 6 | import java.io.BufferedReader; |
| 6 | 7 | import java.io.ByteArrayOutputStream; |
| 7 | 8 | import java.io.File; |
| @@ -25,6 +26,9 @@ | ||
| 25 | 26 | import javax.swing.event.DocumentListener; |
| 26 | 27 | import javax.swing.filechooser.FileNameExtensionFilter; |
| 27 | 28 | |
| 29 | +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; | |
| 30 | +import org.fife.ui.rsyntaxtextarea.SyntaxConstants; | |
| 31 | + | |
| 28 | 32 | import mirrg.event.nitrogen.api.v1_0.INitrogenEventRegistry; |
| 29 | 33 | import mirrg.game.math.wulfenite.v0_1.events.NitrogenEventWulfenite; |
| 30 | 34 | import mirrg.game.math.wulfenite.v0_1.events.NitrogenEventWulfeniteFrameFormula; |
| @@ -39,7 +43,7 @@ | ||
| 39 | 43 | private static final long serialVersionUID = -69686069227706495L; |
| 40 | 44 | |
| 41 | 45 | protected INitrogenEventRegistry eventRegistry; |
| 42 | - protected JTextArea textAreaSource; | |
| 46 | + protected RSyntaxTextArea textAreaSource; | |
| 43 | 47 | protected JTextArea textAreaShow; |
| 44 | 48 | |
| 45 | 49 | protected String titleBase; |
| @@ -213,7 +217,18 @@ | ||
| 213 | 217 | splitPane.setResizeWeight(0.5); |
| 214 | 218 | |
| 215 | 219 | { |
| 216 | - textAreaSource = new JTextArea(); | |
| 220 | + textAreaSource = new RSyntaxTextArea(); | |
| 221 | + textAreaSource.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); | |
| 222 | + textAreaSource.setText(""); | |
| 223 | + textAreaSource.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12)); | |
| 224 | + textAreaSource.setWhitespaceVisible(false); | |
| 225 | + textAreaSource.setMarginLineEnabled(false); | |
| 226 | + textAreaSource.setEOLMarkersVisible(false); | |
| 227 | + textAreaSource.setFadeCurrentLineHighlight(false); | |
| 228 | + textAreaSource.setHighlightCurrentLine(false); | |
| 229 | + textAreaSource.setMarkOccurrences(true); | |
| 230 | + textAreaSource.setRoundedSelectionEdges(true); | |
| 231 | + | |
| 217 | 232 | splitPane.add(new JScrollPane(textAreaSource)); |
| 218 | 233 | textAreaSource.getDocument().addDocumentListener(new DocumentListener() { |
| 219 | 234 |