Skip to content

Commit

Permalink
ui updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GraxCode committed Apr 23, 2020
1 parent 4a4c2d7 commit 69cb5b3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/me/nov/threadtear/execution/ExecutionCategory.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.nov.threadtear.execution;

public enum ExecutionCategory {
GENERIC("Generic"), CLEANING("Cleaning"), ANALYSIS("Analysis"), STRINGER("Stringer Obfuscator"), ZKM("ZKM Obfuscator"), ALLATORI("Allatori Obfuscator"), TOOLS("Tools"),
SB27("Superblaubeere27 Obfuscator");
GENERIC("Generic"), CLEANING("Cleaning"), ANALYSIS("Analysis"), STRINGER("Stringer Obfuscator"), ZKM("ZKM Obfuscator"), ALLATORI("Allatori Obfuscator"), SB27("Superblaubeere27 Obfuscator"),
TOOLS("Tools");

public final String name;

Expand Down
14 changes: 14 additions & 0 deletions src/me/nov/threadtear/swing/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.Objects;

import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeModel;
Expand Down Expand Up @@ -51,4 +55,14 @@ public static String getVersion() {
return "(dev)";
}
}

public static Image iconToImage(Icon icon) {
if (icon instanceof ImageIcon) {
return ((ImageIcon) icon).getImage();
} else {
BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
icon.paintIcon(null, image.getGraphics(), 0, 0);
return image;
}
}
}
4 changes: 4 additions & 0 deletions src/me/nov/threadtear/swing/frame/DecompilerFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

import org.objectweb.asm.tree.ClassNode;

import com.github.weisj.darklaf.icons.IconLoader;

import me.nov.threadtear.swing.Utils;
import me.nov.threadtear.swing.panel.DecompilerPanel;

public class DecompilerFrame extends JFrame {
Expand All @@ -21,6 +24,7 @@ public DecompilerFrame(ClassNode cn) {
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setBounds(100, 100, 1000, 600);
setLayout(new BorderLayout());
setIconImage(Utils.iconToImage(IconLoader.get().loadSVGIcon("res/decompile.svg", 64, 64, false)));
setAlwaysOnTop(true);
JPanel cp = new JPanel(new BorderLayout());
cp.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
Expand Down
2 changes: 1 addition & 1 deletion src/me/nov/threadtear/swing/panel/DecompilerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public DecompilerPanel(ClassNode cn) {
JPanel topPanel = new JPanel();
topPanel.setBorder(new EmptyBorder(1, 5, 0, 1));
topPanel.setLayout(new BorderLayout());
topPanel.add(new JLabel("CFR Decompiler 0.149"), BorderLayout.WEST);
topPanel.add(new JLabel("<html>CFR Decompiler 0.149 (<i>www.benf.org/other/cfr</i>)"), BorderLayout.WEST);
topPanel.add(actionPanel, BorderLayout.EAST);
this.add(topPanel, BorderLayout.NORTH);
this.textArea = new DecompilerTextArea();
Expand Down

0 comments on commit 69cb5b3

Please sign in to comment.