/hg/icedtea-web: Make itweb-settings resizable
asu at icedtea.classpath.org
asu at icedtea.classpath.org
Tue Jun 14 10:28:44 PDT 2011
changeset e0741a8c44b6 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e0741a8c44b6
author: Andrew Su <asu at redhat.com>
date: Tue Jun 14 13:30:55 2011 -0400
Make itweb-settings resizable
diffstat:
ChangeLog | 11 ++
netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java | 17 +++-
netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java | 43 ++++++---
netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java | 3 +
4 files changed, 57 insertions(+), 17 deletions(-)
diffs (155 lines):
diff -r 0398f63d1b21 -r e0741a8c44b6 ChangeLog
--- a/ChangeLog Fri Jun 10 13:15:00 2011 -0400
+++ b/ChangeLog Tue Jun 14 13:30:55 2011 -0400
@@ -1,3 +1,14 @@
+2011-06-14 Andrew Su <asu at redhat.com>
+
+ * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java:
+ (ControlPanel): Removed line that prevents resizing.
+ (createMainSettingsPanel): Detect the minimum size of panels instead
+ of fixed size.
+ * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java:
+ (addComponents): Changed to update size when tool is being resized.
+ * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java
+ addComponents): Changed to a layout that will resize itself.
+
2011-06-10 Denis Lila <dlila at redhat.com>
* netx/net/sourceforge/jnlp/GuiLaunchHandler.java:
diff -r 0398f63d1b21 -r e0741a8c44b6 netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java
--- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Fri Jun 10 13:15:00 2011 -0400
+++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Tue Jun 14 13:30:55 2011 -0400
@@ -115,7 +115,6 @@
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
pack();
setMinimumSize(getPreferredSize());
- setResizable(false);
}
private JPanel createTopPanel() {
@@ -232,9 +231,23 @@
// Add panels.
final JPanel settingsPanel = new JPanel(new CardLayout());
+
+ // Calculate largest minimum size we should use.
+ int height = 0;
+ int width = 0;
for (SettingsPanel panel : panels) {
JPanel p = panel.getPanel();
- p.setPreferredSize(new Dimension(530, 360));
+ Dimension d = p.getMinimumSize();
+ if (d.height > height)
+ height = d.height;
+ if (d.width > width)
+ width = d.width;
+ }
+ Dimension dim = new Dimension(width, height);
+
+ for (SettingsPanel panel : panels) {
+ JPanel p = panel.getPanel();
+ p.setPreferredSize(dim);
settingsPanel.add(p, panel.toString());
}
diff -r 0398f63d1b21 -r e0741a8c44b6 netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java
--- a/netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java Fri Jun 10 13:15:00 2011 -0400
+++ b/netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java Tue Jun 14 13:30:55 2011 -0400
@@ -25,6 +25,7 @@
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
+import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@@ -108,8 +109,8 @@
this.description.add(description[i], String.valueOf(i - 1));
// Settings for selecting Proxy Server
- JPanel proxyServerPanel = new JPanel(new BorderLayout());
- JPanel proxyLocationPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
+ JPanel proxyServerPanel = new JPanel(new GridLayout(0, 1));
+ JPanel proxyLocationPanel = new JPanel(new GridBagLayout());
JPanel proxyBypassPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
JLabel addressLabel = new JLabel(Translator.R("NSAddress") + ":");
@@ -140,17 +141,24 @@
config.setProperty(properties[3], String.valueOf(e.getStateChange() == ItemEvent.SELECTED));
}
});
- proxyLocationPanel.add(Box.createRigidArea(new Dimension(13, 0)));
- proxyLocationPanel.add(addressLabel);
- proxyLocationPanel.add(addressField);
- proxyLocationPanel.add(portLabel);
- proxyLocationPanel.add(portField);
- proxyLocationPanel.add(advancedProxyButton);
- proxyBypassPanel.add(Box.createRigidArea(new Dimension(10, 0)));
+ c.gridy = 0;
+ c.gridx = GridBagConstraints.RELATIVE;
+ c.weightx = 0;
+ proxyLocationPanel.add(Box.createHorizontalStrut(20), c);
+ proxyLocationPanel.add(addressLabel, c);
+ c.weightx = 1;
+ proxyLocationPanel.add(addressField, c);
+ c.weightx = 0;
+ proxyLocationPanel.add(portLabel, c);
+ c.weightx = 1;
+ proxyLocationPanel.add(portField, c);
+ c.weightx = 0;
+ proxyLocationPanel.add(advancedProxyButton, c);
+ proxyBypassPanel.add(Box.createHorizontalStrut(5));
proxyBypassPanel.add(bypassCheckBox);
- proxyServerPanel.add(proxyLocationPanel, BorderLayout.CENTER);
- proxyServerPanel.add(proxyBypassPanel, BorderLayout.SOUTH);
+ proxyServerPanel.add(proxyLocationPanel);
+ proxyServerPanel.add(proxyBypassPanel);
JRadioButton directConnection = new JRadioButton(Translator.R("NSDirectConnection"), config.getProperty(properties[0]).equals("0"));
directConnection.setActionCommand("0");
@@ -175,15 +183,20 @@
modeSelect.add(directConnection);
// Settings for Automatic Proxy Configuration Script
- JPanel proxyAutoPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
+ JPanel proxyAutoPanel = new JPanel(new GridBagLayout());
JLabel locationLabel = new JLabel(Translator.R("NSScriptLocation") + ":");
final JTextField locationField = new JTextField(config.getProperty(properties[4]), 20);
locationField.getDocument().addDocumentListener(new DocumentAdapter(config, properties[4]));
- proxyAutoPanel.add(Box.createRigidArea(new Dimension(13, 0)));
- proxyAutoPanel.add(locationLabel);
- proxyAutoPanel.add(locationField);
+ c.gridx = 0;
+ proxyAutoPanel.add(Box.createHorizontalStrut(20), c);
+ c.gridx = GridBagConstraints.RELATIVE;
+ proxyAutoPanel.add(locationLabel, c);
+ c.weightx = 1;
+ proxyAutoPanel.add(locationField, c);
+ c.weighty = 0;
+ c.gridx = 0;
c.gridy = 0;
settingPanel.add(networkDesc, c);
c.gridy = 1;
diff -r 0398f63d1b21 -r e0741a8c44b6 netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java
--- a/netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java Fri Jun 10 13:15:00 2011 -0400
+++ b/netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java Tue Jun 14 13:30:55 2011 -0400
@@ -42,6 +42,7 @@
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
+import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
@@ -241,6 +242,8 @@
closePanel.add(closeButton, BorderLayout.EAST);
main.add(closePanel, BorderLayout.SOUTH);
}
+
+ setLayout(new GridLayout(0,1));
add(main);
}
More information about the distro-pkg-dev
mailing list