use of java.awt.GridBagLayout in project zaproxy by zaproxy.
the class EncodeDecodeDialog method getJTabbed.
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJTabbed() {
if (jPanel == null) {
/*
jPanel = new JPanel();
jPanel.setPreferredSize(new java.awt.Dimension(800,600));
jPanel.setLayout(new GridBagLayout());
*/
// jPanel is the outside one
jPanel = new JPanel();
jPanel.setPreferredSize(new java.awt.Dimension(800, 600));
jPanel.setLayout(new GridBagLayout());
jTabbed = new JTabbedPane();
jTabbed.setPreferredSize(new java.awt.Dimension(800, 500));
final JPanel jPanel1 = new JPanel();
jPanel1.setLayout(new GridBagLayout());
final JPanel jPanel2 = new JPanel();
//jPanel2.setPreferredSize(new java.awt.Dimension(800,500));
jPanel2.setLayout(new GridBagLayout());
final JPanel jPanel3 = new JPanel();
//jPanel3.setPreferredSize(new java.awt.Dimension(800,500));
jPanel3.setLayout(new GridBagLayout());
final JPanel jPanel4 = new JPanel();
jPanel4.setLayout(new GridBagLayout());
// 3 tabs - Encode, Decode, Hash??
addField(jPanel1, 1, getBase64EncodeField(), Constant.messages.getString("enc2.label.b64Enc"));
addField(jPanel1, 2, getUrlEncodeField(), Constant.messages.getString("enc2.label.urlEnc"));
addField(jPanel1, 3, getAsciiHexEncodeField(), Constant.messages.getString("enc2.label.asciiEnc"));
addField(jPanel1, 4, getHTMLEncodeField(), Constant.messages.getString("enc2.label.HTMLEnc"));
addField(jPanel1, 5, getJavaScriptEncodeField(), Constant.messages.getString("enc2.label.JavaScriptEnc"));
addField(jPanel2, 1, getBase64DecodeField(), Constant.messages.getString("enc2.label.b64Dec"));
addField(jPanel2, 2, getUrlDecodeField(), Constant.messages.getString("enc2.label.urlDec"));
addField(jPanel2, 3, getAsciiHexDecodeField(), Constant.messages.getString("enc2.label.asciiDec"));
addField(jPanel2, 4, getHTMLDecodeField(), Constant.messages.getString("enc2.label.HTMLDec"));
addField(jPanel2, 5, getJavaScriptDecodeField(), Constant.messages.getString("enc2.label.JavaScriptDec"));
addField(jPanel3, 1, getSha1HashField(), Constant.messages.getString("enc2.label.sha1Hash"));
addField(jPanel3, 2, getMd5HashField(), Constant.messages.getString("enc2.label.md5Hash"));
addField(jPanel4, 1, getIllegalUTF82ByteField(), Constant.messages.getString("enc2.label.illegalUTF8.2byte"));
addField(jPanel4, 2, getIllegalUTF83ByteField(), Constant.messages.getString("enc2.label.illegalUTF8.3byte"));
addField(jPanel4, 3, getIllegalUTF84ByteField(), Constant.messages.getString("enc2.label.illegalUTF8.4byte"));
jTabbed.addTab(Constant.messages.getString("enc2.tab.encode"), jPanel1);
jTabbed.addTab(Constant.messages.getString("enc2.tab.decode"), jPanel2);
jTabbed.addTab(Constant.messages.getString("enc2.tab.hash"), jPanel3);
jTabbed.addTab(Constant.messages.getString("enc2.tab.illegalUTF8"), jPanel4);
final java.awt.GridBagConstraints gbc1 = new GridBagConstraints();
gbc1.gridx = 0;
gbc1.gridy = 1;
gbc1.insets = new java.awt.Insets(1, 1, 1, 1);
gbc1.anchor = java.awt.GridBagConstraints.NORTHWEST;
gbc1.fill = java.awt.GridBagConstraints.BOTH;
gbc1.weightx = 1.0D;
gbc1.weighty = 0.25D;
final java.awt.GridBagConstraints gbc2 = new GridBagConstraints();
gbc2.gridx = 0;
gbc2.gridy = 2;
gbc2.insets = new java.awt.Insets(1, 1, 1, 1);
gbc2.anchor = java.awt.GridBagConstraints.NORTHWEST;
gbc2.fill = java.awt.GridBagConstraints.BOTH;
gbc2.weightx = 1.0D;
gbc2.weighty = 1.0D;
final JScrollPane jsp = new JScrollPane();
jsp.setViewportView(getInputField());
jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jsp.setBorder(BorderFactory.createTitledBorder(null, Constant.messages.getString("enc2.label.text"), TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));
//addField(jPanel, 1, getInputField(), "Text to be encoded/decoded/hashed");
//addField(jPanel, 2, jTabbed, "Text to be encoded/decoded/hashed");
jPanel.add(jsp, gbc1);
jPanel.add(jTabbed, gbc2);
jPanel2.requestFocus();
}
return jPanel;
}
use of java.awt.GridBagLayout in project zaproxy by zaproxy.
the class EncodeDecodeParamPanel method getBase64Panel.
private JPanel getBase64Panel() {
if (base64Panel == null) {
base64Panel = new JPanel();
base64Panel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
base64Panel.setBorder(BorderFactory.createTitledBorder(null, NAME_BASE64, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));
gbc.gridx = 0;
gbc.gridy = 0;
gbc.insets = new java.awt.Insets(2, 2, 2, 2);
gbc.anchor = GridBagConstraints.WEST;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 0.5D;
base64Panel.add(new JLabel(CHARSET_LABEL), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.ipadx = 50;
base64Panel.add(getComboBoxBase64Charset(), gbc);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.ipadx = 0;
base64Panel.add(new JLabel(BREAK_LINES_LABEL), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
gbc.ipadx = 50;
base64Panel.add(getCheckBoxBoxBase64DoBreakLines(), gbc);
}
return base64Panel;
}
use of java.awt.GridBagLayout in project zaproxy by zaproxy.
the class ManageAddOnsDialog method getCorePanel.
private JPanel getCorePanel(boolean update) {
if (corePanel == null) {
corePanel = new JPanel();
corePanel.setLayout(new GridBagLayout());
corePanel.setBorder(BorderFactory.createTitledBorder(null, Constant.messages.getString("cfu.label.zap.border"), TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));
if (latestInfo == null || this.latestInfo.getZapRelease() == null) {
// Havnt checked for updatees yet
corePanel.add(new JLabel(this.currentVersion), LayoutHelper.getGBC(0, 0, 1, 0.0D));
corePanel.add(new JLabel(""), LayoutHelper.getGBC(1, 0, 1, 1.0D));
corePanel.add(this.getCheckForUpdatesButton(), LayoutHelper.getGBC(2, 0, 1, 0.0D));
} else if (this.latestInfo.getZapRelease().isNewerThan(this.currentVersion)) {
corePanel.add(new JLabel(Constant.messages.getString("cfu.check.zap.newer")), LayoutHelper.getGBC(0, 0, 1, 0.0D));
corePanel.add(new JLabel(this.latestInfo.getZapRelease().getVersion()), LayoutHelper.getGBC(1, 0, 1, 0.1D));
corePanel.add(new JLabel(""), LayoutHelper.getGBC(2, 0, 1, 0.8D));
corePanel.add(this.getDownloadProgress(), LayoutHelper.getGBC(3, 0, 1, 0.2D));
corePanel.add(this.getCoreNotesButton(), LayoutHelper.getGBC(4, 0, 1, 0.0D));
corePanel.add(this.getDownloadZapButton(), LayoutHelper.getGBC(5, 0, 1, 0.0D));
} else {
corePanel.add(new JLabel(this.currentVersion + " : " + Constant.messages.getString("cfu.check.zap.latest")), LayoutHelper.getGBC(0, 0, 1, 1.0D));
}
} else if (update && latestInfo != null && this.latestInfo.getZapRelease() != null) {
corePanel.removeAll();
if (this.latestInfo.getZapRelease().isNewerThan(this.currentVersion)) {
corePanel.add(new JLabel(Constant.messages.getString("cfu.check.zap.newer")), LayoutHelper.getGBC(0, 0, 1, 0.0D));
corePanel.add(new JLabel(this.latestInfo.getZapRelease().getVersion()), LayoutHelper.getGBC(1, 0, 1, 0.1D));
corePanel.add(new JLabel(""), LayoutHelper.getGBC(2, 0, 1, 0.8D));
corePanel.add(this.getDownloadProgress(), LayoutHelper.getGBC(3, 0, 1, 0.2D));
corePanel.add(this.getCoreNotesButton(), LayoutHelper.getGBC(4, 0, 1, 0.0D));
corePanel.add(this.getDownloadZapButton(), LayoutHelper.getGBC(5, 0, 1, 0.0D));
} else {
corePanel.add(new JLabel(this.currentVersion + " : " + Constant.messages.getString("cfu.check.zap.latest")), LayoutHelper.getGBC(0, 0, 1, 1.0D));
}
installedPanel.validate();
}
return corePanel;
}
use of java.awt.GridBagLayout in project zaproxy by zaproxy.
the class ManageAddOnsDialog method getInstalledAddOnsPanel.
private JPanel getInstalledAddOnsPanel() {
if (installedAddOnsPanel == null) {
installedAddOnsPanel = new JPanel();
installedAddOnsPanel.setLayout(new GridBagLayout());
installedAddOnsPanel.setBorder(BorderFactory.createTitledBorder(null, Constant.messages.getString("cfu.label.addons.border"), TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));
getInstalledAddOnsTable();
JScrollPane scrollPane = new JScrollPane();
scrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setViewportView(getInstalledAddOnsTable());
installedAddOnsFilterPanel = createFilterPanel(getInstalledAddOnsTable());
int row = 0;
installedAddOnsPanel.add(installedAddOnsFilterPanel, LayoutHelper.getGBC(0, row++, 5, 0.0D));
installedAddOnsPanel.add(scrollPane, LayoutHelper.getGBC(0, row++, 5, 1.0D, 1.0D));
installedAddOnsPanel.add(new JLabel(""), LayoutHelper.getGBC(0, row, 1, 1.0D));
installedAddOnsPanel.add(getUninstallButton(), LayoutHelper.getGBC(1, row, 1, 0.0D));
installedAddOnsPanel.add(getUpdateButton(), LayoutHelper.getGBC(2, row, 1, 0.0D));
installedAddOnsPanel.add(getUpdateAllButton(), LayoutHelper.getGBC(3, row, 1, 0.0D));
installedAddOnsPanel.add(getClose1Button(), LayoutHelper.getGBC(4, row, 1, 0.0D));
}
return installedAddOnsPanel;
}
use of java.awt.GridBagLayout in project zaproxy by zaproxy.
the class OptionsCallbackPanel method getCallbackPanel.
private JPanel getCallbackPanel() {
if (panel == null) {
JLabel jLabel6 = new JLabel();
GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
java.awt.GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
java.awt.GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
java.awt.GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
panel = new JPanel();
panel.setLayout(new GridBagLayout());
gridBagConstraints5.gridx = 1;
gridBagConstraints5.gridy = 0;
gridBagConstraints5.weightx = 0.5D;
gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints5.ipadx = 50;
gridBagConstraints5.ipady = 0;
gridBagConstraints5.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints5.insets = new java.awt.Insets(2, 2, 2, 2);
gridBagConstraints6.gridx = 0;
gridBagConstraints6.gridy = 1;
gridBagConstraints6.ipadx = 0;
gridBagConstraints6.ipady = 0;
gridBagConstraints6.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints6.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints6.insets = new java.awt.Insets(2, 2, 2, 2);
gridBagConstraints6.weightx = 0.5D;
gridBagConstraints7.gridx = 1;
gridBagConstraints7.gridy = 1;
gridBagConstraints7.weightx = 0.5D;
gridBagConstraints7.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints7.ipadx = 50;
gridBagConstraints7.ipady = 0;
gridBagConstraints7.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints7.insets = new java.awt.Insets(2, 2, 2, 2);
jLabel6.setText(Constant.messages.getString("options.proxy.local.label.browser"));
gridBagConstraints15.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints15.gridx = 0;
gridBagConstraints15.gridy = 4;
gridBagConstraints15.insets = new java.awt.Insets(2, 2, 2, 2);
gridBagConstraints15.weightx = 1.0D;
gridBagConstraints15.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints15.gridwidth = 2;
JLabel localAddrLabel = new JLabel(Constant.messages.getString("callback.options.label.localaddress"));
localAddrLabel.setLabelFor(getLocalAddress());
panel.add(localAddrLabel, LayoutHelper.getGBC(0, 0, 1, 0.5D, new Insets(2, 2, 2, 2)));
panel.add(getLocalAddress(), LayoutHelper.getGBC(1, 0, 1, 0.5D, new Insets(2, 2, 2, 2)));
JLabel remoteAddrLabel = new JLabel(Constant.messages.getString("callback.options.label.remoteaddress"));
remoteAddrLabel.setLabelFor(getRemoteAddress());
panel.add(remoteAddrLabel, LayoutHelper.getGBC(0, 1, 1, 0.5D, new Insets(2, 2, 2, 2)));
panel.add(getRemoteAddress(), LayoutHelper.getGBC(1, 1, 1, 0.5D, new Insets(2, 2, 2, 2)));
JLabel rndPortLabel = new JLabel(Constant.messages.getString("callback.options.label.rndport"));
rndPortLabel.setLabelFor(getSpinnerPort());
panel.add(rndPortLabel, LayoutHelper.getGBC(0, 2, 1, 0.5D, new Insets(2, 2, 2, 2)));
panel.add(this.getRandomPort(), LayoutHelper.getGBC(1, 2, 1, 0.5D, new Insets(2, 2, 2, 2)));
JLabel portLabel = new JLabel(Constant.messages.getString("callback.options.label.port"));
portLabel.setLabelFor(getSpinnerPort());
panel.add(portLabel, LayoutHelper.getGBC(0, 3, 1, 0.5D, new Insets(2, 2, 2, 2)));
panel.add(getSpinnerPort(), LayoutHelper.getGBC(1, 3, 1, 0.5D, new Insets(2, 2, 2, 2)));
JLabel testUrlLabel = new JLabel(Constant.messages.getString("callback.options.label.remoteaddress"));
testUrlLabel.setLabelFor(getTestURL());
panel.add(testUrlLabel, LayoutHelper.getGBC(0, 4, 1, 0.5D, new Insets(2, 2, 2, 2)));
panel.add(getTestURL(), LayoutHelper.getGBC(1, 4, 1, 0.5D, new Insets(2, 2, 2, 2)));
panel.add(new JLabel(), LayoutHelper.getGBC(0, 20, 2, 0.5D, 1.0D));
}
return panel;
}
Aggregations