summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/config/Themes.java
diff options
context:
space:
mode:
authorGravatar Gegy2019-01-30 21:05:32 +0200
committerGravatar GitHub2019-01-30 21:05:32 +0200
commitba7a354efae7d49833c887cf147ac940c975a1fa (patch)
tree02e14fda81dd5984e24f2df392c57c6e829fc875 /src/main/java/cuchaz/enigma/config/Themes.java
parentRewrite the Jenkinsfile to use the new declarative pipeline syntax, lets hope... (diff)
downloadenigma-fork-ba7a354efae7d49833c887cf147ac940c975a1fa.tar.gz
enigma-fork-ba7a354efae7d49833c887cf147ac940c975a1fa.tar.xz
enigma-fork-ba7a354efae7d49833c887cf147ac940c975a1fa.zip
Remap sources (#106)
* Source remapping beginnings * Fix navigation to remapped classes * Translate identifier info reference * Remap local variables with default names in source * Caching translator * Fix lack of highlighting for first opened class * Fix unicode variable names * Unicode checker shouldn't be checking just alphanumeric * Fix package tree being built from obf names * Don't index `this` as method call for method::reference * Apply proposed names * Fix source export issues * Replace unicode var names at bytecode level uniquely * Drop imports from editor source * Class selector fixes * Delta keep track of base mappings to enable lookup of old names * Optimize source remapping by remapping source with a StringBuffer instead of copying * Bump version
Diffstat (limited to 'src/main/java/cuchaz/enigma/config/Themes.java')
-rw-r--r--src/main/java/cuchaz/enigma/config/Themes.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/cuchaz/enigma/config/Themes.java b/src/main/java/cuchaz/enigma/config/Themes.java
index 00324f4..400ea3f 100644
--- a/src/main/java/cuchaz/enigma/config/Themes.java
+++ b/src/main/java/cuchaz/enigma/config/Themes.java
@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableMap;
4import cuchaz.enigma.gui.Gui; 4import cuchaz.enigma.gui.Gui;
5import cuchaz.enigma.gui.EnigmaSyntaxKit; 5import cuchaz.enigma.gui.EnigmaSyntaxKit;
6import cuchaz.enigma.gui.highlight.BoxHighlightPainter; 6import cuchaz.enigma.gui.highlight.BoxHighlightPainter;
7import cuchaz.enigma.gui.highlight.TokenHighlightType;
7import de.sciss.syntaxpane.DefaultSyntaxKit; 8import de.sciss.syntaxpane.DefaultSyntaxKit;
8 9
9import javax.swing.*; 10import javax.swing.*;
@@ -17,10 +18,11 @@ public class Themes {
17 } 18 }
18 19
19 public static void updateTheme(Gui gui) { 20 public static void updateTheme(Gui gui) {
20 Config.getInstance().lookAndFeel.apply(Config.getInstance()); 21 Config config = Config.getInstance();
21 Config.getInstance().lookAndFeel.setGlobalLAF(); 22 config.lookAndFeel.apply(config);
23 config.lookAndFeel.setGlobalLAF();
22 try { 24 try {
23 Config.getInstance().saveConfig(); 25 config.saveConfig();
24 } catch (IOException e) { 26 } catch (IOException e) {
25 e.printStackTrace(); 27 e.printStackTrace();
26 } 28 }
@@ -28,12 +30,11 @@ public class Themes {
28 DefaultSyntaxKit.initKit(); 30 DefaultSyntaxKit.initKit();
29 DefaultSyntaxKit.registerContentType("text/enigma-sources", EnigmaSyntaxKit.class.getName()); 31 DefaultSyntaxKit.registerContentType("text/enigma-sources", EnigmaSyntaxKit.class.getName());
30 gui.boxHighlightPainters = ImmutableMap.of( 32 gui.boxHighlightPainters = ImmutableMap.of(
31 "obfuscated", BoxHighlightPainter.create(Config.getInstance().obfuscatedColor, Config.getInstance().obfuscatedColorOutline), 33 TokenHighlightType.OBFUSCATED, BoxHighlightPainter.create(config.obfuscatedColor, config.obfuscatedColorOutline),
32 "proposed", BoxHighlightPainter.create(Config.getInstance().proposedColor, Config.getInstance().proposedColorOutline), 34 TokenHighlightType.PROPOSED, BoxHighlightPainter.create(config.proposedColor, config.proposedColorOutline),
33 "deobfuscated", BoxHighlightPainter.create(Config.getInstance().deobfuscatedColor, Config.getInstance().deobfuscatedColorOutline), 35 TokenHighlightType.DEOBFUSCATED, BoxHighlightPainter.create(config.deobfuscatedColor, config.deobfuscatedColorOutline)
34 "other", BoxHighlightPainter.create(null, Config.getInstance().otherColorOutline)
35 ); 36 );
36 gui.setEditorTheme(Config.getInstance().lookAndFeel); 37 gui.setEditorTheme(config.lookAndFeel);
37 SwingUtilities.updateComponentTreeUI(gui.getFrame()); 38 SwingUtilities.updateComponentTreeUI(gui.getFrame());
38 } 39 }
39} 40}