Package org.apache.jmeter.save

Examples of org.apache.jmeter.save.SaveGraphicsService


                }
                // Get the string given from the choose and check
                // the file extension.
                filename = chooser.getSelectedFile().getAbsolutePath();
                if (filename != null) {
                    SaveGraphicsService save = new SaveGraphicsService();
                    String ext = filename.substring(filename.length() - 4);
                    String name = filename.substring(0, filename.length() - 4);
                    if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
                        save.saveJComponent(name, SaveGraphicsService.PNG, comp);
                    } else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
                        save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
                    } else {
                        save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
                    }
                }
            }
        }
    }
View Full Code Here


        bchart.setXAxis(AbstractTable.REPORT_TABLE_90_PERCENT);
        bchart.setXLabel(AbstractChart.X_DATA_DATE_LABEL);
        bchart.setURL("jakarta_home");
        JComponent gr = bchart.renderChart(list);
        assertNotNull(gr);
        SaveGraphicsService serv = new SaveGraphicsService();
        String filename = bchart.getTitle();
        filename = filename.replace(' ','_');
        if (!"true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
            String outName = findTestPath("./testfiles/" + filename);
            serv.saveJComponent(outName,SaveGraphicsService.PNG,gr);
            assertTrue("Should have created the file",new File(outName+".png").exists());
        }
    }
View Full Code Here

        lgraph.setXAxis(AbstractTable.REPORT_TABLE_MAX);
        lgraph.setXLabel(AbstractChart.X_DATA_FILENAME_LABEL);
        lgraph.setURLs("jakarta_home,jmeter_home");
        JComponent gr = lgraph.renderChart(list);
        assertNotNull(gr);
        SaveGraphicsService serv = new SaveGraphicsService();
        String filename = lgraph.getTitle();
        filename = filename.replace(' ','_');
        if (!"true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
            String outPfx = findTestPath("./testfiles/" + filename);
            serv.saveJComponent(outPfx,SaveGraphicsService.PNG,gr);
            assertTrue("Should have created file",new File(outPfx+".png").exists());
        }
    }
View Full Code Here

        }
        // Get the string given from the choose and check
        // the file extension.
        filename = chooser.getSelectedFile().getAbsolutePath();
        if (filename != null) {
          SaveGraphicsService save = new SaveGraphicsService();
          String ext = filename.substring(filename.length() - 4);
          String name = filename.substring(0, filename.length() - 4);
          if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
            save.saveJComponent(name, SaveGraphicsService.PNG, comp);
          } else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
            save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
          } else {
            save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
          }
        }
      }
    }
  }
View Full Code Here

            JOptionPane.QUESTION_MESSAGE);
        if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {
          return ; // Do not save, user does not want to overwrite
        }
      }
            SaveGraphicsService save = new SaveGraphicsService();
            String ext = filename.substring(filename.length() - 4);
            String name = filename.substring(0, filename.length() - 4);
            if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
                save.saveJComponent(name, SaveGraphicsService.PNG, comp);
            } else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
                save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
            } else {
                save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
            }
        }

    }
View Full Code Here

        bchart.setXAxis(AbstractTable.REPORT_TABLE_90_PERCENT);
        bchart.setXLabel(AbstractChart.X_DATA_DATE_LABEL);
        bchart.setURL("jakarta_home");
        JComponent gr = bchart.renderChart(list);
        assertNotNull(gr);
        SaveGraphicsService serv = new SaveGraphicsService();
        String filename = bchart.getTitle();
        filename = filename.replace(' ','_');
        if (!"true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
            String outName = File.createTempFile(filename, null).getAbsolutePath(); // tweak.
            serv.saveJComponent(outName,SaveGraphicsService.PNG,gr);
            assertTrue("Should have created the file",new File(outName+".png").exists());
        }
    }
View Full Code Here

                }
                // Get the string given from the choose and check
                // the file extension.
                filename = chooser.getSelectedFile().getAbsolutePath();
                if (filename != null) {
                    SaveGraphicsService save = new SaveGraphicsService();
                    String ext = filename.substring(filename.length() - 4);
                    String name = filename.substring(0, filename.length() - 4);
                    if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
                        save.saveJComponent(name, SaveGraphicsService.PNG, comp);
                    } else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
                        save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
                    } else {
                        save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
                    }
                }
            }
        }
    }
View Full Code Here

        lgraph.setXAxis(AbstractTable.REPORT_TABLE_MAX);
        lgraph.setXLabel(AbstractChart.X_DATA_FILENAME_LABEL);
        lgraph.setURLs("jakarta_home,jmeter_home");
        JComponent gr = lgraph.renderChart(list);
        assertNotNull(gr);
        SaveGraphicsService serv = new SaveGraphicsService();
        String filename = lgraph.getTitle();
        filename = filename.replace(' ','_');
        if (!"true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
            String outPfx = File.createTempFile(filename, null).getAbsolutePath(); // tweak.
            serv.saveJComponent(outPfx,SaveGraphicsService.PNG,gr);
            assertTrue("Should have created file",new File(outPfx+".png").exists());
        }
    }
View Full Code Here

                        JOptionPane.QUESTION_MESSAGE);
                if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {
                    return ; // Do not save, user does not want to overwrite
                }
            }
            SaveGraphicsService save = new SaveGraphicsService();
            String ext = filename.substring(filename.length() - 4);
            String name = filename.substring(0, filename.length() - 4);
            if (ext.equals(SaveGraphicsService.PNG_EXTENSION)) {
                save.saveJComponent(name, SaveGraphicsService.PNG, comp);
            } else if (ext.equals(SaveGraphicsService.TIFF_EXTENSION)) {
                save.saveJComponent(name, SaveGraphicsService.TIFF, comp);
            } else {
                save.saveJComponent(filename, SaveGraphicsService.PNG, comp);
            }
        }

    }
View Full Code Here

        bchart.setXAxis(AbstractTable.REPORT_TABLE_90_PERCENT);
        bchart.setXLabel(AbstractChart.X_DATA_DATE_LABEL);
        bchart.setURL("jakarta_home");
        JComponent gr = bchart.renderChart(list);
        assertNotNull(gr);
        SaveGraphicsService serv = new SaveGraphicsService();
        String filename = bchart.getTitle();
        filename = filename.replace(' ','_');
        if (!"true".equalsIgnoreCase(System.getProperty("java.awt.headless"))){
            serv.saveJComponent("./testfiles/" + filename,SaveGraphicsService.PNG,gr);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.save.SaveGraphicsService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.