Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2553 - in branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa: . panels

Subject: perfsonar development work

List archive

perfsonar: r2553 - in branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa: . panels


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2553 - in branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa: . panels
  • Date: Thu, 19 Jul 2007 10:28:49 -0400

Author: gijs
Date: 2007-07-19 10:28:49 -0400 (Thu, 19 Jul 2007)
New Revision: 2553

Modified:

branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/PerfsonarFlowSAModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/UserData.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MainOptionsPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MomentOptionsPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawOptionsPanel.java

branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/TopOptionsPanel.java
Log:


Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/PerfsonarFlowSAModel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/PerfsonarFlowSAModel.java
2007-07-19 12:53:54 UTC (rev 2552)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/PerfsonarFlowSAModel.java
2007-07-19 14:28:49 UTC (rev 2553)
@@ -8,6 +8,8 @@
package org.perfsonar.perfsonarui.flowsa;

import java.awt.Component;
+import java.io.File;
+import java.net.URL;
import java.util.ArrayList;
import java.util.List;

@@ -17,7 +19,9 @@
import org.perfsonar.perfsonarui.PerfsonarSchema;
import org.perfsonar.perfsonarui.SmartMARequest;
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
+import org.perfsonar.perfsonarui.plugins.IUserData;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
+import org.perfsonar.perfsonarui.plugins.MAEndpointList;
import org.perfsonar.perfsonarui.ui.PerfsonarModel;
import org.perfsonar.perfsonarui.ui.PluginMainPanel;
import org.perfsonar.perfsonarui.ui.actions.PSUIAction;
@@ -40,8 +44,11 @@
private RawOptionsPanel rawOptionsPanel;
private TopOptionsPanel topOptionsPanel;

+ private UserData userData;
+
public PerfsonarFlowSAModel() {
super();
+ this.userData = createUserData();
getEndpointList().setMultipleEndpoints(false);
mainOptionsPanel = new MainOptionsPanel();
momentOptionsPanel = new MomentOptionsPanel();
@@ -49,6 +56,14 @@
rawOptionsPanel = new RawOptionsPanel();
topOptionsPanel = new TopOptionsPanel();
}
+
+ @Override
+ public MAEndpointList getEndpointList() {
+ MAEndpointList endpoints = new MAEndpointList();
+ MAEndpoint endpoint = new
MAEndpoint("SURFnet,http://sonar1.amsterdam.surfnet.nl:8080/services/flowsama,flowsa,,flowsa,flowsa";);
+ endpoints.add(endpoint);
+ return endpoints;
+ }

@Override
public JComponent[] createOptionsComponent(Component parentComponent)
{
@@ -56,28 +71,43 @@
routerOptionsPanel, rawOptionsPanel,
topOptionsPanel };
}

+ @Override
+ public UserData createUserData() {
+ return new UserData();
+ }
+
public PSUIAction createOptionsAction() {
return new SetOptionsAction(this) {
@Override
protected void confirm(JComponent[] optionPanels) {
-
mainOptionsPanel.QueryTypeBox.getSelectedItem();
- momentOptionsPanel.getStartMoment();
- momentOptionsPanel.getEndMoment();
- rawOptionsPanel.getFilter();
- rawOptionsPanel.getAggregation();
- rawOptionsPanel.getFields();
- topOptionsPanel.getElement();
- topOptionsPanel.getOrderBy();
- topOptionsPanel.getNumber();
- topOptionsPanel.getTransGroup();
+ userData.setQuery(UserData.QUERYTYPE,
mainOptionsPanel.getQueryType());
+ userData.setQuery(UserData.STARTMOMENT,
momentOptionsPanel.getStartMoment());
+ userData.setQuery(UserData.ENDMOMENT,
momentOptionsPanel.getEndMoment());
+ userData.setQuery(UserData.RAWFILTER,
rawOptionsPanel.getFilter());
+ userData.setQuery(UserData.RAWAGGREGATION,
rawOptionsPanel.getAggregation());
+ userData.setQuery(userData.RAWFIELDS,
rawOptionsPanel.getFields());
+ userData.setQuery(UserData.TOPELEMENTS,
topOptionsPanel.getElement());
+ userData.setQuery(UserData.TOPORDERBY,
topOptionsPanel.getOrderBy());
+ userData.setQuery(UserData.TOPNUMBER,
topOptionsPanel.getNumber());
+ userData.setQuery(UserData.TOPTRANSGROUP,
topOptionsPanel.getTransGroup());
+
}
};
}

@Override
public JComponent[] createDetailsComponent(Component parentComponent)
{
- String[][] s = new String[][] { { UserData.QUERYTYPE, "Query
Type" },
-
+ String[][] s = new String[][] {
+ {UserData.QUERYTYPE, "Query Type" },
+ {UserData.STARTMOMENT, "Start Moment" },
+ {UserData.ENDMOMENT, "End Moment" },
+ {UserData.RAWFILTER, "Raw Filter rule" },
+ {UserData.RAWAGGREGATION, "Raw Aggregation
rule" },
+ {UserData.RAWFIELDS, "Raw fields" },
+ {UserData.TOPELEMENTS, "Top fields" },
+ {UserData.TOPORDERBY, "Top Order by" },
+ {UserData.TOPNUMBER, "Top Numbers" },
+ {UserData.TOPTRANSGROUP, "Top Group Transport
ports" }
};
ResponseDetailsPane scrollPaneResponse = new
ResponseDetailsPane(
" Query Details", getUserData(),
getDataList(), s, false, false);

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/UserData.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/UserData.java
2007-07-19 12:53:54 UTC (rev 2552)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/UserData.java
2007-07-19 14:28:49 UTC (rev 2553)
@@ -23,29 +23,4 @@
public final static String TOPORDERBY = "Top Order by";
public final static String TOPNUMBER = "Top Numbers";
public final static String TOPTRANSGROUP = "Top Group Transport
ports";
-
- public static final int INDEX_QUERYTYPE = 0;
-
- public static String[] titles = { "Query Type" };
-
- public static String[] names = { QUERYTYPE };
-
- public UserData() {
- super();
- setChanged();
- notifyObservers();
-
- }
-
- @Override
- public void clear() {
- super.clear();
- setChanged();
- notifyObservers();
- }
-
- public String getHostname(int index) {
- return get(index, names[INDEX_QUERYTYPE]).toString();
- }
-
}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MainOptionsPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MainOptionsPanel.java
2007-07-19 12:53:54 UTC (rev 2552)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MainOptionsPanel.java
2007-07-19 14:28:49 UTC (rev 2553)
@@ -3,7 +3,7 @@
$Id$
$Copyright$

-*/
+ */

package org.perfsonar.perfsonarui.flowsa.panels;

@@ -11,6 +11,10 @@

private static final long serialVersionUID = 1L;

+ public javax.swing.JComboBox QueryTypeBox;
+ private javax.swing.JLabel QueryTypeLabel;
+ private javax.swing.JPanel jPanel1;
+
public MainOptionsPanel() {
addWidgets();
}
@@ -20,6 +24,10 @@
return "Main";
}

+ public String getQueryType() {
+ return QueryTypeBox.getSelectedItem().toString();
+ }
+
private void addWidgets() {
jPanel1 = new javax.swing.JPanel();
QueryTypeBox = new javax.swing.JComboBox();
@@ -74,8 +82,4 @@

Short.MAX_VALUE).addContainerGap()));
}

- public javax.swing.JComboBox QueryTypeBox;
- private javax.swing.JLabel QueryTypeLabel;
- private javax.swing.JPanel jPanel1;
-
}
\ No newline at end of file

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MomentOptionsPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MomentOptionsPanel.java
2007-07-19 12:53:54 UTC (rev 2552)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MomentOptionsPanel.java
2007-07-19 14:28:49 UTC (rev 2553)
@@ -48,8 +48,8 @@

private static int[] histories = { 1, 2, 5, 10, 30, 60, 120 };

- private long startMoment = this.getNow() - 60;
- private long endMoment = this.getNow();
+ private String startMoment = String.valueOf(getNow() - 60);
+ private String endMoment = String.valueOf(getNow());

public MomentOptionsPanel() {
addWidgets();
@@ -61,7 +61,7 @@
return "Period";
}

- public long getStartMoment() {
+ public String getStartMoment() {
return this.startMoment;
}

@@ -70,7 +70,7 @@
this.momentEndUnixField.setText("" + endMoment);
}

- public long getEndMoment() {
+ public String getEndMoment() {
return this.endMoment;
}

@@ -78,6 +78,16 @@
return Calendar.getInstance().getTimeInMillis() / 1000;
}

+ public void actionPerformed(ActionEvent e) {
+ int history = presetSelectComboBox.getSelectedIndex();
+ long diff = histories[history] * 60;
+ this.startMoment = String.valueOf(getNow() - diff);
+ this.endMoment = String.valueOf(getNow());
+ this.updateMoments();
+
+ }
+
+
private void addWidgets() {
StartMomentPanel = new javax.swing.JPanel();
momentStartYearComboBox = new javax.swing.JComboBox();
@@ -625,13 +635,6 @@

}

- public void actionPerformed(ActionEvent e) {
- int history = presetSelectComboBox.getSelectedIndex();
- long diff = histories[history] * 60;
- this.startMoment = this.getNow() - diff;
- this.endMoment = this.getNow();
- this.updateMoments();

- }

}

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawOptionsPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawOptionsPanel.java
2007-07-19 12:53:54 UTC (rev 2552)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawOptionsPanel.java
2007-07-19 14:28:49 UTC (rev 2553)
@@ -196,8 +196,8 @@

Short.MAX_VALUE)));
}

- public Object[] getFields() {
- return this.rawFieldsList.getSelectedValues();
+ public String getFields() {
+ return this.rawFieldsList.getSelectedValues().toString();
}

public String getAggregation() {

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/TopOptionsPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/TopOptionsPanel.java
2007-07-19 12:53:54 UTC (rev 2552)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/TopOptionsPanel.java
2007-07-19 14:28:49 UTC (rev 2553)
@@ -213,12 +213,12 @@
return (String) this.topOrderComboBox.getSelectedItem();
}

- public int getNumber() {
- return Integer.parseInt(this.topNumberField.getText());
+ public String getNumber() {
+ return this.topNumberField.getText();
}

- public boolean getTransGroup() {
- return this.topGroupTransCheckBox.isSelected();
+ public String getTransGroup() {
+ return
String.valueOf(this.topGroupTransCheckBox.isSelected());
}

}



  • perfsonar: r2553 - in branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa: . panels, svnlog, 07/19/2007

Archive powered by MHonArc 2.6.16.

Top of Page