woolfel 2005/09/04 21:19:09 Modified: src/reports/org/apache/jmeter/gui ReportGuiPackage.java src/reports/org/apache/jmeter/testelement AbstractTable.java ReportPage.java AbstractChart.java src/reports/org/apache/jmeter/report/gui TableGui.java AbstractReportGui.java ReportPageGui.java src/reports/org/apache/jmeter/report/gui/action ReportSave.java ReportCheckDirty.java AbstractAction.java ReportClose.java ReportLoad.java src/reports/org/apache/jmeter/report/gui/tree ReportTreeModel.java src/reports/org/apache/jmeter JMeterReport.java src/reports/org/apache/jmeter/gui/util ReportMenuBar.java ReportMenuFactory.java src/reports/org/apache/jmeter/control/gui ReportGui.java Added: src/reports/org/apache/jmeter/testelement LineGraph.java Chart.java BarChart.java src/reports/org/apache/jmeter/report/gui LineGraphGui.java BarChartGui.java Log: updating the reporting tool. making steady progress peter Revision Changes Path 1.4 +11 -10 jakarta-jmeter/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java Index: ReportGuiPackage.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ReportGuiPackage.java 27 Aug 2005 03:40:45 -0000 1.3 +++ ReportGuiPackage.java 5 Sep 2005 04:19:07 -0000 1.4 @@ -488,7 +488,7 @@ * @return a ValueReplacer configured for the test tree */ public ValueReplacer getReplacer() { - return new ValueReplacer((ReportPlan) ((ReportTreeNode) getTreeModel().getTestPlan().getArray()[0]) + return new ValueReplacer((ReportPlan) ((ReportTreeNode) getTreeModel().getReportPlan().getArray()[0]) .getTestElement()); } @@ -599,7 +599,7 @@ } } - private String testPlanFile; + private String reportPlanFile; /** * Sets the filepath of the current test plan. It's shown in the main frame @@ -607,17 +607,18 @@ * * @param f */ - public void setTestPlanFile(String f) { - testPlanFile = f; - ReportGuiPackage.getInstance().getMainFrame().setTitle(JMeterUtils.getExtendedFrameTitle(testPlanFile)); + public void setReportPlanFile(String f) { + reportPlanFile = f; + ReportGuiPackage.getInstance().getMainFrame().setTitle( + JMeterUtils.getExtendedFrameTitle(reportPlanFile)); try { - FileServer.getFileServer().setBasedir(testPlanFile); + FileServer.getFileServer().setBasedir(reportPlanFile); } catch (IOException e1) { log.error("Failure setting file server's base dir", e1); } } - public String getTestPlanFile() { - return testPlanFile; + public String getReportPlanFile() { + return reportPlanFile; } } \ No newline at end of file 1.2 +8 -1 jakarta-jmeter/src/reports/org/apache/jmeter/testelement/AbstractTable.java Index: AbstractTable.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/testelement/AbstractTable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractTable.java 1 Sep 2005 04:02:21 -0000 1.1 +++ AbstractTable.java 5 Sep 2005 04:19:07 -0000 1.2 @@ -1,4 +1,4 @@ -//$Header: +// $Header: /* * Copyright 2005 The Apache Software Foundation. * @@ -109,4 +109,11 @@ public void setErrorRate(String set) { setProperty(REPORT_TABLE_ERROR_RATE,set); } + + public void addTestElement(TestElement el) { + super.addTestElement(el); + if (el instanceof AbstractChart) { + ((AbstractChart)el).setParentTable(this); + } + } } 1.4 +2 -2 jakarta-jmeter/src/reports/org/apache/jmeter/testelement/ReportPage.java Index: ReportPage.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/testelement/ReportPage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ReportPage.java 31 Aug 2005 17:36:46 -0000 1.3 +++ ReportPage.java 5 Sep 2005 04:19:07 -0000 1.4 @@ -49,7 +49,7 @@ public static ReportPage createReportPage(String name) { ReportPage page = new ReportPage(); - page.setProperty(TestElement.GUI_CLASS,AbstractReportGui.class.getName()); + // page.setProperty(TestElement.GUI_CLASS,AbstractReportGui.class.getName()); return page; } 1.2 +65 -3 jakarta-jmeter/src/reports/org/apache/jmeter/testelement/AbstractChart.java Index: AbstractChart.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/testelement/AbstractChart.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractChart.java 1 Sep 2005 04:02:21 -0000 1.1 +++ AbstractChart.java 5 Sep 2005 04:19:07 -0000 1.2 @@ -1,4 +1,4 @@ -//$Header: +// $Header: /* * Copyright 2005 The Apache Software Foundation. * @@ -17,10 +17,72 @@ */ package org.apache.jmeter.testelement; -public class AbstractChart extends AbstractTestElement { +import javax.swing.JComponent; - public AbstractChart() { +/** + * The general idea of the chart graphs information for a table. + * A chart can only be generated from a specific table, though more + * than one chart can be generated from a single table. + * @author Peter Lin + * + */ +public abstract class AbstractChart extends AbstractTestElement implements Chart { + + public static final String REPORT_CHART_X_AXIS = "ReportTable.chart.x.axis"; + public static final String REPORT_CHART_Y_AXIS = "ReportTable.chart.y.axis"; + public static final String REPORT_CHART_X_LABEL = "ReportTable.chart.x.label"; + public static final String REPORT_CHART_Y_LABEL = "ReportTable.chart.y.label"; + public static final String REPORT_CHART_TITLE = "ReportTable.chart.title"; + + protected AbstractTable parent = null; + + public AbstractChart() { super(); } + + public String getXAxis() { + return getPropertyAsString(REPORT_CHART_X_AXIS); + } + + public void setXAxis(String field) { + setProperty(REPORT_CHART_X_AXIS,field); + } + + public String getYAxis() { + return getPropertyAsString(REPORT_CHART_Y_AXIS); + } + + public void setYAxis(String scale) { + setProperty(REPORT_CHART_Y_AXIS,scale); + } + + public String getXLabel() { + return getPropertyAsString(REPORT_CHART_X_LABEL); + } + + public void setXLabel(String label) { + setProperty(REPORT_CHART_X_LABEL,label); + } + + public String getYLabel() { + return getPropertyAsString(REPORT_CHART_Y_LABEL); + } + + public void setYLabel(String label) { + setProperty(REPORT_CHART_Y_LABEL,label); + } + + public String getTitle() { + return getPropertyAsString(REPORT_CHART_TITLE); + } + + public void setTitle(String title) { + setProperty(REPORT_CHART_TITLE,title); + } + + public void setParentTable(AbstractTable table) { + this.parent = table; + } + public abstract JComponent renderChart(TestElement element); } 1.1 jakarta-jmeter/src/reports/org/apache/jmeter/testelement/LineGraph.java Index: LineGraph.java =================================================================== // $Header: /* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.testelement; import javax.swing.JComponent; public class LineGraph extends AbstractChart { public LineGraph() { super(); } @Override public JComponent renderChart(TestElement element) { return null; } } 1.1 jakarta-jmeter/src/reports/org/apache/jmeter/testelement/Chart.java Index: Chart.java =================================================================== // $Header: /* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.testelement; import javax.swing.JComponent; import org.apache.jmeter.testelement.TestElement; public interface Chart { JComponent renderChart(TestElement element); } 1.1 jakarta-jmeter/src/reports/org/apache/jmeter/testelement/BarChart.java Index: BarChart.java =================================================================== // $Header: /* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.testelement; import javax.swing.JComponent; /** * The class is reponsible for returning * @author pete * */ public class BarChart extends AbstractChart { public BarChart() { super(); } public JComponent renderChart(TestElement element) { return null; } } 1.2 +86 -4 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/TableGui.java Index: TableGui.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/TableGui.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TableGui.java 1 Sep 2005 04:02:21 -0000 1.1 +++ TableGui.java 5 Sep 2005 04:19:08 -0000 1.2 @@ -17,8 +17,16 @@ */ package org.apache.jmeter.report.gui; +import java.awt.BorderLayout; +import java.awt.Color; + import javax.swing.JCheckBox; +import javax.swing.JMenu; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import org.apache.jmeter.gui.util.ReportMenuFactory; +import org.apache.jmeter.gui.util.VerticalPanel; import org.apache.jmeter.testelement.Table; import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.util.JMeterUtils; @@ -36,15 +44,74 @@ private JCheckBox fiftypercentCheck = new JCheckBox(JMeterUtils.getResString("monitor_label_left_middle")); private JCheckBox nintypercentCheck = - new JCheckBox(JMeterUtils.getResString("aggregate_report_90%_line")); - private JCheckBox errorRateCheck = new JCheckBox(JMeterUtils.getResString("aggregate_report_error")); + new JCheckBox(JMeterUtils.getResString("aggregate_report_90")); + private JCheckBox errorRateCheck = + new JCheckBox(JMeterUtils.getResString("aggregate_report_error")); public TableGui() { super(); + init(); + } + + public String getLabelResource() { + return "report_table"; + } + + /** + * Initialize the components and layout of this component. + */ + protected void init() { + setLayout(new BorderLayout(10, 10)); + setBorder(makeBorder()); + setBackground(Color.white); + + JPanel pane = new JPanel(); + pane.setLayout(new BorderLayout(10,10)); + pane.setBackground(Color.white); + pane.add(this.getNamePanel(),BorderLayout.NORTH); + + VerticalPanel options = new VerticalPanel(Color.white); + meanCheck.setBackground(Color.white); + medianCheck.setBackground(Color.white); + maxCheck.setBackground(Color.white); + minCheck.setBackground(Color.white); + responseRateCheck.setBackground(Color.white); + transferRateCheck.setBackground(Color.white); + fiftypercentCheck.setBackground(Color.white); + nintypercentCheck.setBackground(Color.white); + errorRateCheck.setBackground(Color.white); + options.add(meanCheck); + options.add(medianCheck); + options.add(maxCheck); + options.add(minCheck); + options.add(responseRateCheck); + options.add(transferRateCheck); + options.add(fiftypercentCheck); + options.add(nintypercentCheck); + options.add(errorRateCheck); + add(pane,BorderLayout.NORTH); + add(options,BorderLayout.CENTER); + } + + public JPopupMenu createPopupMenu() { + JPopupMenu pop = new JPopupMenu(); + JMenu addMenu = new JMenu(JMeterUtils.getResString("Add")); + addMenu.add(ReportMenuFactory.makeMenuItem(new BarChartGui().getStaticLabel(), + BarChartGui.class.getName(), + "Add")); + addMenu.add(ReportMenuFactory.makeMenuItem(new LineGraphGui().getStaticLabel(), + LineGraphGui.class.getName(), + "Add")); + pop.add(addMenu); + ReportMenuFactory.addFileMenu(pop); + ReportMenuFactory.addEditMenu(pop,true); + return pop; } public TestElement createTestElement() { - return new Table() ; + Table element = new Table(); + modifyTestElement(element); + return element; } public void modifyTestElement(TestElement element) { @@ -57,6 +124,21 @@ tb.setMean(String.valueOf(meanCheck.isSelected())); tb.setMedian(String.valueOf(medianCheck.isSelected())); tb.setMin(String.valueOf(minCheck.isSelected())); + tb.setResponseRate(String.valueOf(responseRateCheck.isSelected())); + tb.setTransferRate(String.valueOf(transferRateCheck.isSelected())); } - + + public void configure(TestElement element) { + super.configure(element); + Table tb = (Table)element; + meanCheck.setSelected(tb.getMean()); + medianCheck.setSelected(tb.getMedian()); + maxCheck.setSelected(tb.getMax()); + minCheck.setSelected(tb.getMin()); + fiftypercentCheck.setSelected(tb.get50Percent()); + nintypercentCheck.setSelected(tb.get90Percent()); + errorRateCheck.setSelected(tb.getErrorRate()); + responseRateCheck.setSelected(tb.getResponseRate()); + transferRateCheck.setSelected(tb.getTransferRate()); + } } 1.2 +4 -5 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/AbstractReportGui.java Index: AbstractReportGui.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/AbstractReportGui.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractReportGui.java 31 Aug 2005 04:52:12 -0000 1.1 +++ AbstractReportGui.java 5 Sep 2005 04:19:08 -0000 1.2 @@ -31,7 +31,6 @@ import org.apache.jmeter.gui.AbstractJMeterGuiComponent; import org.apache.jmeter.gui.NamePanel; -import org.apache.jmeter.gui.util.MenuFactory; import org.apache.jmeter.gui.util.ReportMenuFactory; import org.apache.jmeter.gui.util.VerticalPanel; import org.apache.jmeter.testelement.TestElement; @@ -80,9 +79,9 @@ public JPopupMenu createPopupMenu() { JPopupMenu pop = new JPopupMenu(); JMenu addMenu = new JMenu(JMeterUtils.getResString("Add")); - addMenu.add(MenuFactory.makeMenu(MenuFactory.CONFIG_ELEMENTS, "Add")); - addMenu.add(MenuFactory.makeMenu(MenuFactory.PRE_PROCESSORS, "Add")); - addMenu.add(MenuFactory.makeMenu(MenuFactory.POST_PROCESSORS, "Add")); + addMenu.add(ReportMenuFactory.makeMenu(ReportMenuFactory.CONFIG_ELEMENTS, "Add")); + addMenu.add(ReportMenuFactory.makeMenu(ReportMenuFactory.PRE_PROCESSORS, "Add")); + addMenu.add(ReportMenuFactory.makeMenu(ReportMenuFactory.POST_PROCESSORS, "Add")); pop.add(addMenu); ReportMenuFactory.addFileMenu(pop); return pop; @@ -92,7 +91,7 @@ * @see org.apache.jmeter.gui.JMeterGUIComponent#getMenuCategories() */ public Collection getMenuCategories() { - return Arrays.asList(new String[] { ReportMenuFactory.SAMPLERS }); + return Arrays.asList(new String[] { ReportMenuFactory.TABLES }); } /** 1.3 +18 -4 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/ReportPageGui.java Index: ReportPageGui.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/ReportPageGui.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReportPageGui.java 31 Aug 2005 17:36:46 -0000 1.2 +++ ReportPageGui.java 5 Sep 2005 04:19:08 -0000 1.3 @@ -1,4 +1,4 @@ -//$Header: +// $Header: /* * Copyright 2005 The Apache Software Foundation. * @@ -21,8 +21,11 @@ import java.awt.Color; import javax.swing.JCheckBox; +import javax.swing.JMenu; import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import org.apache.jmeter.gui.util.ReportMenuFactory; import org.apache.jmeter.gui.util.VerticalPanel; import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.testelement.ReportPage; @@ -31,10 +34,8 @@ import org.apache.jorphan.gui.JLabeledTextField; /** - * @author pete + * @author Peter Lin * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates */ public class ReportPageGui extends AbstractReportGui { @@ -89,6 +90,19 @@ add(pane,BorderLayout.NORTH); add(options,BorderLayout.CENTER); } + + public JPopupMenu createPopupMenu() { + JPopupMenu pop = new JPopupMenu(); + JMenu addMenu = new JMenu(JMeterUtils.getResString("Add")); + addMenu.add(ReportMenuFactory.makeMenuItem(new TableGui().getStaticLabel(), + TableGui.class.getName(), + "Add")); + // addMenu.add(ReportMenuFactory.makeMenu(ReportMenuFactory.TABLES, "Add")); + pop.add(addMenu); + ReportMenuFactory.addFileMenu(pop); + ReportMenuFactory.addEditMenu(pop,true); + return pop; + } /* (non-Javadoc) * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement() 1.1 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/LineGraphGui.java Index: LineGraphGui.java =================================================================== // $Header: /* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.report.gui; import java.awt.BorderLayout; import java.awt.Color; import javax.swing.JPanel; import org.apache.jmeter.gui.util.VerticalPanel; import org.apache.jmeter.testelement.LineGraph; import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.gui.JLabeledTextField; public class LineGraphGui extends AbstractReportGui { private JLabeledTextField xAxis = new JLabeledTextField(JMeterUtils.getResString("report_chart_x_axis")); private JLabeledTextField yAxis = new JLabeledTextField(JMeterUtils.getResString("report_chart_y_axis")); private JLabeledTextField xAxisLabel = new JLabeledTextField(JMeterUtils.getResString("report_chart_x_axis_label")); private JLabeledTextField yAxisLabel = new JLabeledTextField(JMeterUtils.getResString("report_chart_y_axis_label")); public LineGraphGui() { super(); init(); } public String getLabelResource() { return "report_line_graph"; } protected void init() { setLayout(new BorderLayout(10, 10)); setBorder(makeBorder()); setBackground(Color.white); JPanel pane = new JPanel(); pane.setLayout(new BorderLayout(10,10)); pane.setBackground(Color.white); pane.add(this.getNamePanel(),BorderLayout.NORTH); VerticalPanel options = new VerticalPanel(Color.white); xAxis.setBackground(Color.white); yAxis.setBackground(Color.white); xAxisLabel.setBackground(Color.white); yAxisLabel.setBackground(Color.white); options.add(xAxis); options.add(yAxis); options.add(xAxisLabel); options.add(yAxisLabel); add(pane,BorderLayout.NORTH); add(options,BorderLayout.CENTER); } public TestElement createTestElement() { LineGraph element = new LineGraph(); modifyTestElement(element); return element; } public void modifyTestElement(TestElement element) { this.configureTestElement(element); LineGraph bc = (LineGraph)element; bc.setXAxis(xAxis.getText()); bc.setYAxis(yAxis.getText()); bc.setXLabel(xAxisLabel.getText()); bc.setYLabel(yAxisLabel.getText()); } public void configure(TestElement element) { super.configure(element); LineGraph bc = (LineGraph)element; xAxis.setText(bc.getXAxis()); yAxis.setText(bc.getYAxis()); xAxisLabel.setText(bc.getXLabel()); yAxisLabel.setText(bc.getYLabel()); } } 1.1 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/BarChartGui.java Index: BarChartGui.java =================================================================== // $Header: /* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.jmeter.report.gui; import java.awt.BorderLayout; import java.awt.Color; import javax.swing.JPanel; import org.apache.jmeter.gui.util.VerticalPanel; import org.apache.jmeter.testelement.BarChart; import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.gui.JLabeledTextField; public class BarChartGui extends AbstractReportGui { private JLabeledTextField xAxis = new JLabeledTextField(JMeterUtils.getResString("report_chart_x_axis")); private JLabeledTextField yAxis = new JLabeledTextField(JMeterUtils.getResString("report_chart_y_axis")); private JLabeledTextField xAxisLabel = new JLabeledTextField(JMeterUtils.getResString("report_chart_x_axis_label")); private JLabeledTextField yAxisLabel = new JLabeledTextField(JMeterUtils.getResString("report_chart_y_axis_label")); public BarChartGui() { super(); init(); } public String getLabelResource() { return "report_bar_chart"; } protected void init() { setLayout(new BorderLayout(10, 10)); setBorder(makeBorder()); setBackground(Color.white); JPanel pane = new JPanel(); pane.setLayout(new BorderLayout(10,10)); pane.setBackground(Color.white); pane.add(this.getNamePanel(),BorderLayout.NORTH); VerticalPanel options = new VerticalPanel(Color.white); xAxis.setBackground(Color.white); yAxis.setBackground(Color.white); xAxisLabel.setBackground(Color.white); yAxisLabel.setBackground(Color.white); options.add(xAxis); options.add(yAxis); options.add(xAxisLabel); options.add(yAxisLabel); add(pane,BorderLayout.NORTH); add(options,BorderLayout.CENTER); } public TestElement createTestElement() { BarChart element = new BarChart(); modifyTestElement(element); return element; } public void modifyTestElement(TestElement element) { this.configureTestElement(element); BarChart bc = (BarChart)element; bc.setXAxis(xAxis.getText()); bc.setYAxis(yAxis.getText()); bc.setXLabel(xAxisLabel.getText()); bc.setYLabel(yAxisLabel.getText()); } public void configure(TestElement element) { super.configure(element); BarChart bc = (BarChart)element; xAxis.setText(bc.getXAxis()); yAxis.setText(bc.getYAxis()); xAxisLabel.setText(bc.getXLabel()); yAxisLabel.setText(bc.getYLabel()); } } 1.3 +5 -5 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportSave.java Index: ReportSave.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportSave.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReportSave.java 31 Aug 2005 17:36:46 -0000 1.2 +++ ReportSave.java 5 Sep 2005 04:19:08 -0000 1.3 @@ -86,10 +86,10 @@ if (e.getActionCommand().equals(SAVE_AS)) { subTree = ReportGuiPackage.getInstance().getCurrentSubTree(); } else { - subTree = ReportGuiPackage.getInstance().getTreeModel().getTestPlan(); + subTree = ReportGuiPackage.getInstance().getTreeModel().getReportPlan(); } - String updateFile = ReportGuiPackage.getInstance().getTestPlanFile(); + String updateFile = ReportGuiPackage.getInstance().getReportPlanFile(); if (!SAVE.equals(e.getActionCommand()) || updateFile == null) { JFileChooser chooser = ReportFileDialoger.promptToSaveFile(ReportGuiPackage.getInstance().getTreeListener() .getCurrentNode().getName() @@ -99,7 +99,7 @@ } updateFile = chooser.getSelectedFile().getAbsolutePath(); if (!e.getActionCommand().equals(SAVE_AS)) { - ReportGuiPackage.getInstance().setTestPlanFile(updateFile); + ReportGuiPackage.getInstance().setReportPlanFile(updateFile); } } // TODO: doesn't putting this here mark the tree as @@ -123,7 +123,7 @@ log.info("saveTree"); } } catch (Throwable ex) { - ReportGuiPackage.getInstance().setTestPlanFile(null); + ReportGuiPackage.getInstance().setReportPlanFile(null); log.error("", ex); throw new IllegalUserActionException("Couldn't save test plan to file: " + updateFile); } finally { 1.3 +3 -3 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportCheckDirty.java Index: ReportCheckDirty.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportCheckDirty.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReportCheckDirty.java 27 Aug 2005 03:40:45 -0000 1.2 +++ ReportCheckDirty.java 5 Sep 2005 04:19:08 -0000 1.3 @@ -97,7 +97,7 @@ addTree.traverse(this); } else if (action.equals(ADD_ALL)) { previousGuiItems.clear(); - ReportGuiPackage.getInstance().getTreeModel().getTestPlan().traverse(this); + ReportGuiPackage.getInstance().getTreeModel().getReportPlan().traverse(this); } else if (action.equals(REMOVE)) { ReportGuiPackage guiPackage = ReportGuiPackage.getInstance(); ReportTreeNode[] nodes = guiPackage.getTreeListener().getSelectedNodes(); @@ -109,7 +109,7 @@ } checkMode = true; dirty = false; - HashTree wholeTree = ReportGuiPackage.getInstance().getTreeModel().getTestPlan(); + HashTree wholeTree = ReportGuiPackage.getInstance().getTreeModel().getReportPlan(); wholeTree.traverse(this); ReportGuiPackage.getInstance().setDirty(dirty); checkMode = false; 1.2 +3 -3 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/AbstractAction.java Index: AbstractAction.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/AbstractAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractAction.java 27 Aug 2005 03:40:45 -0000 1.1 +++ AbstractAction.java 5 Sep 2005 04:19:08 -0000 1.2 @@ -88,7 +88,7 @@ */ protected void popupShouldSave(ActionEvent e) { log.debug("popupShouldSave"); - if (ReportGuiPackage.getInstance().getTestPlanFile() == null) { + if (ReportGuiPackage.getInstance().getReportPlanFile() == null) { if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils .getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { 1.3 +2 -2 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportClose.java Index: ReportClose.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportClose.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReportClose.java 27 Aug 2005 03:40:45 -0000 1.2 +++ ReportClose.java 5 Sep 2005 04:19:08 -0000 1.3 @@ -84,7 +84,7 @@ guiPackage.getTreeListener().getJTree().setSelectionRow(1); // Clear the name of the test plan file - ReportGuiPackage.getInstance().setTestPlanFile(null); + ReportGuiPackage.getInstance().setReportPlanFile(null); ReportActionRouter.getInstance().actionPerformed( new ActionEvent(e.getSource(), e.getID(), CheckDirty.ADD_ALL)); 1.3 +3 -2 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportLoad.java Index: ReportLoad.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/action/ReportLoad.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReportLoad.java 31 Aug 2005 17:36:46 -0000 1.2 +++ ReportLoad.java 5 Sep 2005 04:19:08 -0000 1.3 @@ -1,3 +1,4 @@ +// $Header: /* * Copyright 2005 The Apache Software Foundation. * @@ -121,7 +122,7 @@ } // don't change name if merging if (!merging && isTestPlan && f != null) { - ReportGuiPackage.getInstance().setTestPlanFile(f.getAbsolutePath()); + ReportGuiPackage.getInstance().setReportPlanFile(f.getAbsolutePath()); } } 1.5 +2 -2 jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java Index: ReportTreeModel.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ReportTreeModel.java 1 Sep 2005 04:02:21 -0000 1.4 +++ ReportTreeModel.java 5 Sep 2005 04:19:08 -0000 1.5 @@ -168,7 +168,7 @@ return hashTree; } - public HashTree getTestPlan() { + public HashTree getReportPlan() { return getCurrentSubTree((ReportTreeNode) ((ReportTreeNode) this .getRoot()).getChildAt(0)); } 1.9 +1 -1 jakarta-jmeter/src/reports/org/apache/jmeter/JMeterReport.java Index: JMeterReport.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/JMeterReport.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JMeterReport.java 31 Aug 2005 04:52:13 -0000 1.8 +++ JMeterReport.java 5 Sep 2005 04:19:08 -0000 1.9 @@ -228,7 +228,7 @@ FileInputStream reader = new FileInputStream(f); HashTree tree = SaveService.loadTree(reader); - ReportGuiPackage.getInstance().setTestPlanFile(f.getAbsolutePath()); + ReportGuiPackage.getInstance().setReportPlanFile(f.getAbsolutePath()); new ReportLoad().insertLoadedTree(1, tree); } catch (Exception e) { 1.3 +3 -3 jakarta-jmeter/src/reports/org/apache/jmeter/gui/util/ReportMenuBar.java Index: ReportMenuBar.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/gui/util/ReportMenuBar.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReportMenuBar.java 29 Aug 2005 01:27:12 -0000 1.2 +++ ReportMenuBar.java 5 Sep 2005 04:19:08 -0000 1.3 @@ -166,7 +166,7 @@ } editMenu.setEnabled(true); } else { - editMenu.setEnabled(false); + // editMenu.setEnabled(false); } } 1.3 +26 -43 jakarta-jmeter/src/reports/org/apache/jmeter/gui/util/ReportMenuFactory.java Index: ReportMenuFactory.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/gui/util/ReportMenuFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ReportMenuFactory.java 29 Aug 2005 01:27:12 -0000 1.2 +++ ReportMenuFactory.java 5 Sep 2005 04:19:08 -0000 1.3 @@ -60,19 +60,19 @@ public final static String CONTROLLERS = "menu_logic_controller"; - public final static String SAMPLERS = "menu_generative_controller"; - public final static String CONFIG_ELEMENTS = "menu_config_element"; public final static String POST_PROCESSORS = "menu_post_processors"; public final static String PRE_PROCESSORS = "menu_pre_processors"; - public final static String ASSERTIONS = "menu_assertions"; - public final static String NON_TEST_ELEMENTS = "menu_non_test_elements"; public final static String LISTENERS = "menu_listener"; + + public final static String REPORT_PAGE = "menu_report_page"; + + public final static String TABLES = "menu_tables"; private static Map menuMap = new HashMap(); @@ -80,20 +80,22 @@ // MENU_ADD_xxx - controls which items are in the ADD menu // MENU_PARENT_xxx - controls which items are in the Insert Parent menu - private static final String[] MENU_ADD_CONTROLLER = new String[] { ReportMenuFactory.CONTROLLERS, ReportMenuFactory.SAMPLERS, - ReportMenuFactory.CONFIG_ELEMENTS, ReportMenuFactory.TIMERS, ReportMenuFactory.LISTENERS, ReportMenuFactory.PRE_PROCESSORS, - ReportMenuFactory.POST_PROCESSORS }; + private static final String[] MENU_ADD_CONTROLLER = new String[] { ReportMenuFactory.CONTROLLERS, + ReportMenuFactory.CONFIG_ELEMENTS, ReportMenuFactory.TIMERS, ReportMenuFactory.LISTENERS, + ReportMenuFactory.PRE_PROCESSORS, ReportMenuFactory.POST_PROCESSORS }; private static final String[] MENU_PARENT_CONTROLLER = new String[] { ReportMenuFactory.CONTROLLERS }; - private static final String[] MENU_ADD_SAMPLER = new String[] { ReportMenuFactory.CONFIG_ELEMENTS, - ReportMenuFactory.ASSERTIONS, ReportMenuFactory.TIMERS, ReportMenuFactory.LISTENERS, ReportMenuFactory.PRE_PROCESSORS, - ReportMenuFactory.POST_PROCESSORS }; + private static final String[] MENU_ADD_REPORT_PAGE = new String[] { ReportMenuFactory.CONFIG_ELEMENTS, + ReportMenuFactory.PRE_PROCESSORS, ReportMenuFactory.POST_PROCESSORS, + ReportMenuFactory.TABLES }; + + private static final String[] MENU_ADD_TABLES = new String[] { ReportMenuFactory.TABLES }; private static final String[] MENU_PARENT_SAMPLER = new String[] { ReportMenuFactory.CONTROLLERS }; - private static List timers, controllers, samplers, configElements, assertions, listeners, nonTestElements, - postProcessors, preProcessors; + private static List controllers, configElements, listeners, nonTestElements, + postProcessors, preProcessors, reportPage, tables; // private static JMenu timerMenu; // private static JMenu controllerMenu; @@ -188,17 +190,6 @@ return pop; } - public static JPopupMenu getDefaultSamplerMenu() { - JPopupMenu pop = new JPopupMenu(); - pop.add(MenuFactory.makeMenus(MENU_ADD_SAMPLER, JMeterUtils.getResString("Add"),// $NON-NLS-1$ - "Add")); - pop.add(makeMenus(MENU_PARENT_SAMPLER, JMeterUtils.getResString("insert_parent"),// $NON-NLS-1$ - "Add Parent")); - MenuFactory.addEditMenu(pop, true); - MenuFactory.addFileMenu(pop); - return pop; - } - public static JPopupMenu getDefaultConfigElementMenu() { JPopupMenu pop = new JPopupMenu(); MenuFactory.addEditMenu(pop, true); @@ -275,24 +266,22 @@ try { List guiClasses = ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(), new Class[] { JMeterGUIComponent.class, TestBean.class }); - timers = new LinkedList(); controllers = new LinkedList(); - samplers = new LinkedList(); configElements = new LinkedList(); - assertions = new LinkedList(); listeners = new LinkedList(); postProcessors = new LinkedList(); preProcessors = new LinkedList(); + tables = new LinkedList(); + reportPage = new LinkedList(); nonTestElements = new LinkedList(); - menuMap.put(TIMERS, timers); - menuMap.put(ASSERTIONS, assertions); menuMap.put(CONFIG_ELEMENTS, configElements); menuMap.put(CONTROLLERS, controllers); menuMap.put(LISTENERS, listeners); menuMap.put(NON_TEST_ELEMENTS, nonTestElements); - menuMap.put(SAMPLERS, samplers); menuMap.put(POST_PROCESSORS, postProcessors); menuMap.put(PRE_PROCESSORS, preProcessors); + menuMap.put(REPORT_PAGE, reportPage); + menuMap.put(TABLES, tables); Collections.sort(guiClasses); Iterator iter = guiClasses.iterator(); while (iter.hasNext()) { @@ -334,9 +323,6 @@ log.debug(name + " participates in no menus."); continue; } - if (categories.contains(TIMERS)) { - timers.add(new MenuInfo(item.getStaticLabel(), name)); - } if (categories.contains(POST_PROCESSORS)) { postProcessors.add(new MenuInfo(item.getStaticLabel(), name)); @@ -350,10 +336,6 @@ controllers.add(new MenuInfo(item.getStaticLabel(), name)); } - if (categories.contains(SAMPLERS)) { - samplers.add(new MenuInfo(item.getStaticLabel(), name)); - } - if (categories.contains(NON_TEST_ELEMENTS)) { nonTestElements.add(new MenuInfo(item.getStaticLabel(), name)); } @@ -365,10 +347,14 @@ if (categories.contains(CONFIG_ELEMENTS)) { configElements.add(new MenuInfo(item.getStaticLabel(), name)); } - if (categories.contains(ASSERTIONS)) { - assertions.add(new MenuInfo(item.getStaticLabel(), name)); + + if (categories.contains(TABLES)) { + tables.add(new MenuInfo(item.getStaticLabel(), name)); } + if (categories.contains(REPORT_PAGE)) { + reportPage.add(new MenuInfo(item.getStaticLabel(), name)); + } } } catch (Exception e) { log.error("", e); @@ -402,15 +388,12 @@ public void testMenu() throws Exception { check("menumap", menuMap.size()); - check("assertions", assertions.size()); check("configElements", configElements.size()); check("controllers", controllers.size()); check("listeners", listeners.size()); check("nonTestElements", nonTestElements.size()); check("postProcessors", postProcessors.size()); check("preProcessors", preProcessors.size()); - check("samplers", samplers.size()); - check("timers", timers.size()); check("elementstoskip", elementsToSkip.size()); 1.8 +5 -3 jakarta-jmeter/src/reports/org/apache/jmeter/control/gui/ReportGui.java Index: ReportGui.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/reports/org/apache/jmeter/control/gui/ReportGui.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ReportGui.java 1 Sep 2005 04:02:21 -0000 1.7 +++ ReportGui.java 5 Sep 2005 04:19:09 -0000 1.8 @@ -69,11 +69,13 @@ public JPopupMenu createPopupMenu() { JPopupMenu pop = new JPopupMenu(); JMenu addMenu = new JMenu(JMeterUtils.getResString("Add")); - addMenu.add(ReportMenuFactory.makeMenuItem(new ReportPageGui().getStaticLabel(), ReportPageGui.class.getName(), + addMenu.add(ReportMenuFactory.makeMenuItem(new ReportPageGui().getStaticLabel(), + ReportPageGui.class.getName(), "Add")); addMenu.add(ReportMenuFactory.makeMenu(ReportMenuFactory.CONFIG_ELEMENTS, "Add")); pop.add(addMenu); ReportMenuFactory.addFileMenu(pop); + ReportMenuFactory.addEditMenu(pop,true); return pop; } @@ -155,7 +157,7 @@ /** * Initialize the components and layout of this component. */ - private void init() { + protected void init() { setLayout(new BorderLayout(10, 10)); setBorder(makeBorder()); setBackground(Color.white);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]