Skip to content

Commit

Permalink
UI improvements
Browse files Browse the repository at this point in the history
Added frame borders due to contrast lacking with new burp look and feel
Added label to jwt secret check field
  • Loading branch information
ozzi- committed Feb 17, 2021
1 parent 99e4505 commit fa3c08d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/gui/JWTInterceptTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ private void drawGui() {

JTextComponent.removeKeymap("RTextAreaKeymap");
jwtArea = new RSyntaxTextArea(20,60);
jwtArea.setMarginLinePosition(70);
jwtArea.setEOLMarkersVisible(true);
jwtArea.setWhitespaceVisible(true);
UIManager.put("RSyntaxTextAreaUI.actionMap", null);
UIManager.put("RSyntaxTextAreaUI.inputMap", null);
UIManager.put("RTextAreaUI.actionMap", null);
UIManager.put("RTextAreaUI.inputMap", null);
jwtArea.setMarginLinePosition(70);
jwtArea.setWhitespaceVisible(true);

jwtArea.setMinimumSize(new Dimension(300, 300));
SyntaxScheme scheme = jwtArea.getSyntaxScheme();
Expand Down Expand Up @@ -198,6 +197,7 @@ private void drawGui() {
jwtKeyArea = new JTextArea("");
jwtKeyArea.setRows(2);
jwtKeyArea.setLineWrap(false);
jwtArea.setWhitespaceVisible(true);
jwtKeyArea.setEnabled(false);

GridBagConstraints gbc_keyField = new GridBagConstraints();
Expand Down
3 changes: 3 additions & 0 deletions src/gui/JWTSuiteTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public void actionPerformed(ActionEvent arg0) {
add(configButton, gbc_configButton);

jwtInputField = new JTextArea();
jwtInputField.setBorder(UIManager.getLookAndFeel().getDefaults().getBorder("TextField.border"));
jwtInputField.setRows(2);
jwtInputField.setLineWrap(true);
jwtInputField.setWrapStyleWord(true);
Expand All @@ -175,6 +176,7 @@ public void actionPerformed(ActionEvent arg0) {
add(lblEnterSecret, gbc_lblEnterSecret);

jwtKeyArea = new JTextArea();
jwtKeyArea.setBorder(UIManager.getLookAndFeel().getDefaults().getBorder("TextField.border"));
GridBagConstraints gbc_jwtKeyField = new GridBagConstraints();
gbc_jwtKeyField.insets = new Insets(0, 0, 5, 5);
gbc_jwtKeyField.fill = GridBagConstraints.HORIZONTAL;
Expand Down Expand Up @@ -205,6 +207,7 @@ public void actionPerformed(ActionEvent arg0) {
UIManager.put("RSyntaxTextAreaUI.inputMap", null);
UIManager.put("RTextAreaUI.actionMap", null);
UIManager.put("RTextAreaUI.inputMap", null);
jwtOuputField.setWhitespaceVisible(true);

SyntaxScheme scheme = jwtOuputField.getSyntaxScheme();
Style style = new Style();
Expand Down
33 changes: 23 additions & 10 deletions src/gui/JWTViewTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
Expand All @@ -18,8 +20,6 @@
import javax.swing.event.DocumentListener;
import javax.swing.text.JTextComponent;

import model.JWTTabModel;

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rsyntaxtextarea.Style;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
Expand All @@ -28,6 +28,7 @@
import org.fife.ui.rtextarea.RTextScrollPane;

import app.algorithm.AlgorithmType;
import model.JWTTabModel;

public class JWTViewTab extends JPanel{

Expand Down Expand Up @@ -69,13 +70,8 @@ private void drawPanel() {
gbc_inputLabel1.gridy = 1;
add(keyLabel, gbc_inputLabel1);

JTextComponent.removeKeymap("RTextAreaKeymap");
jwtKeyArea = new JTextArea();
UIManager.put("RSyntaxTextAreaUI.actionMap", null);
UIManager.put("RSyntaxTextAreaUI.inputMap", null);
UIManager.put("RTextAreaUI.actionMap", null);
UIManager.put("RTextAreaUI.inputMap", null);

jwtKeyArea.setBorder(UIManager.getLookAndFeel().getDefaults().getBorder("TextField.border"));
GridBagConstraints gbc_inputField1 = new GridBagConstraints();
gbc_inputField1.insets = new Insets(0, 0, 5, 5);
gbc_inputField1.fill = GridBagConstraints.HORIZONTAL;
Expand All @@ -85,15 +81,27 @@ private void drawPanel() {
jwtKeyArea.setColumns(10);

verificationIndicator = new JButton("");
verificationIndicator.setText("No secret provided");
verificationIndicator.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
Dimension preferredSize = new Dimension(400, 30);
verificationIndicator.setPreferredSize(preferredSize);
GridBagConstraints gbc_validIndicator = new GridBagConstraints();
gbc_validIndicator.insets = new Insets(0, 0, 5, 5);
gbc_validIndicator.gridx = 1;
gbc_validIndicator.gridy = 4;
add(verificationIndicator, gbc_validIndicator);


JTextComponent.removeKeymap("RTextAreaKeymap");
outputField = new RSyntaxTextArea();
UIManager.put("RSyntaxTextAreaUI.actionMap", null);
UIManager.put("RSyntaxTextAreaUI.inputMap", null);
UIManager.put("RTextAreaUI.actionMap", null);
UIManager.put("RTextAreaUI.inputMap", null);

outputField.setWhitespaceVisible(true);
SyntaxScheme scheme = outputField.getSyntaxScheme();
Style style = new Style();
style.foreground = new Color(222,133,10);
Expand Down Expand Up @@ -190,7 +198,12 @@ public void run() {
verificationIndicator.setBackground(jwtTM.getVerificationColor());
}
if(!jwtTM.getVerificationLabel().equals(verificationIndicator.getText())){
verificationIndicator.setText(jwtTM.getVerificationLabel());
if(jwtTM.getVerificationLabel().equals("")) {
verificationIndicator.setText("No secret provided");
}else {
verificationIndicator.setText(jwtTM.getVerificationLabel());
}

}
if(algorithmType.equals(AlgorithmType.symmetric)){
keyLabel.setText("Secret");
Expand Down

0 comments on commit fa3c08d

Please sign in to comment.