From ba7a354efae7d49833c887cf147ac940c975a1fa Mon Sep 17 00:00:00 2001 From: Gegy Date: Wed, 30 Jan 2019 21:05:32 +0200 Subject: 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 --- src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java | 4 +++- src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java (limited to 'src/main/java/cuchaz/enigma/gui/highlight') diff --git a/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java b/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java index 10366ce..cef6494 100644 --- a/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java +++ b/src/main/java/cuchaz/enigma/gui/highlight/BoxHighlightPainter.java @@ -34,7 +34,9 @@ public class BoxHighlightPainter implements Highlighter.HighlightPainter { public static Rectangle getBounds(JTextComponent text, int start, int end) { try { // determine the bounds of the text - Rectangle bounds = text.modelToView(start).union(text.modelToView(end)); + Rectangle startRect = text.modelToView(start); + Rectangle endRect = text.modelToView(end); + Rectangle bounds = startRect.union(endRect); // adjust the box so it looks nice bounds.x -= 2; diff --git a/src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java b/src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java new file mode 100644 index 0000000..ae23f32 --- /dev/null +++ b/src/main/java/cuchaz/enigma/gui/highlight/TokenHighlightType.java @@ -0,0 +1,7 @@ +package cuchaz.enigma.gui.highlight; + +public enum TokenHighlightType { + OBFUSCATED, + DEOBFUSCATED, + PROPOSED +} -- cgit v1.2.3