Package com.ordobill.webapp.report

Source Code of com.ordobill.webapp.report.InternalFrame

package com.ordobill.webapp.report;

import java.awt.Container;
import java.awt.Dimension;
import java.util.ArrayList;

import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;

import org.jfree.chart.ChartFrame;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.ui.ApplicationFrame;

public class InternalFrame extends ApplicationFrame{

  public InternalFrame(String title) {
    super(title);
    // TODO Auto-generated constructor stub
    //createFrame();
  }
 
  public void createFrame(ArrayList<JFreeChart> dataArr) {

    final JDesktopPane desktopPane = new JDesktopPane();
    desktopPane.setPreferredSize(new Dimension(1010,800));
   
    JFreeChart norChart = dataArr.get(0);
    JFreeChart scaChart = dataArr.get(1);
    JFreeChart pieChart = dataArr.get(2);
    ChartPanel norChartPanel = new ChartPanel(norChart);
    ChartPanel scaChartPanel = new ChartPanel(scaChart);
    ChartPanel pieChartPanel = new ChartPanel(pieChart);
    norChartPanel.setPreferredSize(new Dimension(500, 300));
    scaChartPanel.setPreferredSize(new Dimension(500, 300));
    pieChartPanel.setPreferredSize(new Dimension(550, 400));
    //chartPanel.setPreferredSize(new Dimension(200, 100));
    JInternalFrame norFrame = new JInternalFrame("NormalDistribution", true);
    JInternalFrame scaFrame = new JInternalFrame("ScatterPlot", true);
    JInternalFrame pieFrame = new JInternalFrame("pie", true);
    norFrame.getContentPane().add(norChartPanel);
    scaFrame.getContentPane().add(scaChartPanel);
    pieFrame.getContentPane().add(pieChartPanel);
    desktopPane.add(norFrame);
    desktopPane.add(scaFrame);
    desktopPane.add(pieFrame);
    norFrame.pack();
    norFrame.setVisible(true);
    scaFrame.pack();
    scaFrame.setLocation(501, 0);
    scaFrame.setVisible(true);
    pieFrame.pack();
    pieFrame.setLocation(0, 331);
    pieFrame.setVisible(true);
    getContentPane().add(desktopPane);
    /*JInternalFrame frame2;
    /*JInternalFrame frame2;
    desktopPane.add(frame2);
    frame2.pack();
    frame2.setLocation(100, 200);
    frame2.setVisible(true);*/
    //getContent().add(desktopPane);
  }

  /*private Container getContentPane() {
    // TODO Auto-generated method stub
    return null;
  }*/
}
 
TOP

Related Classes of com.ordobill.webapp.report.InternalFrame

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.