perfsonar-dev - perfsonar: r2463 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: demo test
Subject: perfsonar development work
List archive
perfsonar: r2463 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: demo test
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2463 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: demo test
- Date: Thu, 7 Jun 2007 12:19:11 -0400
Author: nina
Date: 2007-06-07 12:19:10 -0400 (Thu, 07 Jun 2007)
New Revision: 2463
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPlugin.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPluginMainPanel.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMRequestTest.java
Log:
code cleanup
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPlugin.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPlugin.java
2007-06-07 12:31:12 UTC (rev 2462)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPlugin.java
2007-06-07 16:19:10 UTC (rev 2463)
@@ -25,17 +25,15 @@
import java.util.List;
import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
import org.perfsonar.perfsonarui.AbstractUserData;
import org.perfsonar.perfsonarui.IPerfsonarSchema;
import org.perfsonar.perfsonarui.PerfsonarSchema;
import org.perfsonar.perfsonarui.ResponseData;
import org.perfsonar.perfsonarui.SmartMARequest;
-import org.perfsonar.perfsonarui.ippm.IPPMRequest;
-import org.perfsonar.perfsonarui.ma.MARequest;
import org.perfsonar.perfsonarui.ma.MARequestPerfsonar2_0;
-import org.perfsonar.perfsonarui.ma.MARequest_NMWG2;
-import org.perfsonar.perfsonarui.ma.MARequest_NMWG2_Netutil;
import org.perfsonar.perfsonarui.ma.UserData;
import org.perfsonar.perfsonarui.ma.UserDataComparator;
import org.perfsonar.perfsonarui.ma.ui.actions.SetupDataRetrieveAllAction;
@@ -65,35 +63,34 @@
public DemoPlugin() {
super(null);
- getEndpointList().setMultipleEndpoints(false);
+ getEndpointList().setMultipleEndpoints(true);
}
- @Override
- public IUserData createUserData() {
- return new UserData(true);
+ public List<IPerfsonarSchema> getSupportedRequests() {
+ ArrayList<IPerfsonarSchema> supported = new
ArrayList<IPerfsonarSchema>();
+ supported.add(new
PerfsonarSchema(MARequestPerfsonar2_0.schemaID));
+ return supported;
}
@Override
- protected IUserDataComparator createComparator() {
- return new UserDataComparator();
- }
- @Override
- public ITimeValueResponse createTimeValueResponseListener() {
- //Simple version
- //return new ResponseData();
- return new CombinedTimeValueResponseListener();
- }
- @Override
protected SmartMARequest createSmartRequest() {
return new SmartMARequest() {
@Override
public IPerfsonarRequest createMARequest(MAEndpoint
endpoint) {
IPerfsonarSchema schema =
endpoint.getSchema();
- if (schema.equals("NMWG2v2_netutil")) return
new MARequest_NMWG2_Netutil();
- else if
(schema.equals(MARequestPerfsonar2_0.schemaID)) return new
MARequestPerfsonar2_0();
+ if
(schema.equals(MARequestPerfsonar2_0.schemaID)) return new
MARequestPerfsonar2_0();
else return null;
}
};
+ }
+ @Override
+ public IUserData createUserData() {
+ return new UserData(true);
}
@Override
+ protected IUserDataComparator createComparator() {
+ return new UserDataComparator();
+ }
+
+ @Override
public PSUIAction createEndpointsAction(MAEndpointList endpointList) {
return new SelectOneEndpointAction(endpointList) {
public void
actionPerformed(java.awt.event.ActionEvent arg0) {
@@ -107,47 +104,64 @@
};
}
@Override
+ /**
+ * No real options here. These are only to illustrate the idea.
+ */
+ public JComponent[] createOptionsComponent(Component parentComponent)
{
+ return new JComponent[] {
+ new JLabel("Options UI here") {
+ public String toString() {return
"Options 1";};
+ },
+ new JPanel() {
+ public String toString() {return
"Options panel 2 ";};
+ },
+ };
+ }
+
+ @Override
public PerfsonarRequestAction createDataRequestAction() {
- return new
SetupDataRequestAction(request,userData,responseData,"Query",null,defaultGroupQuery)
{
+ return new
SetupDataRequestAction(request,userData,responseData,
+ "Query",null,defaultGroupQuery) {
public void prepareQuery(IUserData userData) {
userData.setTime(startTime - timeInterval ,
timeInterval);
-
//userData.setResolution(Integer.toString(getResolution()));
+ //force retrieval of data for both directions
userData.setQuery(UserData.C_DIRECTION,AbstractUserData.NULL_DATA);
};
};
}
@Override
protected PerfsonarRequestAction createMetadataRequestAction() {
- metadataRequestAction = new
SetupDataRetrieveAllAction(request,(UserData)userData,dataList,endpointList);
+ metadataRequestAction = new
SetupDataRetrieveAllAction(request,
+ (UserData)userData,dataList,endpointList);
metadataRequestAction.setGroup(IPerfsonarTab.defaultGroupQuery);
return metadataRequestAction;
}
-
- public PluginMainPanel createMainComponent(Component parentComponent)
{
- return new DemoPluginMainPanel(parentComponent,this);
- }
-
@Override
- public JComponent[] createOptionsComponent(Component parentComponent)
{
- return null;
- }
-
- @Override
+ /**
+ * The string will appear on the tab.
+ */
public String toString() {
return "Demo plugin";
}
+ /**
+ * Plugins are sorted by ascending order, MAX_VALUE ensures this demo
will always be the last one.
+ */
public int getOrder() {
return Integer.MAX_VALUE;
}
-
- public List<IPerfsonarSchema> getSupportedRequests() {
- ArrayList<IPerfsonarSchema> supported = new
ArrayList<IPerfsonarSchema>();
- supported.add(new
PerfsonarSchema(MARequestPerfsonar2_0.schemaID));
- return supported;
+ @Override
+ public ITimeValueResponse createTimeValueResponseListener() {
+ //Simple version
+ //return new ResponseData();
+ return new CombinedTimeValueResponseListener();
}
+ public PluginMainPanel createMainComponent(Component parentComponent)
{
+ return new DemoPluginMainPanel(parentComponent,this);
+ }
+
}
@@ -160,7 +174,6 @@
chartDataset.addSeries("inbound",new
InterfaceUtilizationSeries("inbound",true));
chartDataset.addSeries("outbound",new
InterfaceUtilizationSeries("outbound",false));
}
-
public ResponseData getResponseData() {
return responseData;
}
@@ -170,13 +183,10 @@
public void clear(String type) {
responseData.clear(type);
chartDataset.clear(type);
-
}
public void clear() {
responseData.clear();
chartDataset.clear();
-
-
}
public void setData(String dataId, String type, String time, String
value, String units) {
responseData.setData(dataId,type,time,value,units);
@@ -186,24 +196,18 @@
public void setUserData(IUserData userData) {
responseData.setUserData(userData);
chartDataset.setUserData(userData);
-
-
}
public void initializeResponse() {
responseData.initializeResponse();
chartDataset.initializeResponse();
-
}
public void finalizeResponse() {
responseData.finalizeResponse();
chartDataset.finalizeResponse();
-
}
-
public PerfsonarTimeSeriesDataset getChartDataset() {
return chartDataset;
}
-
public void setChartDataset(PerfsonarTimeSeriesDataset chartDataset) {
this.chartDataset = chartDataset;
}
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPluginMainPanel.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPluginMainPanel.java
2007-06-07 12:31:12 UTC (rev 2462)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/demo/DemoPluginMainPanel.java
2007-06-07 16:19:10 UTC (rev 2463)
@@ -52,10 +52,6 @@
*
*/
public class DemoPluginMainPanel extends PluginMainPanel {
-
- /**
- *
- */
private static final long serialVersionUID = 7636063337530456938L;
public DemoPluginMainPanel(Component parentFrame, IPerfsonarTab model,
LayoutManager layout, boolean isDoubleBuffered) {
@@ -96,8 +92,7 @@
},
true,false);
queryPanel.setBorder(BorderFactory.createTitledBorder("Query"));
-
-
+ //Calendar UI
DatePanel datePanel = new DatePanel();
datePanel.addTimeAction((ITimeSet)((PerfsonarModel)model).getDataRequestAction());
datePanel.setBorder(BorderFactory.createTitledBorder("Select
date"));
@@ -105,7 +100,7 @@
topPanel.add(datePanel);
add(topPanel,BorderLayout.NORTH);
- //Center panel
+ //Tabular view of MetadataList
MetaDataTableModel dm = new
MetaDataTableModel(model.getDataList());
JTable table = new JTable(dm);
table.addMouseListener(new MouseAdapter() {
@@ -117,14 +112,13 @@
}
}
});
-
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane p = new JScrollPane(table);
p.setBorder(BorderFactory.createTitledBorder("Meta data
list"));
add(p,BorderLayout.CENTER);
- //Bottom panel
+ //Bottom panel (chart and table)
JTabbedPane tabbedPane = new JTabbedPane();
ResponseDataAbstractTableModel tm = new
ResponseDataAbstractTableModel(
//If simple version of
createTimeValueResponseListener
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMRequestTest.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMRequestTest.java
2007-06-07 12:31:12 UTC (rev 2462)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/test/IPPMRequestTest.java
2007-06-07 16:19:10 UTC (rev 2463)
@@ -42,7 +42,6 @@
import org.perfsonar.perfsonarui.ippm.IPPMUserData;
import org.perfsonar.perfsonarui.ippm.ui.panels.IPPMPairsTablePanel;
import org.perfsonar.perfsonarui.ippm.ui.panels.IPPMResponseChartPanel;
-import org.perfsonar.perfsonarui.ippm.ui.panels.QueryDetailsPanel;
import org.perfsonar.perfsonarui.plugins.IPerfsonarRequest;
import org.perfsonar.perfsonarui.plugins.IPerfsonarTab;
import org.perfsonar.perfsonarui.plugins.ITimeValueResponse;
@@ -53,6 +52,7 @@
import org.perfsonar.perfsonarui.ui.actions.ITimeSetAction;
import org.perfsonar.perfsonarui.ui.panels.PerfsonarTimeSeries;
import org.perfsonar.perfsonarui.ui.panels.PerfsonarTimeSeriesDataset;
+import org.perfsonar.perfsonarui.ui.panels.QueryDetailsPanel;
import org.perfsonar.perfsonarui.ui.panels.UserDataPanel;
import org.w3c.dom.Document;
- perfsonar: r2463 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: demo test, svnlog, 06/07/2007
Archive powered by MHonArc 2.6.16.