Package org.geoforge.itext.text.pdf

Source Code of org.geoforge.itext.text.pdf.GfrContent

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.geoforge.itext.text.pdf;

import com.lowagie.geoforge.text.pdf.GfrPdfPCell;
import com.lowagie.text.pdf.LwgPdfPTable;
import com.lowagie.text.pdf.PdfWriter;
import java.awt.Color;
import java.util.List;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.CombinedDomainXYPlot;
import org.jfree.chart.plot.Plot;
import org.jfree.chart.plot.XYPlot;

/**
*
* @author user
*/
public class GfrContent extends LwgPdfPTable
{

   public GfrContent(
         JFreeChart chart,
         PdfWriter writer,
         float fltWidth,
         float fltHeight,
         float fltXmin,
         float fltYmin)
   {
      super(1);

      super.setWidthPercentage(100);
      super.getDefaultCell().setBorderWidth(0);
      super.getDefaultCell().setPadding(5);


      chart.setBackgroundPaint(new Color(255, 255, 255));

      Plot plot = chart.getPlot();

      plot.setBackgroundPaint(new Color(255, 255, 255));


      if (plot instanceof CombinedDomainXYPlot)
      {
         List<XYPlot> lstPlot = ((List<XYPlot>) ((CombinedDomainXYPlot) plot).getSubplots());

         for (int i = 0; i < lstPlot.size(); i++)
         {
            lstPlot.get(i).setBackgroundPaint(new Color(245, 245, 245));
            lstPlot.get(i).setRangeGridlinePaint(new Color(0, 0, 0));
            lstPlot.get(i).setDomainGridlinePaint(new Color(0, 0, 0));
         }
      }


      GfrPdfPCell cellLogo = new GfrPdfPCell();


      cellLogo.setFixedHeight(fltHeight);



      super.add(cellLogo);

      float fltX = fltXmin;
      float fltY = fltYmin;

      cellLogo.getWidth();

      cellLogo.setChart(chart,
            writer,
            fltX,
            fltY,
            fltWidth,
            fltHeight);





   }
}
TOP

Related Classes of org.geoforge.itext.text.pdf.GfrContent

TOP
Copyright © 2018 www.massapi.com. 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.