perfsonar-dev - perfsonar: r2770 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels
Subject: perfsonar development work
List archive
perfsonar: r2770 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2770 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels
- Date: Wed, 5 Sep 2007 04:56:43 -0400
Author: nina
Date: 2007-09-05 04:56:42 -0400 (Wed, 05 Sep 2007)
New Revision: 2770
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/RequestOptionsPanel.java
Log:
UI for setting requests' timeout (same as command line option -t,--timeout
<milliseconds>). Available via Options menu, Request tab.
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/RequestOptionsPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/RequestOptionsPanel.java
2007-09-04 14:51:41 UTC (rev 2769)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels/RequestOptionsPanel.java
2007-09-05 08:56:42 UTC (rev 2770)
@@ -26,11 +26,14 @@
import java.awt.Dimension;
import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.text.NumberFormat;
import javax.swing.AbstractAction;
import javax.swing.Action;
-import javax.swing.BoxLayout;
import javax.swing.JCheckBox;
+import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.SpinnerModel;
@@ -38,6 +41,8 @@
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import org.jdesktop.layout.GroupLayout;
+import org.jdesktop.layout.GroupLayout.SequentialGroup;
import org.perfsonar.perfsonarui.plugins.IPerfsonarTab;
import org.perfsonar.perfsonarui.ui.panels.PSPanel;
@@ -46,6 +51,7 @@
*
*/
private static final long serialVersionUID = -2311115396826505814L;
+ protected JFormattedTextField field_timeout;
protected JSpinner field_maxItems;
protected JCheckBox field_parallel;
protected IPerfsonarTab psModel;
@@ -56,12 +62,88 @@
}
+ private void placeWidgets() {
+
+ JLabel[] label = new JLabel[3];
+ for (int i=0; i < label.length;i++)
+ label[i] = new JLabel("xxx");
+
+ /*
+
topNumberField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+ topNumberField.setText("10");
+
+
+
topGroupTransCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,
0, 0, 0));
+ topGroupTransCheckBox.setMargin(new java.awt.Insets(0, 0, 0,
0));
+
+ topGroupTransLabel.setText("group transport protocols");
+
+ topFilterLabel.setText("filter rule");
+
+ topAggregationLabel.setText("aggregation rule");
+ */
+
+ JLabel tLabel = new JLabel("Request timeout, ms");
+ JLabel rLabel = new JLabel("Max number of interfaces per
request");
+ //setPreferredSize(new Dimension(400,400));
+ org.jdesktop.layout.GroupLayout glayout = new
org.jdesktop.layout.GroupLayout(
+ this);
+ setLayout(glayout);
+ glayout.setAutocreateGaps(true);
+ glayout.setAutocreateContainerGaps(true);
+
+
+ SequentialGroup sg = glayout.createSequentialGroup();
+ sg.add(glayout.createParallelGroup(GroupLayout.LEADING)
+ .add(tLabel)
+ .add(rLabel)
+ .add(field_parallel)
+ );
+ sg.add(glayout.createParallelGroup(GroupLayout.LEADING)
+ .add(field_timeout)
+ .add(field_maxItems)
+ );
+
+ glayout.setHorizontalGroup(sg);
+
+ SequentialGroup sg1 = glayout.createSequentialGroup();
+ sg1.add(glayout.createParallelGroup(GroupLayout.BASELINE)
+ .add(tLabel)
+ .add(field_timeout));
+ sg1.add(glayout.createParallelGroup(GroupLayout.LEADING)
+ .add(rLabel)
+ .add(field_maxItems));
+ sg1.add(glayout.createParallelGroup(GroupLayout.LEADING)
+ .add(field_parallel)
+ );
+ glayout.setVerticalGroup(sg1);
+
+
+ }
@Override
public void addWidgets(IPerfsonarTab psModel) {
setPsModel(psModel);
- setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
+// setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
+
+ field_timeout = new
JFormattedTextField(NumberFormat.getInstance());
+ field_timeout.setValue(new
Integer(getPsModel().getRequest().getTimeout()));
+ field_timeout.addPropertyChangeListener("value", new
PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ getPsModel().getRequest().setTimeout(
+
((Number)field_timeout.getValue()).intValue()
+ );
+
+
+ }
+ });
+ Dimension d = new Dimension(200,24);
+ field_timeout.setPreferredSize(d);
+ field_timeout.setMaximumSize(d);
+ field_timeout.setMinimumSize(d);
+ field_timeout.setToolTipText("timeout for axis conection,ms
(default 300000ms = 5min)");
+
Action action = new AbstractAction("Send requests in
parallel") {
// This method is called when the button is pressed
@@ -73,10 +155,11 @@
field_parallel = new JCheckBox(action);
field_parallel.setSelected(getPsModel().getRequest().isParallel());
+ field_parallel.setToolTipText("If checked, the requests will be
sent in parallel threads, otherwise sequentially in one thread.");
-
SpinnerModel model = new
SpinnerNumberModel(psModel.getRequest().getMaxRequests(), 1, 100, 1);
- JSpinner field_maxItems = new JSpinner(model);
+ field_maxItems = new JSpinner(model);
+ field_maxItems.setToolTipText("Max number of queries in an
aggregated request");
field_maxItems.setMaximumSize(new
Dimension(Integer.MAX_VALUE,24));
field_maxItems.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
@@ -86,12 +169,8 @@
}
});
-
- add(new JLabel("Max number of interfaces per request"));
- add(field_maxItems);
- add(field_parallel);
- field_parallel.setToolTipText("If checked, the requests will be
sent in parallel threads, otherwise sequentially in one thread.");
-
+ placeWidgets();
+
}
- perfsonar: r2770 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/ui/panels, svnlog, 09/05/2007
Archive powered by MHonArc 2.6.16.