Package org.bioinfo.ngs.qc.qualimap.beans

Examples of org.bioinfo.ngs.qc.qualimap.beans.QChart


        for (File child : children ) {
            String fileName = child.getName();
            if (fileName.endsWith(".png")) {
                String imageName = fileName.subSequence(3,  fileName.length() - 4).toString().replace('_',' ');
                BufferedImage image = ImageIO.read(new FileInputStream(child));
                chartList.add(new QChart(imageName, imageName, image) );
                imageCount++;
            }
        }

        if (imageCount == 0) {
View Full Code Here


        for (File child : dir.listFiles()) {
            String fileName = child.getName();
            if (fileName.endsWith(".jpg")) {
                String imageName = fileName.subSequence(0,  fileName.length() - 4).toString();
                BufferedImage image = ImageIO.read(new FileInputStream(child));
                chartList.add(new QChart(imageName, imageName, image) );
                imageCount++;
            }
        }

        if (imageCount == 0) {
View Full Code Here

        // Generate the Graphics images

        while(it.hasNext() && success){

            QChart chart = it.next();
            BufferedImage bufImage;

            if(chart.isBufferedImage()){
                bufImage = chart.getBufferedImage();
            } else {
                bufImage = chart.getJFreeChart().createBufferedImage(
                                    Constants.GRAPHIC_TO_SAVE_WIDTH,
                                    Constants.GRAPHIC_TO_SAVE_HEIGHT);
            }

            String imagePath = HtmlReportGenerator.getImagePath(reporter, chart.getName());
            imagePath = dirPath + File.separator + imagePath;



            File imageFile = new File(imagePath);
            if (!imageFile.getParentFile().exists()) {
                boolean ok = imageFile.getParentFile().mkdirs();
                if (!ok) {
                    return false;
                }
            }

            success = ImageIO.write(bufImage, "PNG", imageFile);

            increaseProgressBar(chart.getTitle());

        }


        return success;
View Full Code Here

   */
  private void showGraphic(String name, StatsReporter reporter) {



    QChart chart = reporter.findChartByName(name);
        if (chart == null) {
            logger.error("Can not find chart " + name);
            return;
        }

      if (chart.isBufferedImage()) {

            // Get a Singleton to manage the image to display
            GraphicImagePanel panelImage = tabPageController.getGraphicImage();
            BufferedImage imageToDisplay = chart.getBufferedImage();
        // Set the image with the file image get
      panelImage.setImage(imageToDisplay);
            // Scale the image
            if (tabPageController.getTypeAnalysis() == AnalysisType.CLUSTERING ) {
                int width = imageToDisplay.getWidth();
                int height  =  imageToDisplay.getHeight();
                panelImage.setPreferredSize(new Dimension(width, height));
                panelImage.resizeImage(width, height);
            } else {
                panelImage.resizeImage(rightScrollPane.getWidth(), rightScrollPane.getHeight());
            }
            rightScrollPane.setViewportView(panelImage);

        } else {

            JFreeChart jFreeChart = chart.getJFreeChart();
            ChartPanel panelImage = new ChartPanel( jFreeChart );

            if (chart.canExportRawData()) {
                JMenuItem exportDataItem = createExportRawDataMenuItem(chart, this);
                panelImage.getPopupMenu().addSeparator();
                panelImage.getPopupMenu().add( exportDataItem );
            }
            panelImage.setSize(rightScrollPane.getSize());
View Full Code Here

                StatsReporter reporter = tabPageController.getActiveReporter();
                if (!graphicName.isEmpty())  {
                    JMenuItem savePictureItem = createSaveGraphicMenuItem(reporter, graphicName);
                    popup.add(savePictureItem);

                    QChart chart = tabPageController.getActiveReporter().findChartByName(graphicName);
                    if (chart != null && chart.canExportRawData()) {
                        JMenuItem exportDataMenuItem = createExportRawDataMenuItem(chart, parent);
                        popup.addSeparator();
                        popup.add(exportDataMenuItem);
                    }
View Full Code Here

TOP

Related Classes of org.bioinfo.ngs.qc.qualimap.beans.QChart

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.