diff options
| author | 2017-06-07 08:29:37 +0100 | |
|---|---|---|
| committer | 2017-06-07 08:29:37 +0100 | |
| commit | ba5ffc258f6d58bf9d01226baea016db10cfd811 (patch) | |
| tree | 4fd3b77e619198a47d95ee55a742c8057dea591a /src/main/java/cuchaz/enigma/gui/MinecraftSyntaxKit.java | |
| parent | Add support for custom themes (#59) (diff) | |
| download | enigma-fork-ba5ffc258f6d58bf9d01226baea016db10cfd811.tar.gz enigma-fork-ba5ffc258f6d58bf9d01226baea016db10cfd811.tar.xz enigma-fork-ba5ffc258f6d58bf9d01226baea016db10cfd811.zip | |
Added theme switcher + dark theme (#60)
* Initial work on the color config
* Save and read config from file.+
* Allow changing the editor colors
* Remove the right margin
* Move config to the user's home dir
* Use Guava instead of Apache commons
* Add runtime theme switching, includes example "dark" theme.
* Rename dark theme as requested
* Small clean up
* Include suggestions from @Thog
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/MinecraftSyntaxKit.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/gui/MinecraftSyntaxKit.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/MinecraftSyntaxKit.java b/src/main/java/cuchaz/enigma/gui/MinecraftSyntaxKit.java index 41de035..96327ab 100644 --- a/src/main/java/cuchaz/enigma/gui/MinecraftSyntaxKit.java +++ b/src/main/java/cuchaz/enigma/gui/MinecraftSyntaxKit.java | |||
| @@ -4,12 +4,8 @@ import cuchaz.enigma.config.Config; | |||
| 4 | import de.sciss.syntaxpane.syntaxkits.JavaSyntaxKit; | 4 | import de.sciss.syntaxpane.syntaxkits.JavaSyntaxKit; |
| 5 | import de.sciss.syntaxpane.util.Configuration; | 5 | import de.sciss.syntaxpane.util.Configuration; |
| 6 | 6 | ||
| 7 | /** | ||
| 8 | * Created by Mark on 04/06/2017. | ||
| 9 | */ | ||
| 10 | public class MinecraftSyntaxKit extends JavaSyntaxKit { | 7 | public class MinecraftSyntaxKit extends JavaSyntaxKit { |
| 11 | 8 | private static Configuration configuration = null; | |
| 12 | public Configuration configuration = null; | ||
| 13 | 9 | ||
| 14 | @Override | 10 | @Override |
| 15 | public Configuration getConfig() { | 11 | public Configuration getConfig() { |
| @@ -22,17 +18,21 @@ public class MinecraftSyntaxKit extends JavaSyntaxKit { | |||
| 22 | public void initConfig(Configuration baseConfig){ | 18 | public void initConfig(Configuration baseConfig){ |
| 23 | configuration = baseConfig; | 19 | configuration = baseConfig; |
| 24 | //See de.sciss.syntaxpane.TokenType | 20 | //See de.sciss.syntaxpane.TokenType |
| 25 | configuration.put("Style.KEYWORD", Config.INSTANCE.highlightColor + ", 0"); | 21 | configuration.put("Style.KEYWORD", Config.getInstance().highlightColor + ", 0"); |
| 26 | configuration.put("Style.KEYWORD2", Config.INSTANCE.highlightColor + ", 3"); | 22 | configuration.put("Style.KEYWORD2", Config.getInstance().highlightColor + ", 3"); |
| 27 | configuration.put("Style.STRING", Config.INSTANCE.stringColor + ", 0"); | 23 | configuration.put("Style.STRING", Config.getInstance().stringColor + ", 0"); |
| 28 | configuration.put("Style.STRING2", Config.INSTANCE.stringColor + ", 1"); | 24 | configuration.put("Style.STRING2", Config.getInstance().stringColor + ", 1"); |
| 29 | configuration.put("Style.NUMBER", Config.INSTANCE.numberColor + ", 1"); | 25 | configuration.put("Style.NUMBER", Config.getInstance().numberColor + ", 1"); |
| 30 | configuration.put("Style.OPERATOR", Config.INSTANCE.operatorColor + ", 0"); | 26 | configuration.put("Style.OPERATOR", Config.getInstance().operatorColor + ", 0"); |
| 31 | configuration.put("Style.DELIMITER", Config.INSTANCE.delimiterColor + ", 1"); | 27 | configuration.put("Style.DELIMITER", Config.getInstance().delimiterColor + ", 1"); |
| 32 | configuration.put("Style.TYPE", Config.INSTANCE.typeColor + ", 2"); | 28 | configuration.put("Style.TYPE", Config.getInstance().typeColor + ", 2"); |
| 33 | configuration.put("Style.TYPE2", Config.INSTANCE.typeColor + ", 1"); | 29 | configuration.put("Style.TYPE2", Config.getInstance().typeColor + ", 1"); |
| 34 | configuration.put("Style.IDENTIFIER", Config.INSTANCE.identifierColor + ", 0"); | 30 | configuration.put("Style.IDENTIFIER", Config.getInstance().identifierColor + ", 0"); |
| 35 | configuration.put("Style.DEFAULT", Config.INSTANCE.defaultTextColor + ", 0"); | 31 | configuration.put("Style.DEFAULT", Config.getInstance().defaultTextColor + ", 0"); |
| 36 | configuration.put("RightMarginColumn", "999"); //No need to have a right margin, if someone wants it add a config | 32 | configuration.put("RightMarginColumn", "999"); //No need to have a right margin, if someone wants it add a config |
| 37 | } | 33 | } |
| 34 | |||
| 35 | public static void invalidate(){ | ||
| 36 | configuration = null; | ||
| 37 | } | ||
| 38 | } | 38 | } |