From 8b76b34cf44a308571777b09355a2be29722ddc6 Mon Sep 17 00:00:00 2001 From: Felix Buschbeck Date: Wed, 30 Oct 2024 17:08:33 +0100 Subject: [PATCH] Fix space distribution in Formatting tab --- .../java/de/usd/cstchef/view/RecipePanel.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/usd/cstchef/view/RecipePanel.java b/src/main/java/de/usd/cstchef/view/RecipePanel.java index dcad437..4721d57 100644 --- a/src/main/java/de/usd/cstchef/view/RecipePanel.java +++ b/src/main/java/de/usd/cstchef/view/RecipePanel.java @@ -3,6 +3,7 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.Dimension; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -127,6 +128,13 @@ public RecipePanel(BurpOperation operation, MessageType messageType) { inputText = new BurpEditorWrapper(controllerOrig, messageType, this); inputPanel.add(inputText.uiComponent()); + /* + * This is necessary to have the distribution of space in all of the three RecipePanels uniform. + * Request and Response Editor have different default sizes than the Raw Editor. + */ + inputPanel.setPreferredSize(new Dimension(248, 0)); + inputPanel.setMinimumSize(new Dimension(248, 0)); + // create output panel JPanel outputPanel = new LayoutPanel("Output"); outputText = new BurpEditorWrapper(controllerMod, messageType, this); @@ -176,6 +184,10 @@ public void actionPerformed(ActionEvent arg0) { JPanel operationsPanel = new LayoutPanel("Operations"); operationsPanel.add(searchTreePanel); operationsPanel.setBackground(Color.WHITE); + + operationsPanel.setPreferredSize(new Dimension(100, 0)); + operationsPanel.setMinimumSize(new Dimension(100, 0)); + inOut.setTopComponent(inputPanel); inOut.setBottomComponent(outputPanel); inOut.setResizeWeight(0.5); @@ -193,6 +205,10 @@ public void actionPerformed(ActionEvent arg0) { JButton filters = new JButton("Filter"); if(this.operation != BurpOperation.FORMAT) activeOperationsPanel.addActionComponent(filters); + + activeOperationsPanel.setPreferredSize(new Dimension(393, 0)); + activeOperationsPanel.setMinimumSize(new Dimension(393, 0)); + filters.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -360,7 +376,7 @@ public void actionPerformed(ActionEvent e) { JSplitPane opsInOut = new JSplitPane(); - opsInOut.setResizeWeight(0.5); + opsInOut.setResizeWeight(0.7); opsInOut.setLeftComponent(activeOperationsPanel); opsInOut.setRightComponent(inOut);