perfsonar-dev - perfsonar: r2851 - in branches/perfsonarui/src: . org/perfsonar/perfsonarui/flowsa org/perfsonar/perfsonarui/flowsa/components org/perfsonar/perfsonarui/flowsa/panels org/perfsonar/perfsonarui/ui/panels
Subject: perfsonar development work
List archive
perfsonar: r2851 - in branches/perfsonarui/src: . org/perfsonar/perfsonarui/flowsa org/perfsonar/perfsonarui/flowsa/components org/perfsonar/perfsonarui/flowsa/panels org/perfsonar/perfsonarui/ui/panels
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2851 - in branches/perfsonarui/src: . org/perfsonar/perfsonarui/flowsa org/perfsonar/perfsonarui/flowsa/components org/perfsonar/perfsonarui/flowsa/panels org/perfsonar/perfsonarui/ui/panels
- Date: Sun, 16 Sep 2007 09:24:35 -0400
Author: michael.bischoff
Date: 2007-09-16 09:24:35 -0400 (Sun, 16 Sep 2007)
New Revision: 2851
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/Router.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/DateTimeModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/DateTimePicker.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/DefaultDateTimeModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/OptionsPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RawSpecificsPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RouterPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/SpecificsPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/TimeRangePicker.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/TopParametersPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/TopSpecificsPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/package-info.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/package-info.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/raw.xml
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/stat.xml
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/top.xml
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/CheckListModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/CheckListSelectionListener.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/DefaultCheckListModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/DefaultModifiableListModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/JCheckList.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/JDualListItemSelector.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/ModifiableListModel.java
Removed:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/package.html
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/RouterOptionsPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RulesPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/TopOptionsPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/requestTemplates/
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAModel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSARequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAUserData.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/StatPanel.java
branches/perfsonarui/src/plugins.flowsa.classes
Log:
flowsa MA options revision
changed layout
changed some input components
added UserData model update.
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAModel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAModel.java
2007-09-15 14:01:23 UTC (rev 2850)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAModel.java
2007-09-16 13:24:35 UTC (rev 2851)
@@ -7,7 +7,22 @@
package org.perfsonar.perfsonarui.flowsa;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.ENDMOMENT;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.QUERYTYPE;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.RAWAGGREGATION;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.RAWFIELDS;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.RAWFILTER;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.ROUTERS;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.STARTMOMENT;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.TOPAGGREGATION;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.TOPELEMENTS;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.TOPFILTER;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.TOPNUMBER;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.TOPORDERBY;
+import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.TOPTRANSGROUP;
+
import java.awt.Component;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -16,12 +31,8 @@
import org.perfsonar.perfsonarui.IPerfsonarSchema;
import org.perfsonar.perfsonarui.PerfsonarSchema;
import org.perfsonar.perfsonarui.SmartMARequest;
-import org.perfsonar.perfsonarui.flowsa.panels.MainOptionsPanel;
-import org.perfsonar.perfsonarui.flowsa.panels.MomentOptionsPanel;
+import org.perfsonar.perfsonarui.flowsa.components.OptionsPanel;
import org.perfsonar.perfsonarui.flowsa.panels.QueryResultPanel;
-import org.perfsonar.perfsonarui.flowsa.panels.RawOptionsPanel;
-import org.perfsonar.perfsonarui.flowsa.panels.RouterOptionsPanel;
-import org.perfsonar.perfsonarui.flowsa.panels.TopOptionsPanel;
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.plugins.MAEndpointList;
@@ -29,11 +40,10 @@
import org.perfsonar.perfsonarui.ui.PluginMainPanel;
import org.perfsonar.perfsonarui.ui.actions.PSUIAction;
import org.perfsonar.perfsonarui.ui.actions.PerfsonarRequestAction;
+import org.perfsonar.perfsonarui.ui.actions.SelectOneEndpointAction;
import org.perfsonar.perfsonarui.ui.actions.SetOptionsAction;
import org.perfsonar.perfsonarui.ui.panels.UserDataDetailsPane;
-import static org.perfsonar.perfsonarui.flowsa.FlowSAUserData.*;
-
/**
* Implementation of the FlowSA tab.
*
@@ -42,16 +52,10 @@
public class FlowSAModel extends PerfsonarModel {
private static final PerfsonarSchema PERFSONAR_SCHEMA = new
PerfsonarSchema("flowsa");
-
- private final MainOptionsPanel mainOptionsPanel;
- private final MomentOptionsPanel momentOptionsPanel;
- private final RouterOptionsPanel routerOptionsPanel;
- private final RawOptionsPanel rawOptionsPanel;
- private final TopOptionsPanel topOptionsPanel;
+ private final OptionsPanel optionsPanel;
/**
- * Default constructor
- * just calls super.
+ * Default constructor just calls super.
*/
public FlowSAModel() {
this(null);
@@ -64,63 +68,79 @@
*/
public FlowSAModel(MAEndpointList endpoints) {
super(endpoints);
- mainOptionsPanel = createMainOptionsPanel();
- momentOptionsPanel = createMomentOptionsPanel();
- routerOptionsPanel = createRouterOptionsPanel();
- rawOptionsPanel = createRawOptionsPanel();
- topOptionsPanel = createTopOptionsPanel();
+ optionsPanel = createOptionsPanel();
MAEndpoint currentEndPoint =
initialiseEndPoints(this.endpointList);
logger.debug("currentEndpoint = "+currentEndPoint);
getUserData().setEndpoint(currentEndPoint);
}
-
- protected MomentOptionsPanel createMomentOptionsPanel() {
- return new MomentOptionsPanel();
+
+ /* (non-Javadoc)
+ * @see org.perfsonar.perfsonarui.ui.PerfsonarModel#createEndpoints()
+ */
+ @Override
+ public MAEndpointList createEndpoints() {
+ MAEndpointList endpoints = new MAEndpointList(new
File("MA.conf"),getSupportedRequests());
+ if (endpoints.size() == 0) {
+ endpoints.add(new
MAEndpoint("local,http://localhost:8080/flowsa-ma-0.0.1/services/FlowsaMeasurementArchiveService,\"\",flowsa,flowsa"));
+ endpoints.add(new
MAEndpoint("SURFnet,http://sonar1.amsterdam.surfnet.nl:8080/flowsa-ma-0.0.1/services/FlowsaMeasurementArchiveService,\"\",flowsa,flowsa"));
+ }
+ return endpoints;
}
- protected MainOptionsPanel createMainOptionsPanel() {
- return new MainOptionsPanel(getUserData());
+ /* (non-Javadoc)
+ * @see org.perfsonar.perfsonarui.ui.PerfsonarModel#createUserData()
+ */
+ @Override
+ public FlowSAUserData createUserData() {
+ return new FlowSAUserData();
}
-
- protected RouterOptionsPanel createRouterOptionsPanel() {
- return new RouterOptionsPanel();
+
+ /* (non-Javadoc)
+ * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createOptionsAction()
+ */
+ @Override
+ public PSUIAction createOptionsAction() {
+ return new SetOptionsAction(this);
}
+
+ /* (non-Javadoc)
+ * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createEndpointsAction(org.perfsonar.perfsonarui.plugins.MAEndpointList)
+ */
+ @Override
+ public PSUIAction createEndpointsAction(MAEndpointList endpointList) {
+ return new SelectOneEndpointAction(endpointList) {
+ private static final long serialVersionUID = 1L;
- protected RawOptionsPanel createRawOptionsPanel() {
- return new RawOptionsPanel(getUserData());
+ @Override
+ public void
actionPerformed(java.awt.event.ActionEvent event) {
+ super.actionPerformed(event);
+ for (int i=0; i < endpoints.size();i++) {
+ if (endpoints.get(i).isEnabled()) {
+ setEndpoint(endpoints.get(i));
+ return;
+ }
+ }
+ }
+ };
}
-
- protected TopOptionsPanel createTopOptionsPanel() {
- return new TopOptionsPanel();
- }
-
/**
- * Looks through the list and selects the fist avail endpoint if
- * none are available then it picks the first from the list enables
- * it and returns that endpoint
- * @param endpointList
- * @return a endpoint if avail or null.
+ * Set's a new endpoint
+ * @param endpoint
*/
- private MAEndpoint initialiseEndPoints(MAEndpointList endpointList) {
- for (int i = 0; i < endpointList.size(); i++) {
- // reset status
- (endpointList.get(i)).setStatusExplanation("");
- (endpointList.get(i)).setStatus("");
- // find first selected
- if ((endpointList.get(i)).isEnabled()) {
- return endpointList.get(i);
- }
- }
- MAEndpoint first = endpointList.get(0);
- if(first!=null) {
- first.setEnabled(true);
- return first;
- }
- return null;
+ protected void setEndpoint(MAEndpoint endpoint) {
+ getUserData().setQuery(FlowSAUserData.ROUTERS, "N/A");
+ getUserData().setEndpoint(endpoint);
}
/* (non-Javadoc)
+ * @see
org.perfsonar.perfsonarui.plugins.IPerfsonarTab#createMainComponent(java.awt.Component)
+ */
+ public PluginMainPanel createMainComponent(Component parentComponent)
{
+ return new QueryResultPanel(parentComponent, this,
getUserData());
+ }
+
+ /* (non-Javadoc)
* @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createDetailsComponent(java.awt.Component)
*/
@Override
@@ -145,69 +165,46 @@
}
/* (non-Javadoc)
- * @see org.perfsonar.perfsonarui.ui.PerfsonarModel#createEndpoints()
+ * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createOptionsComponent(java.awt.Component)
*/
@Override
- public MAEndpointList createEndpoints() {
- MAEndpointList endpoints = new MAEndpointList(false);
- endpoints.add(new
MAEndpoint("local,http://localhost:8080/flowsa-ma-0.0.1/services/FlowsaMeasurementArchiveService,\"\",flowsa,flowsa"));
- endpoints.add(new
MAEndpoint("SURFnet,http://sonar1.amsterdam.surfnet.nl:8080/flowsa-ma-0.0.1/services/FlowsaMeasurementArchiveService,\"\",flowsa,flowsa"));
- return endpoints;
+ public JComponent[] createOptionsComponent(Component parentComponent)
{
+ return new JComponent[] {
+ optionsPanel
+ };
}
/* (non-Javadoc)
- * @see
org.perfsonar.perfsonarui.plugins.IPerfsonarTab#createMainComponent(java.awt.Component)
+ * @see org.perfsonar.perfsonarui.plugins.IPerfsonarTab#getOrder()
*/
- public PluginMainPanel createMainComponent(Component parentComponent)
{
- return new QueryResultPanel(parentComponent, this,
getUserData());
+ public int getOrder() {
+ return 100;
}
/* (non-Javadoc)
- * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createMetadataRequestAction()
+ * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#getSupportedRequests()
*/
@Override
- protected PerfsonarRequestAction createMetadataRequestAction() {
- // TODO Auto-generated method stub
- logger.warn("not yet implemented");
- return null;
+ public List<IPerfsonarSchema> getSupportedRequests() {
+ List<IPerfsonarSchema> supported = new
ArrayList<IPerfsonarSchema>();
+ supported.add(PERFSONAR_SCHEMA);
+ return supported;
}
/* (non-Javadoc)
- * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createOptionsAction()
+ * @see org.perfsonar.perfsonarui.ui.PerfsonarModel#getUserData()
*/
@Override
- public PSUIAction createOptionsAction() {
- return new SetOptionsAction(this) {
- private static final long serialVersionUID = 1L;
-
- @SuppressWarnings("synthetic-access")
- @Override
- protected void confirm(JComponent[] optionPanels) {
-
getUserData().setQuery(FlowSAUserData.STARTMOMENT,
momentOptionsPanel.getStartMoment());
-
getUserData().setQuery(FlowSAUserData.ENDMOMENT,
momentOptionsPanel.getEndMoment());
-
getUserData().setQuery(FlowSAUserData.ROUTERS,
routerOptionsPanel.getRouters());
-
getUserData().setQuery(FlowSAUserData.TOPELEMENTS,
topOptionsPanel.getElement());
-
getUserData().setQuery(FlowSAUserData.TOPORDERBY,
topOptionsPanel.getOrderBy());
-
getUserData().setQuery(FlowSAUserData.TOPNUMBER, topOptionsPanel.getNumber());
-
getUserData().setQuery(FlowSAUserData.TOPTRANSGROUP,
topOptionsPanel.getTransGroup());
-
getUserData().setQuery(FlowSAUserData.TOPFILTER, topOptionsPanel.getFilter());
-
getUserData().setQuery(FlowSAUserData.TOPAGGREGATION,
topOptionsPanel.getAggregation());
- }
- };
+ public FlowSAUserData getUserData() {
+ return (FlowSAUserData) userData;
}
/* (non-Javadoc)
- * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createOptionsComponent(java.awt.Component)
+ * @see java.lang.Object#toString()
*/
@Override
- public JComponent[] createOptionsComponent(Component parentComponent)
{
- return new JComponent[] {
- mainOptionsPanel,
- momentOptionsPanel,
- routerOptionsPanel,
- rawOptionsPanel,
- topOptionsPanel
- };
+ public String toString() {
+ return "FlowSA";
}
/* (non-Javadoc)
@@ -224,44 +221,50 @@
}
/* (non-Javadoc)
- * @see org.perfsonar.perfsonarui.ui.PerfsonarModel#createUserData()
+ * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#createMetadataRequestAction()
*/
@Override
- public FlowSAUserData createUserData() {
- return new FlowSAUserData();
+ protected PerfsonarRequestAction createMetadataRequestAction() {
+ // TODO Auto-generated method stub
+ logger.warn("not yet implemented");
+ return null;
}
- /* (non-Javadoc)
- * @see org.perfsonar.perfsonarui.plugins.IPerfsonarTab#getOrder()
+ /**
+ * Creates a new options Panel
+ * @return the created options panel
*/
- public int getOrder() {
- return 100;
+ protected OptionsPanel createOptionsPanel() {
+ return new OptionsPanel(getUserData());
}
- /* (non-Javadoc)
- * @see
org.perfsonar.perfsonarui.ui.PerfsonarModel#getSupportedRequests()
+ /**
+ * Looks through the list and selects the fist avail endpoint if
+ * none are available then it picks the first from the list enables
+ * it and returns that endpoint
+ * @param endpointList
+ * @return a endpoint if avail or null.
*/
- @Override
- public List<IPerfsonarSchema> getSupportedRequests() {
- List<IPerfsonarSchema> supported = new
ArrayList<IPerfsonarSchema>();
- supported.add(PERFSONAR_SCHEMA);
- return supported;
+ private MAEndpoint initialiseEndPoints(MAEndpointList endpointList) {
+ endpointList.setMultipleEndpoints(false);
+
+ for (int i = 0; i < endpointList.size(); i++) {
+ // reset status
+ (endpointList.get(i)).setStatusExplanation("");
+ (endpointList.get(i)).setStatus("");
+ // find first selected
+ if ((endpointList.get(i)).isEnabled()) {
+ return endpointList.get(i);
+ }
+ }
+
+ MAEndpoint first = endpointList.get(0);
+ if(first!=null) {
+ first.setEnabled(true);
+ return first;
+ }
+
+ return null;
}
- /* (non-Javadoc)
- * @see org.perfsonar.perfsonarui.ui.PerfsonarModel#getUserData()
- */
- @Override
- public FlowSAUserData getUserData() {
- return (FlowSAUserData) userData;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "FlowSA";
- }
-
}
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSARequest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSARequest.java
2007-09-15 14:01:23 UTC (rev 2850)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSARequest.java
2007-09-16 13:24:35 UTC (rev 2851)
@@ -10,8 +10,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.text.DateFormat;
-import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.Date;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -79,9 +79,10 @@
* @throws Exception
*/
protected Document createRawRequest(IUserData data) {
- String inputFile =
"org/perfsonar/perfsonarui/flowsa/requestTemplates/raw.xml";
+ String inputFile = "org/perfsonar/perfsonarui/flowsa/raw.xml";
Document request = parseXmlFile(inputFile);
-
+
+ replaceRouters(request, data);
replaceGenericParameters(request, data);
replaceFilterAndAggregationRule(request, data);
addParameters(request, data);
@@ -91,8 +92,9 @@
}
protected Document createStatRequest(IUserData data) {
- String inputFile =
"org/perfsonar/perfsonarui/flowsa/requestTemplates/stat.xml";
+ String inputFile =
"org/perfsonar/perfsonarui/flowsa/stat.xml";
Document request = parseXmlFile(inputFile);
+ replaceRouters(request, data);
replaceGenericParameters(request, data);
return request;
}
@@ -102,10 +104,11 @@
* @return
*/
protected Document createTopRequest(IUserData data) {
- String inputFile =
"org/perfsonar/perfsonarui/flowsa/requestTemplates/top.xml";
+ String inputFile = "org/perfsonar/perfsonarui/flowsa/top.xml";
Document request = parseXmlFile(inputFile);
-
+
+ replaceRouters(request, data);
replaceGenericParameters(request, data);
// replace filter rule & aggregationRule rule and other
parameters
@@ -164,18 +167,35 @@
logger.debug(response);
}
- private void replaceFilterAndAggregationRule(Document request,
- IUserData data) {
+ private void replaceFilterAndAggregationRule(Document request,
IUserData data) {
NodeList paraNodes =
request.getElementsByTagName("nmwg:parameter");
+ Element removeAggregation = null;
+ Element removeFilter = null;
for (int j = 0; j < paraNodes.getLength(); j++) {
Element paraNode = (Element) paraNodes.item(j);
String nameAttr = paraNode.getAttribute("name");
if (nameAttr.equals("aggregationRule")) {
-
paraNode.getFirstChild().setTextContent(data.getQuery(FlowSAUserData.RAWAGGREGATION));
+ String rule =
data.getQuery(FlowSAUserData.RAWAGGREGATION);
+ if(rule != null && !rule.equals("") &&
!rule.equals("N/A")) {
+
paraNode.getFirstChild().setTextContent(rule);
+ } else {
+ removeAggregation = paraNode;
+ }
} else if (nameAttr.equals("filterRule")) {
-
paraNode.getFirstChild().setTextContent(data.getQuery(FlowSAUserData.RAWFILTER));
+ String rule =
data.getQuery(FlowSAUserData.RAWFILTER);
+ if(rule != null && !rule.equals("") &&
!rule.equals("N/A")) {
+
paraNode.getFirstChild().setTextContent(rule);
+ } else {
+ removeFilter =paraNode;
+ }
}
}
+ if(removeAggregation!=null) {
+
removeAggregation.getParentNode().removeChild(removeAggregation);
+ }
+ if(removeFilter!=null) {
+
removeFilter.getParentNode().removeChild(removeFilter);
+ }
}
/**
@@ -185,10 +205,9 @@
private void replaceGenericParameters(Document request, IUserData
data) {
try {
replaceSubjectTimeRange(request, data);
- } catch (ParseException e) {
+ } catch (NumberFormatException e) {
logger.fatal("internal error can't parse UNIXtime");
- }
- replaceRouters(request, data);
+ }
}
private void replaceRouters(Document request, IUserData data) {
@@ -212,20 +231,20 @@
}
}
- private void replaceSubjectTimeRange(Document request, IUserData data)
- throws ParseException {
+ private void replaceSubjectTimeRange(Document request, IUserData
data) throws NumberFormatException {
NodeList paraNodes =
request.getElementsByTagName("nmwg:parameter");
for (int j = 0; j < paraNodes.getLength(); j++) {
Element paraNode = (Element) paraNodes.item(j);
String nameAttr = paraNode.getAttribute("name");
- DateFormat UNIXtime = new
SimpleDateFormat("sssssssssssssssssss");
DateFormat ISO8601 = new
SimpleDateFormat(ISO8601_PATTERN);
if (nameAttr.equals("startTime")) {
+ long time =
Long.parseLong(data.getQuery(FlowSAUserData.STARTMOMENT));
Element startNode = (Element)
paraNode.getElementsByTagName("nmtm:time").item(0);
- startNode.setAttribute("value",
ISO8601.format(UNIXtime.parse(data.getStartTime())));
+ startNode.setAttribute("value",
ISO8601.format(new Date(time*1000)));
} else if (nameAttr.equals("endTime")) {
+ long time =
Long.parseLong(data.getQuery(FlowSAUserData.ENDMOMENT));
Element endNode = (Element)
paraNode.getElementsByTagName("nmtm:time").item(0);
- endNode.setAttribute("value",
ISO8601.format(UNIXtime.parse(data.getEndTime())));
+ endNode.setAttribute("value",
ISO8601.format(new Date(time*1000)));
}
}
}
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAUserData.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAUserData.java
2007-09-15 14:01:23 UTC (rev 2850)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/FlowSAUserData.java
2007-09-16 13:24:35 UTC (rev 2851)
@@ -42,6 +42,10 @@
};
+ /**
+ * A enumeration that holds the possible query types.
+ * @author michael.bischoff
+ */
public enum QueryType {
RAW("Raw"),
STATISTICAL("Statistical"),
@@ -76,6 +80,12 @@
setDefaults();
}
+ /**
+ * set's the default values.
+ *
+ * TODO pull in everything from the options panel, make the
+ * gui also listen for changes of the userdata though other sources.
+ */
protected void setDefaults() {
setQuery(FlowSAUserData.QUERYTYPE, "Raw");
Calendar now = Calendar.getInstance();
Added: branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/Router.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/DateTimeModel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/DateTimePicker.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/DefaultDateTimeModel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/OptionsPanel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RawSpecificsPanel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/RouterPanel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/SpecificsPanel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/TimeRangePicker.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/TopParametersPanel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/TopSpecificsPanel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/components/package-info.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/package-info.java
Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/package.html
Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MainOptionsPanel.java
Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/MomentOptionsPanel.java
Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawOptionsPanel.java
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawPanel.java
2007-09-15 14:01:23 UTC (rev 2850)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RawPanel.java
2007-09-16 13:24:35 UTC (rev 2851)
@@ -8,18 +8,11 @@
package org.perfsonar.perfsonarui.flowsa.panels;
import java.awt.Component;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.util.Observable;
-import java.util.Observer;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-
import org.perfsonar.perfsonarui.plugins.IPerfsonarTab;
import org.perfsonar.perfsonarui.ui.PluginMainPanel;
-public class RawPanel extends PluginMainPanel implements Observer,
DocumentListener, FocusListener {
+public class RawPanel extends PluginMainPanel {
private static final long serialVersionUID = 1L;
@@ -76,34 +69,5 @@
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE).addContainerGap()));
}
- public void changedUpdate(DocumentEvent e) {
- // TODO Auto-generated method stub
- }
-
- public void focusGained(FocusEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void focusLost(FocusEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void insertUpdate(DocumentEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void removeUpdate(DocumentEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void update(Observable o, Object arg) {
- // TODO Auto-generated method stub
-
- }
-
}
\ No newline at end of file
Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RouterOptionsPanel.java
Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/RulesPanel.java
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/StatPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/StatPanel.java
2007-09-15 14:01:23 UTC (rev 2850)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/StatPanel.java
2007-09-16 13:24:35 UTC (rev 2851)
@@ -13,6 +13,7 @@
import java.util.Observable;
import java.util.Observer;
+import javax.swing.SwingConstants;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
@@ -69,6 +70,7 @@
this.addWidgets();
}
+ @Override
public void addWidgets() {
statQueryPanel = new javax.swing.JPanel();
statsFlowsLabel = new javax.swing.JLabel();
@@ -153,83 +155,83 @@
statsSeqFailLabel.setText("Sequence failures");
statsFlowsField.setEditable(false);
-
statsFlowsField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+ statsFlowsField.setHorizontalAlignment(SwingConstants.RIGHT);
statsFlowsField.setText("32743934");
statsFlowsTcpField.setEditable(false);
-
statsFlowsTcpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsFlowsTcpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsFlowsTcpField.setText("28855797");
statsFlowsudpField.setEditable(false);
-
statsFlowsudpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsFlowsudpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsFlowsudpField.setText("3640646");
statsFlowsIcmpField.setEditable(false);
-
statsFlowsIcmpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsFlowsIcmpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsFlowsIcmpField.setText("166385");
statsFlowsOtherField.setEditable(false);
-
statsFlowsOtherField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsFlowsOtherField.setHorizontalAlignment(SwingConstants.RIGHT);
statsFlowsOtherField.setText("81106");
statsPacketsField.setEditable(false);
-
statsPacketsField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsPacketsField.setHorizontalAlignment(SwingConstants.RIGHT);
statsPacketsField.setText("145371187");
statsPacketsTcpField.setEditable(false);
-
statsPacketsTcpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsPacketsTcpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsPacketsTcpField.setText("131640619");
statsPacketsUdpField.setEditable(false);
-
statsPacketsUdpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsPacketsUdpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsPacketsUdpField.setText("8769174");
statsPacketsIcmpField.setEditable(false);
-
statsPacketsIcmpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsPacketsIcmpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsPacketsIcmpField.setText("215350");
statsPacketsotherField.setEditable(false);
-
statsPacketsotherField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsPacketsotherField.setHorizontalAlignment(SwingConstants.RIGHT);
statsPacketsotherField.setText("4746044");
statsBytesField.setEditable(false);
-
statsBytesField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+ statsBytesField.setHorizontalAlignment(SwingConstants.RIGHT);
statsBytesField.setText("107316849515");
statsBytesTcpField.setEditable(false);
-
statsBytesTcpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsBytesTcpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsBytesTcpField.setText("101866880996");
statsBytesUdpField.setEditable(false);
-
statsBytesUdpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsBytesUdpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsBytesUdpField.setText("2048101988");
statsBytesIcmpField.setEditable(false);
-
statsBytesIcmpField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsBytesIcmpField.setHorizontalAlignment(SwingConstants.RIGHT);
statsBytesIcmpField.setText("2048101988");
statsBytesOtherField.setEditable(false);
-
statsBytesOtherField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsBytesOtherField.setHorizontalAlignment(SwingConstants.RIGHT);
statsBytesOtherField.setText("15996576");
statsFirstField.setEditable(false);
-
statsFirstField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+ statsFirstField.setHorizontalAlignment(SwingConstants.RIGHT);
statsFirstField.setText("3385869955");
statsLastField.setEditable(false);
-
statsLastField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+ statsLastField.setHorizontalAlignment(SwingConstants.RIGHT);
statsLastField.setText("1170162779");
statsMsecFirstField.setEditable(false);
-
statsMsecFirstField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsMsecFirstField.setHorizontalAlignment(SwingConstants.RIGHT);
statsMsecFirstField.setText("166");
statsMsecLastField.setEditable(false);
-
statsMsecLastField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsMsecLastField.setHorizontalAlignment(SwingConstants.RIGHT);
statsMsecLastField.setText("0");
statsSeqFailField.setEditable(false);
-
statsSeqFailField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
+
statsSeqFailField.setHorizontalAlignment(SwingConstants.RIGHT);
statsSeqFailField.setText("139");
org.jdesktop.layout.GroupLayout statQueryPanelLayout = new
org.jdesktop.layout.GroupLayout(statQueryPanel);
Deleted:
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/panels/TopOptionsPanel.java
Copied: branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/raw.xml
(from rev 2827,
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/requestTemplates/raw.xml)
Copied: branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/stat.xml
(from rev 2827,
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/requestTemplates/stat.xml)
Copied: branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/top.xml
(from rev 2827,
branches/perfsonarui/src/org/perfsonar/perfsonarui/flowsa/requestTemplates/top.xml)
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/CheckListModel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/CheckListSelectionListener.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/DefaultCheckListModel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/DefaultModifiableListModel.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/JCheckList.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/JDualListItemSelector.java
Added:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/ModifiableListModel.java
Modified: branches/perfsonarui/src/plugins.flowsa.classes
===================================================================
--- branches/perfsonarui/src/plugins.flowsa.classes 2007-09-15 14:01:23
UTC (rev 2850)
+++ branches/perfsonarui/src/plugins.flowsa.classes 2007-09-16 13:24:35
UTC (rev 2851)
@@ -1,3 +1,4 @@
org/perfsonar/perfsonarui/flowsa/*.class
org/perfsonar/perfsonarui/flowsa/actions/*.class
+org/perfsonar/perfsonarui/flowsa/components/*.class
org/perfsonar/perfsonarui/flowsa/panels/*.class
\ No newline at end of file
- perfsonar: r2851 - in branches/perfsonarui/src: . org/perfsonar/perfsonarui/flowsa org/perfsonar/perfsonarui/flowsa/components org/perfsonar/perfsonarui/flowsa/panels org/perfsonar/perfsonarui/ui/panels, svnlog, 09/16/2007
Archive powered by MHonArc 2.6.16.