marvin.performance.MarvinPerformanceWindow Maven / Gradle / Ivy
The newest version!
/**
Marvin Project <2007-2013>
http://www.marvinproject.org
License information:
http://marvinproject.sourceforge.net/en/license.html
Discussion group:
https://groups.google.com/forum/#!forum/marvin-project
*/
package marvin.performance;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import marvin.statistic.MarvinBarChart;
import marvin.statistic.MarvinBarChartEntry;
/**
* Window to show statistic information. The events attributes and
* comparative charts are displayed for performance analysis.
*
* @version 1.0 02/13/08
* @author Gabriel Ambrosio Archanjo
*/
public class MarvinPerformanceWindow extends JFrame
{
private JPanel mainPanel,
leftPanel,
rightPanel,
tempPanel;
private GridLayout leftPanelLayout,
rightPanelLayout;
MarvinBarChart tempTimeBarChart, tempStepsBarChart;
/**
* Constructs a {@link MarvinPerformanceWindow}
* @param a_registry {@link MarvinPerformanceRegistry}
*/
public MarvinPerformanceWindow(MarvinPerformanceRegistry a_registry){
super("Performance statistics");
setSize(800,580);
// Panels
mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout());
rightPanel = new JPanel();
rightPanelLayout = new GridLayout(2,1);
rightPanelLayout.setVgap(30);
rightPanel.setLayout(rightPanelLayout);
tempPanel = new JPanel();
tempPanel.setLayout(new FlowLayout());
tempPanel.add(rightPanel);
mainPanel.add(tempPanel, BorderLayout.EAST);
leftPanel = new JPanel();
leftPanelLayout = new GridLayout(0,1);
leftPanelLayout.setVgap(30);
leftPanel.setLayout(leftPanelLayout);
tempPanel = new JPanel();
tempPanel.setLayout(new FlowLayout());
tempPanel.add(leftPanel);
mainPanel.add(tempPanel, BorderLayout.WEST);
getContentPane().add(mainPanel);
MarvinPerformanceEntry l_entry;
MarvinPerformanceEvent l_event;
tempTimeBarChart = new MarvinBarChart("Process time (milliseconds):");
tempTimeBarChart.setBarsColor(MarvinBarChart.SEQUENTIAL_BAR_COLOR);
tempStepsBarChart = new MarvinBarChart("Procedures:");
tempStepsBarChart.setBarsColor(MarvinBarChart.SEQUENTIAL_BAR_COLOR);
for(int i=0; i