Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
7660632
add POC tooltip to EditorPanel editor that shows full name of entry u…
supersaiyansubtlety Sep 27, 2025
c22af36
update tooltip content when mouse moves, but can't get JToolTip to re…
supersaiyansubtlety Sep 28, 2025
8b33d5c
replace EditorPanel's use of JToolTip and TooltipManager with JWindow…
supersaiyansubtlety Sep 28, 2025
ea22d93
check if same token instead of same entry when updating tooltip
supersaiyansubtlety Sep 28, 2025
e5336a2
replace complex Optional composition with consumer methods
supersaiyansubtlety Sep 28, 2025
79fe0e7
extract BaseEditorPanel without tooltip, navigator, or listeners
supersaiyansubtlety Sep 28, 2025
1fb4c3e
display entries' entire outer source class in their tooltips
supersaiyansubtlety Sep 29, 2025
3565ce4
always set tooltipEditor classhandle instead of setting source when i…
supersaiyansubtlety Sep 29, 2025
504f304
add javaparser dep matching #308
supersaiyansubtlety Sep 30, 2025
bd772be
implement source trimming for classes using javaparser
supersaiyansubtlety Oct 1, 2025
d0d0cff
minor improvements
supersaiyansubtlety Oct 1, 2025
ce87d4d
minor cleanup
supersaiyansubtlety Oct 1, 2025
dcbdc48
make trimFactor a param instead of a field
supersaiyansubtlety Oct 1, 2025
86a707c
implement source trimming for methods
supersaiyansubtlety Oct 1, 2025
e3034b1
match declarations only by range and extract findDeclaration
supersaiyansubtlety Oct 1, 2025
d9678eb
inline variable
supersaiyansubtlety Oct 1, 2025
26d56e9
implement field source trimming
supersaiyansubtlety Oct 2, 2025
74ef674
fix tooltip source trimming for static record fields
supersaiyansubtlety Oct 2, 2025
fe8e653
update TODOs
supersaiyansubtlety Oct 2, 2025
349ba70
extract TooltipEditorPanel
supersaiyansubtlety Oct 2, 2025
953f68d
trim param tooltip target source to parent method
supersaiyansubtlety Oct 2, 2025
612adc3
fail early when target declaration token is missing
supersaiyansubtlety Oct 3, 2025
1248847
fix tooltip source trimming for constructors
supersaiyansubtlety Oct 3, 2025
6c32ab3
minor refactor
supersaiyansubtlety Oct 3, 2025
afb4302
show record component parent instead of just component; matches param…
supersaiyansubtlety Oct 3, 2025
e62e9e4
when excluding implements from record component parent, find token in…
supersaiyansubtlety Oct 3, 2025
4c93021
close and destroy tooltip when source changes
supersaiyansubtlety Oct 4, 2025
89b6a48
silently ignore missing declaration tokens (until #252 is fixed)
supersaiyansubtlety Oct 4, 2025
80e84de
restore quickFindToolbar to ui
supersaiyansubtlety Oct 4, 2025
135f5f9
restore EditorPanel popupMenu functionality
supersaiyansubtlety Oct 4, 2025
2247f1c
improve caret pos logic in BaseEditorPanel::setSource
supersaiyansubtlety Oct 4, 2025
45e5a30
replace source with message if the declaration token could be found
supersaiyansubtlety Oct 5, 2025
1492eed
implement source snippet unindenting
supersaiyansubtlety Oct 5, 2025
b895751
replace entry simple name label with formatted parent name label
supersaiyansubtlety Oct 5, 2025
07c0ce2
add 'From: ' prefix to parent label
supersaiyansubtlety Oct 5, 2025
9b1da08
add javadocs to tooltip
supersaiyansubtlety Oct 5, 2025
5f51673
allow disabling tooltip
supersaiyansubtlety Oct 5, 2025
a7040f0
make tooltip optionally interactable
supersaiyansubtlety Oct 5, 2025
4e20fa1
prevent hiding tooltip when cursor is over a token or the tooltip
supersaiyansubtlety Oct 5, 2025
881e930
fix parent label for top-level classes and add missing dot separator …
supersaiyansubtlety Oct 6, 2025
e73e165
allow clicking entries withing tooltip to populate tooltip with that …
supersaiyansubtlety Oct 6, 2025
a13af94
fix calculation for offsetting multiline snippet pos to un-trimmed pos
supersaiyansubtlety Oct 6, 2025
375833f
minor improvements, add TODOs
supersaiyansubtlety Oct 6, 2025
eec035a
resolve references when finding tooltip targets
supersaiyansubtlety Oct 6, 2025
d1d4888
customize tooltip target highlighting
supersaiyansubtlety Oct 6, 2025
59b93a0
update TODOs regarding records
supersaiyansubtlety Oct 6, 2025
3d622b4
polish tooltip positioning
supersaiyansubtlety Oct 7, 2025
6ac519e
increase padding at outer edges of tooltip rows
supersaiyansubtlety Oct 7, 2025
998b0a3
use a JPanel with a GridBagLayout instead of a Box as the content pan…
supersaiyansubtlety Oct 8, 2025
0dce574
reject some TODOs
supersaiyansubtlety Oct 8, 2025
e12ee8a
ctrl+click on parent package label to naviage to package
supersaiyansubtlety Oct 9, 2025
409cc51
fix tooltip separators
supersaiyansubtlety Oct 9, 2025
ee995dc
respect tooltip ineractable config for parent package clicking
supersaiyansubtlety Oct 9, 2025
2730842
use global focus listener to ensure tooltip is closed when neither it…
supersaiyansubtlety Oct 9, 2025
156b84f
move consumeMousePosition... methods to GuiUtil
supersaiyansubtlety Oct 11, 2025
3c6c9e1
rename EditorTooltip -> EntryTooltip
supersaiyansubtlety Oct 12, 2025
d67ca60
use GridBagConstraintsBuilder in initEditorPane
supersaiyansubtlety Oct 12, 2025
8d58d83
make tooltip focusable; enables copying tooltip content
supersaiyansubtlety Oct 12, 2025
693a430
fix hiding tooltip immediately after re-populating it
supersaiyansubtlety Oct 12, 2025
a749ee0
remove tooltip to editor click forward as it didn't work consistently
supersaiyansubtlety Oct 12, 2025
484bbb4
add EntryTooltip.repopulated field for workaround
supersaiyansubtlety Oct 12, 2025
cbcf0b4
deobfuscate parent package
supersaiyansubtlety Oct 13, 2025
5a46dc2
focus class selector when navigating to parent package from tooltip
supersaiyansubtlety Oct 13, 2025
7bfbb6e
scroll to class selector path when navigating from entry tooltip parent
supersaiyansubtlety Oct 13, 2025
c0e225a
move Config.persistentEditorQuickFind to EditorConfig.persistentQuick…
supersaiyansubtlety Oct 13, 2025
e573b6c
rename config getter methods to match their ids and update Config jav…
supersaiyansubtlety Oct 13, 2025
f6d5eb1
fix another tooltip focus issue
supersaiyansubtlety Oct 14, 2025
5b3e86e
fix bug preventing RecordGetterFindingVisitor from finding inner reco…
supersaiyansubtlety Oct 14, 2025
ab68358
rename RecordGetterFindingVisitor -> RecordIndexingVisitor
supersaiyansubtlety Oct 14, 2025
309cfbf
clear things in visitEnd instead of visit
supersaiyansubtlety Oct 14, 2025
626fe8e
fix for java 17
supersaiyansubtlety Oct 14, 2025
f19d5db
tighten RecordIndexingVisitor encapsulation
supersaiyansubtlety Oct 15, 2025
96c7ed9
make navigating to a record component getter with no explicit declara…
supersaiyansubtlety Oct 15, 2025
37fbaf3
add nullable annotation
supersaiyansubtlety Oct 15, 2025
8ac9726
only set BaseEditorPanel.editor text once
supersaiyansubtlety Oct 15, 2025
470d0be
fix typo
supersaiyansubtlety Oct 15, 2025
393cf53
tweak moveMaintainingAnchor
supersaiyansubtlety Oct 15, 2025
9857a47
close entry tooltip on key press
supersaiyansubtlety Oct 15, 2025
a9d6cb0
close tooltip on KEY_TYPED instead of KEY_PRESSED so ctrl+c can copy
supersaiyansubtlety Oct 15, 2025
92a8d9b
add javaparser to lib list in README
supersaiyansubtlety Oct 18, 2025
ac7797c
cleanup createSnippet
supersaiyansubtlety Oct 19, 2025
8751d3b
fix swapped un/bounded names
supersaiyansubtlety Oct 19, 2025
7e3539f
make LineIndexer::getIndex return -1 for out-of-bounds positions, add…
supersaiyansubtlety Oct 19, 2025
3e32251
rename EditorTooltipSection -> EntryTooltipSection
supersaiyansubtlety Oct 22, 2025
0563d0f
limit EntryTooltip size
supersaiyansubtlety Oct 24, 2025
726bda5
put main tooltip content in a scroll pane
supersaiyansubtlety Oct 24, 2025
36a8e89
focus snippet editor ui on source set
supersaiyansubtlety Oct 24, 2025
e923fd5
checkstyle
supersaiyansubtlety Oct 24, 2025
18be34f
replace AtomicInteger gridY's with primitive ints
supersaiyansubtlety Oct 24, 2025
3602642
Merge branch 'develop/2.7' into entry-tooltips
supersaiyansubtlety Oct 26, 2025
dd47e88
hard cap tooltip width at 600px (scaled)
supersaiyansubtlety Oct 27, 2025
5561348
expand parent package path when navigating from tooltip
supersaiyansubtlety Oct 27, 2025
03c1015
explicitly check if source is bounded when setting 'Unable to locate …
supersaiyansubtlety Oct 27, 2025
9afcd61
improve constructor name check
supersaiyansubtlety Oct 27, 2025
fa6b96f
use 'inherited from' label for tooltip labels for entries that resolv…
supersaiyansubtlety Oct 27, 2025
86cca4c
dispatch key events that close the entry tooltip to the previously fo…
supersaiyansubtlety Oct 28, 2025
fd800d8
close entry tooltip with global mouse listener
supersaiyansubtlety Oct 28, 2025
ac2b2e7
add gui for entry tooltip config
supersaiyansubtlety Oct 28, 2025
661a880
deduplicate check box sync logic
supersaiyansubtlety Oct 28, 2025
6cca386
javadoc createSyncedCheckBox
supersaiyansubtlety Oct 28, 2025
44b9fe9
javadoc syncStateWithConfig override
supersaiyansubtlety Oct 28, 2025
93f4978
move tooltip management to EnitorPanel.TooltipManager
supersaiyansubtlety Oct 29, 2025
77b4326
minor refactor
supersaiyansubtlety Oct 29, 2025
be44d7d
make 'tooltips' consistently plural in user-facing strings
supersaiyansubtlety Oct 30, 2025
a1c460b
dispatch KEY_PRESSED events that close entry tooltips (with exception…
supersaiyansubtlety Oct 31, 2025
bd5d3a6
rework moveMaintainingAnchor when tooltip shrunk
supersaiyansubtlety Oct 31, 2025
fa4a103
use local syntaxpain version and switch to manual installation
supersaiyansubtlety Oct 18, 2025
c24340e
add LineNumbersRuler in EditorPanel instead of BaseEditorPanel
supersaiyansubtlety Oct 18, 2025
c528ca6
update for removal of SyntaxpainConfiguration
supersaiyansubtlety Oct 18, 2025
5c225bb
add offset line ruler to DeclarationSnippetPanel
supersaiyansubtlety Oct 19, 2025
944ba5e
clarify LineIndexer::getLine
supersaiyansubtlety Oct 19, 2025
527e5ed
extract LineIndexer::collectLine
supersaiyansubtlety Oct 19, 2025
3d6de31
add LineIndexerTest::testGetLine
supersaiyansubtlety Oct 19, 2025
416dc60
use snippet start instead of token start for line number offset: fix …
supersaiyansubtlety Oct 20, 2025
36872f9
check style
supersaiyansubtlety Oct 20, 2025
1455d54
make selection color and pairsMarker color configurable
supersaiyansubtlety Oct 20, 2025
c737114
adjust default selection and pairsMarker colors for darcula and darce…
supersaiyansubtlety Oct 20, 2025
ce55927
fix LineIndexer::getLine for the first index of a line
supersaiyansubtlety Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Enigma includes the following open-source libraries:
- [FlatLaf](https://github.com/JFormDesigner/FlatLaf) (Apache-2.0)
- [jopt-simple](https://github.com/jopt-simple/jopt-simple) (MIT)
- [ASM](https://asm.ow2.io/) (BSD-3-Clause)
- [JavaParser](https://javaparser.org/) (Apache-2.0)

## Usage

Expand Down
1 change: 1 addition & 0 deletions enigma-swing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies {
implementation libs.bundles.quilt.config
implementation libs.swing.dpi
implementation libs.fontchooser
implementation libs.javaparser
testImplementation(testFixtures(project(':enigma')))
}

Expand Down
7 changes: 4 additions & 3 deletions enigma-swing/src/main/java/org/quiltmc/enigma/gui/Gui.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.quiltmc.enigma.gui.element.EditorTabbedPane;
import org.quiltmc.enigma.gui.element.MainWindow;
import org.quiltmc.enigma.gui.element.menu_bar.MenuBar;
import org.quiltmc.enigma.gui.panel.BaseEditorPanel;
import org.quiltmc.enigma.gui.panel.EditorPanel;
import org.quiltmc.enigma.gui.panel.IdentifierPanel;
import org.quiltmc.enigma.gui.renderer.MessageListCellRenderer;
Expand Down Expand Up @@ -170,8 +171,8 @@ private void setupDockers() {
this.dockerManager.registerDocker(new AllClassesDocker(this));
this.dockerManager.registerDocker(new DeobfuscatedClassesDocker(this));

if (Config.dockers().buttonLocations.value().isEmpty()) {
Config.dockers().updateButtonLocations(this.dockerManager);
if (Config.docker().buttonLocations.value().isEmpty()) {
Config.docker().updateButtonLocations(this.dockerManager);
}

// set default docker sizes
Expand Down Expand Up @@ -402,7 +403,7 @@ public void setMappingsFile(Path path) {
this.updateUiState();
}

public void showTokens(EditorPanel editor, List<Token> tokens) {
public void showTokens(BaseEditorPanel editor, List<Token> tokens) {
if (tokens.size() > 1) {
this.openDocker(CallsTreeDocker.class);
this.controller.setTokenHandle(editor.getClassHandle().copy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

public class NestedPackages {
private final SortedMutableTreeNode root;
Expand Down Expand Up @@ -75,9 +76,16 @@ public SortedMutableTreeNode getRoot() {
return this.root;
}

/**
* @return the path to the passed {@code packageName} if present, or the path the {@link #root} otherwise
*/
public TreePath getPackagePath(String packageName) {
var node = this.packageToNode.getOrDefault(packageName, this.root);
return new TreePath(node.getPath());
return this.getPackagePathOrEmpty(packageName).orElseGet(() -> new TreePath(this.root.getPath()));
}

public Optional<TreePath> getPackagePathOrEmpty(String packageName) {
return Optional.ofNullable(this.packageToNode.get(packageName))
.map(node -> new TreePath(node.getPath()));
}

public ClassSelectorClassNode getClassNode(ClassEntry entry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.quiltmc.enigma.gui.config.theme.properties.SystemThemeProperties;
import org.quiltmc.enigma.gui.config.theme.properties.composite.SyntaxPaneProperties;
import org.quiltmc.enigma.util.I18n;
import org.quiltmc.syntaxpain.SyntaxpainConfiguration;

import javax.annotation.Nullable;
import javax.swing.UnsupportedLookAndFeelException;
Expand All @@ -34,9 +33,18 @@
import java.nio.file.Paths;

/**
* The Enigma config is separated into five different files: {@link Config the main config (this one)},
* {@link NetConfig the networking configuration}, {@link KeyBindConfig the keybinding configuration},
* {@link DockerConfig the docker configuration}, and {@link DecompilerConfig the decompiler configuration}.
* Enigma config is separated into several {@value #FORMAT} files with names matching the methods used to access them:
* <ul>
* <li> {@link #main()} (this one)
* <li> {@link #net()} (networking)
* <li> {@link #keybind()}
* <li> {@link #docker()}
* <li> {@link #decompiler()}
* <li> {@link #editor()}
* </ul>
*
* {@value #THEME_FAMILY} also holds a config file for each theme;
* the active theme is accessible via {@link #currentTheme()}.
*/
@SerializedNameConvention(NamingSchemes.SNAKE_CASE)
@Processor("processChange")
Expand All @@ -52,6 +60,7 @@ public final class Config extends ReflectiveConfig {
private static final NetConfig NET = ConfigFactory.create(ENVIRONMENT, FAMILY, "net", NetConfig.class);
private static final DockerConfig DOCKER = ConfigFactory.create(ENVIRONMENT, FAMILY, "docker", DockerConfig.class);
private static final DecompilerConfig DECOMPILER = ConfigFactory.create(ENVIRONMENT, FAMILY, "decompiler", DecompilerConfig.class);
private static final EditorConfig EDITOR = ConfigFactory.create(ENVIRONMENT, FAMILY, "editor", EditorConfig.class);

@Comment("The currently assigned UI language. This will be an ISO-639 two-letter language code, followed by an underscore and an ISO 3166-1 alpha-2 two-letter country code.")
@Processor("grabPossibleLanguages")
Expand All @@ -77,9 +86,6 @@ public final class Config extends ReflectiveConfig {
@Comment("You shouldn't enable options in this section unless you know what you're doing!")
public final DevSection development = new DevSection();

@Comment("Whether editors' quick find toolbars should remain visible when they lose focus.")
public final TrackedValue<Boolean> persistentEditorQuickFind = this.value(true);

/**
* The look and feel stored in the config: do not use this unless setting! Use {@link #activeThemeChoice} instead,
* since look and feel is final once loaded.
Expand Down Expand Up @@ -115,11 +121,11 @@ public static StatsSection stats() {
return main().stats;
}

public static DockerConfig dockers() {
public static DockerConfig docker() {
return DOCKER;
}

public static KeyBindConfig keyBinds() {
public static KeyBindConfig keybind() {
return KEYBIND;
}

Expand All @@ -131,6 +137,10 @@ public static DecompilerConfig decompiler() {
return DECOMPILER;
}

public static EditorConfig editor() {
return EDITOR;
}

public static Theme currentTheme() {
return activeThemeChoice.theme;
}
Expand Down Expand Up @@ -246,32 +256,6 @@ public ComplexConfigValue copy() {
}
}

/**
* Updates the backend library Syntaxpain, used for code highlighting and other editor things.
*/
public static void updateSyntaxpain() {
Theme.Fonts fonts = currentFonts();
SyntaxPaneProperties.Colors colors = getCurrentSyntaxPaneColors();

SyntaxpainConfiguration.setEditorFont(fonts.editor.value());
// disable dialog; EditorPanel uses a tool bar component instead
SyntaxpainConfiguration.setQuickFindDialogFactory(null);

SyntaxpainConfiguration.setLineRulerPrimaryColor(colors.lineNumbersForeground.value());
SyntaxpainConfiguration.setLineRulerSecondaryColor(colors.lineNumbersBackground.value());
SyntaxpainConfiguration.setLineRulerSelectionColor(colors.lineNumbersSelected.value());

SyntaxpainConfiguration.setHighlightColor(colors.highlight.value());
SyntaxpainConfiguration.setStringColor(colors.string.value());
SyntaxpainConfiguration.setNumberColor(colors.number.value());
SyntaxpainConfiguration.setOperatorColor(colors.operator.value());
SyntaxpainConfiguration.setDelimiterColor(colors.delimiter.value());
SyntaxpainConfiguration.setTypeColor(colors.type.value());
SyntaxpainConfiguration.setIdentifierColor(colors.identifier.value());
SyntaxpainConfiguration.setCommentColour(colors.comment.value());
SyntaxpainConfiguration.setTextColor(colors.text.value());
}

public enum ThemeChoice implements ConfigSerializableObject<String> {
DEFAULT(
Theme.create(ENVIRONMENT, THEME_FAMILY, "default", new DefaultThemeProperties())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.quiltmc.enigma.gui.config;

import org.quiltmc.config.api.ReflectiveConfig;
import org.quiltmc.config.api.annotations.Comment;
import org.quiltmc.config.api.annotations.SerializedNameConvention;
import org.quiltmc.config.api.metadata.NamingSchemes;
import org.quiltmc.config.api.values.TrackedValue;

@SerializedNameConvention(NamingSchemes.SNAKE_CASE)
public class EditorConfig extends ReflectiveConfig {
@Comment("Whether editors' quick find toolbars should remain visible when they lose focus.")
public final TrackedValue<Boolean> persistentQuickFind = this.value(true);

@Comment("Settings for editors' entry tooltips.")
public final EntryTooltipsSection entryTooltips = new EntryTooltipsSection();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.quiltmc.enigma.gui.config;

import org.quiltmc.config.api.ReflectiveConfig;
import org.quiltmc.config.api.annotations.Comment;
import org.quiltmc.config.api.annotations.SerializedNameConvention;
import org.quiltmc.config.api.metadata.NamingSchemes;
import org.quiltmc.config.api.values.TrackedValue;

@SerializedNameConvention(NamingSchemes.SNAKE_CASE)
public class EntryTooltipsSection extends ReflectiveConfig.Section {
@Comment("Whether tooltips are enabled.")
public final TrackedValue<Boolean> enable = this.value(true);

@Comment("Whether tooltips can be clicked and interacted with to navigate their content.")
public final TrackedValue<Boolean> interactable = this.value(true);
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static Map<String, List<KeyBind>> getEditableKeyBindsByCategory() {

public static void loadConfig() {
for (KeyBind keyBind : CONFIGURABLE_KEY_BINDS) {
keyBind.deserializeCombinations(Config.keyBinds().getKeyCodes(keyBind));
keyBind.deserializeCombinations(Config.keybind().getKeyCodes(keyBind));
}

resetEditableKeyBinds();
Expand All @@ -107,7 +107,7 @@ public static void saveConfig() {
KeyBind editedKeyBind = editableKeyBinds.get(i);
if (!editedKeyBind.equals(keyBind)) {
keyBind.setFrom(editedKeyBind);
Config.keyBinds().setBind(editedKeyBind);
Config.keybind().setBind(editedKeyBind);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.quiltmc.config.api.values.TrackedValue;
import org.quiltmc.enigma.gui.config.Config;
import org.quiltmc.enigma.gui.config.theme.properties.composite.SyntaxPaneProperties;
import org.quiltmc.enigma.gui.highlight.BoxHighlightPainter;
import org.quiltmc.enigma.gui.util.ScaleUtil;
import org.quiltmc.syntaxpain.JavaSyntaxKit;
Expand All @@ -24,9 +25,24 @@ public static void setupTheme() {
Config.configureTheme();
Config.setGlobalLaf();
ThemeUtil.setFonts();
Config.updateSyntaxpain();
UIManager.put("ScrollBar.showButtons", true);
JEditorPane.registerEditorKitForContentType("text/enigma-sources", JavaSyntaxKit.class.getName());

final SyntaxPaneProperties.Colors syntaxColors = Config.getCurrentSyntaxPaneColors();
JavaSyntaxKit.setSyntaxColors(
syntaxColors.highlight.value(),
syntaxColors.string.value(),
syntaxColors.number.value(),
syntaxColors.operator.value(),
syntaxColors.delimiter.value(),
syntaxColors.type.value(),
syntaxColors.identifier.value(),
syntaxColors.comment.value(),
syntaxColors.text.value(),
new Color(0xcc6600)
);

JEditorPane.registerEditorKitForContentType(JavaSyntaxKit.CONTENT_TYPE, JavaSyntaxKit.class.getName());

ScaleUtil.applyScaling();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public Colors.Builder buildSyntaxPaneColors(Colors.Builder colors) {
.lineNumbersBackground(new SerializableColor(0xFF252729))
.lineNumbersSelected(new SerializableColor(0xFF353739))

.selection(new SerializableColor(0xFF003658))
.pairsMarker(new SerializableColor(0xBF9F7B47))

.obfuscated(new SerializableColor(0x31FF5555))
.obfuscatedOutline(new SerializableColor(0x89FF5555))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public Colors.Builder buildSyntaxPaneColors(Colors.Builder colors) {
.lineNumbersBackground(new SerializableColor(0xFF313335))
.lineNumbersSelected(new SerializableColor(0xFF606366))

.selection(new SerializableColor(0xFF14587A))
.pairsMarker(new SerializableColor(0xBFAF8B57))

.obfuscated(new SerializableColor(0x4DFF5555))
.obfuscatedOutline(new SerializableColor(0x80FF5555))

Expand All @@ -54,8 +57,8 @@ public Colors.Builder buildSyntaxPaneColors(Colors.Builder colors) {
.deobfuscated(new SerializableColor(0x4D50FA7B))
.deobfuscatedOutline(new SerializableColor(0x8050FA7B))

.fallback(new SerializableColor(0x4Daa5500))
.fallbackOutline(new SerializableColor(0x80d86f06))
.fallback(new SerializableColor(0x4DAA5500))
.fallbackOutline(new SerializableColor(0x80D86F06))

.editorBackground(new SerializableColor(0xFF282A36))
.highlight(new SerializableColor(0xFFFF79C6))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ protected Colors.Builder buildSyntaxPaneColors(Colors.Builder colors) {
return colors;
}

@Override
public void configure() {
this.colors.configure();
}

/**
* Default values are for light themes.
*/
public static class Colors implements Consumer<Config.SectionBuilder> {
public static final class Colors implements Consumer<Config.SectionBuilder> {
public final TrackedValue<ThemeProperties.SerializableColor> lineNumbersForeground;
public final TrackedValue<ThemeProperties.SerializableColor> lineNumbersBackground;
public final TrackedValue<ThemeProperties.SerializableColor> lineNumbersSelected;

public final TrackedValue<ThemeProperties.SerializableColor> selection;
public final TrackedValue<ThemeProperties.SerializableColor> pairsMarker;

public final TrackedValue<ThemeProperties.SerializableColor> obfuscated;
public final TrackedValue<ThemeProperties.SerializableColor> obfuscatedOutline;

Expand Down Expand Up @@ -72,6 +77,10 @@ private Colors(
ThemeProperties.SerializableColor lineNumbersForeground,
ThemeProperties.SerializableColor lineNumbersBackground,
ThemeProperties.SerializableColor lineNumbersSelected,

ThemeProperties.SerializableColor selection,
ThemeProperties.SerializableColor pairsMarker,

ThemeProperties.SerializableColor obfuscated,
ThemeProperties.SerializableColor obfuscatedOutline,

Expand Down Expand Up @@ -103,6 +112,10 @@ private Colors(
this.lineNumbersForeground = TrackedValue.create(lineNumbersForeground, "line_numbers_foreground");
this.lineNumbersBackground = TrackedValue.create(lineNumbersBackground, "line_numbers_background");
this.lineNumbersSelected = TrackedValue.create(lineNumbersSelected, "line_numbers_selected");

this.selection = TrackedValue.create(selection, "selection");
this.pairsMarker = TrackedValue.create(pairsMarker, "pairs_marker");

this.obfuscated = TrackedValue.create(obfuscated, "obfuscated");
this.obfuscatedOutline = TrackedValue.create(obfuscatedOutline, "obfuscated_outline");

Expand Down Expand Up @@ -142,6 +155,9 @@ public Stream<TrackedValue<ThemeProperties.SerializableColor>> stream() {
this.lineNumbersBackground,
this.lineNumbersSelected,

this.selection,
this.pairsMarker,

this.obfuscated,
this.obfuscatedOutline,

Expand Down Expand Up @@ -180,6 +196,10 @@ public static class Builder {
private ThemeProperties.SerializableColor lineNumbersForeground = new ThemeProperties.SerializableColor(0xFF333300);
private ThemeProperties.SerializableColor lineNumbersBackground = new ThemeProperties.SerializableColor(0xFFEEEEFF);
private ThemeProperties.SerializableColor lineNumbersSelected = new ThemeProperties.SerializableColor(0xFFCCCCEE);

private ThemeProperties.SerializableColor selection = new ThemeProperties.SerializableColor(0xFF1F2E5A);
private ThemeProperties.SerializableColor pairsMarker = new ThemeProperties.SerializableColor(0xFFFFBB77);

private ThemeProperties.SerializableColor obfuscated = new ThemeProperties.SerializableColor(0xFFFFDCDC);
private ThemeProperties.SerializableColor obfuscatedOutline = new ThemeProperties.SerializableColor(0xFFA05050);

Expand Down Expand Up @@ -213,6 +233,10 @@ public Colors build() {
this.lineNumbersForeground,
this.lineNumbersBackground,
this.lineNumbersSelected,

this.selection,
this.pairsMarker,

this.obfuscated,
this.obfuscatedOutline,

Expand Down Expand Up @@ -258,6 +282,16 @@ public Builder lineNumbersSelected(ThemeProperties.SerializableColor lineNumbers
return this;
}

public Builder selection(ThemeProperties.SerializableColor selection) {
this.selection = selection;
return this;
}

public Builder pairsMarker(ThemeProperties.SerializableColor pairsMarker) {
this.pairsMarker = pairsMarker;
return this;
}

public Builder obfuscated(ThemeProperties.SerializableColor obfuscated) {
this.obfuscated = obfuscated;
return this;
Expand Down
Loading
Loading