simulator.views
Class BandwidthResultsDlg

java.lang.Object
  extended by simulator.views.BandwidthResultsDlg
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class BandwidthResultsDlg
extends java.lang.Object
implements java.awt.event.ActionListener

This window shows previously measured and saved bandwidths between proxies of some proxy groups. The bandwidth results are presented in a table and a bar chart.

Author:
Leo Bosnjak

Nested Class Summary
private  class BandwidthResultsDlg.TableModel
          This nested class represents the data of a JTable.
 
Field Summary
private  java.util.Vector<org.jfree.chart.ChartPanel> groupCharts
           
private  java.util.Vector<BackgroundIcon> groupIcons
           
private  int groupIndex
           
private  java.util.Vector<java.lang.String> groupNames
           
private  java.util.Vector<java.lang.String> groupTips
           
private  javax.swing.JButton jButtonCloseWindow
           
private  javax.swing.JButton jButtonOpenFile
           
private  javax.swing.JPanel jContentPane
           
private  javax.swing.JFrame jFrame
           
private  javax.swing.JLabel jLabel
           
private  javax.swing.JLabel jLabel1
           
private  javax.swing.JLabel jLabel2
           
private  javax.swing.JPanel jPanel
           
private  javax.swing.JPanel jPanelGroupTab
           
private  javax.swing.JScrollPane jScrollPane
           
private  javax.swing.JTabbedPane jTabbedPane
           
private  javax.swing.JTable jTable
           
private  javax.swing.JTextField jTextField1
           
private  javax.swing.JTextField jTextFieldFilePath
           
private  java.util.Vector<BandwidthResultsDlg.TableModel> tableModelVec
           
private  java.util.Vector<javax.swing.JTable> tablesVec
           
 
Constructor Summary
BandwidthResultsDlg()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Handles menu actions and button presses.
private  org.jfree.chart.ChartPanel createChartPanel(java.util.Vector<java.util.Vector<java.lang.Double>> rowData, java.util.Vector<java.lang.String> srcNames, java.util.Vector<java.lang.String> destNames, java.lang.String title, java.lang.String subtitle)
          Creates a chart panel that contains a bar chart with the given results.
private  javax.swing.JButton getJButtonCloseWindow()
          This method initializes jButtonCloseWindow
private  javax.swing.JButton getJButtonOpenFile()
          This method initializes jButtonOpenFile
private  javax.swing.JPanel getJContentPane()
          This method initializes jContentPane
private  javax.swing.JFrame getJFrame()
          This method initializes jFrame
private  javax.swing.JPanel getJPanel()
          This method initializes jPanel
private  javax.swing.JPanel getJPanelGroupTab()
          This method initializes jPanelGroupTab
private  javax.swing.JScrollPane getJScrollPane()
          This method initializes jScrollPane
private  javax.swing.JTabbedPane getJTabbedPane()
          This method initializes jTabbedPane
private  javax.swing.JTabbedPane getJTabbedPane2()
          This method initializes jTabbedPane
private  javax.swing.JTable getJTable()
          This method initializes jTable
private  javax.swing.JTextField getJTextField1()
          This method initializes jTextField1
private  javax.swing.JTextField getJTextFieldFilePath()
          This method initializes jTextFieldFilePath
static void main(java.lang.String[] args)
          For testing purposes.
 boolean showMe(javax.swing.JFrame parent, ScenarioConfig scenarioConfig, java.lang.String fileName, java.util.Hashtable<X2XProxy,java.util.Vector<StructBandwidthInfoBean>> resultsTable)
          Shows the bandwidth results dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jFrame

private javax.swing.JFrame jFrame

jContentPane

private javax.swing.JPanel jContentPane

jButtonOpenFile

private javax.swing.JButton jButtonOpenFile

jLabel

private javax.swing.JLabel jLabel

jTextFieldFilePath

private javax.swing.JTextField jTextFieldFilePath

jButtonCloseWindow

private javax.swing.JButton jButtonCloseWindow

jPanel

private javax.swing.JPanel jPanel

jTabbedPane

private javax.swing.JTabbedPane jTabbedPane

jPanelGroupTab

private javax.swing.JPanel jPanelGroupTab

jLabel1

private javax.swing.JLabel jLabel1

jTextField1

private javax.swing.JTextField jTextField1

jScrollPane

private javax.swing.JScrollPane jScrollPane

jTable

private javax.swing.JTable jTable

jLabel2

private javax.swing.JLabel jLabel2

tablesVec

private java.util.Vector<javax.swing.JTable> tablesVec

tableModelVec

private java.util.Vector<BandwidthResultsDlg.TableModel> tableModelVec

groupNames

private java.util.Vector<java.lang.String> groupNames

groupTips

private java.util.Vector<java.lang.String> groupTips

groupIcons

private java.util.Vector<BackgroundIcon> groupIcons

groupCharts

private java.util.Vector<org.jfree.chart.ChartPanel> groupCharts

groupIndex

private int groupIndex
Constructor Detail

BandwidthResultsDlg

public BandwidthResultsDlg()
Method Detail

getJFrame

private javax.swing.JFrame getJFrame()
This method initializes jFrame

Returns:
javax.swing.JFrame

getJContentPane

private javax.swing.JPanel getJContentPane()
This method initializes jContentPane

Returns:
javax.swing.JPanel

getJButtonOpenFile

private javax.swing.JButton getJButtonOpenFile()
This method initializes jButtonOpenFile

Returns:
javax.swing.JButton

getJTextFieldFilePath

private javax.swing.JTextField getJTextFieldFilePath()
This method initializes jTextFieldFilePath

Returns:
javax.swing.JTextField

getJButtonCloseWindow

private javax.swing.JButton getJButtonCloseWindow()
This method initializes jButtonCloseWindow

Returns:
javax.swing.JButton

getJPanel

private javax.swing.JPanel getJPanel()
This method initializes jPanel

Returns:
javax.swing.JPanel

getJTabbedPane

private javax.swing.JTabbedPane getJTabbedPane()
This method initializes jTabbedPane

Returns:
javax.swing.JTabbedPane

getJTabbedPane2

private javax.swing.JTabbedPane getJTabbedPane2()
This method initializes jTabbedPane

Returns:
javax.swing.JTabbedPane

getJPanelGroupTab

private javax.swing.JPanel getJPanelGroupTab()
This method initializes jPanelGroupTab

Returns:
javax.swing.JPanel

getJTextField1

private javax.swing.JTextField getJTextField1()
This method initializes jTextField1

Returns:
javax.swing.JTextField

getJScrollPane

private javax.swing.JScrollPane getJScrollPane()
This method initializes jScrollPane

Returns:
javax.swing.JScrollPane

getJTable

private javax.swing.JTable getJTable()
This method initializes jTable

Returns:
javax.swing.JTable

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Handles menu actions and button presses.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - an ActionEvent

showMe

public boolean showMe(javax.swing.JFrame parent,
                      ScenarioConfig scenarioConfig,
                      java.lang.String fileName,
                      java.util.Hashtable<X2XProxy,java.util.Vector<StructBandwidthInfoBean>> resultsTable)
Shows the bandwidth results dialog

Parameters:
parent -
scenarioConfig -
fileName -
resultsTable -
Returns:
true - if successful, false otherwise

createChartPanel

private org.jfree.chart.ChartPanel createChartPanel(java.util.Vector<java.util.Vector<java.lang.Double>> rowData,
                                                    java.util.Vector<java.lang.String> srcNames,
                                                    java.util.Vector<java.lang.String> destNames,
                                                    java.lang.String title,
                                                    java.lang.String subtitle)
Creates a chart panel that contains a bar chart with the given results.

Parameters:
rowData - - contains the values
srcNames - - The names of the source proxies
destNames - - The names of the destination proxies
title - - The title of the chart
subtitle - - The subtitle of the chart
Returns:
ChartPanel - the created chart panel

main

public static void main(java.lang.String[] args)
For testing purposes. Creates and shows a test bandwidth results dialog.

Parameters:
args -