/** * Advanced Real-Time Simulation Lab (ARS) - Carleton University * * PROJECT: Web Service-Enabled DCD++ Client * AUTHOR(S): Rami Madhoun * PURPOSE: Euaclyptus * CMD LINE ARG: * OUTPUT: * DATE CREATED: Nov 25, 2006 * LAST MOD: Jan 10, 2007 * LAST MOD BY: Rami Madhoun * COPYRIGHT: ARS-Carleton University * USAGE: * COMMENTS: **/ package ca.gc.nrc.iit.pds.appgui.simulation; import java.awt.*; import java.awt.event.*; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JMenuBar; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JToolBar; import javax.swing.JButton; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JTextPane; import javax.swing.*; import javax.swing.border.TitledBorder; import javax.swing.border.Border; import com.borland.jbcl.layout.XYLayout; import com.borland.jbcl.layout.*; import javax.swing.table.TableColumn; import SimulationService.stubs.CDppPortType; import SimulationService.stubs.CDppPortTypeService; import SimulationService.stubs.CDppPortTypeServiceLocator; import SimulationService.pstubs.PCDppPortType; import SimulationService.pstubs.PCDppPortTypeService; import SimulationService.pstubs.PCDppPortTypeServiceLocator; import SimulationService.wrapper.JavaWrapper; import javax.activation.DataHandler; import javax.activation.FileDataSource; import java.io.*; import java.net.URL; import java.rmi.RemoteException; import java.awt.Font; import javax.swing.BorderFactory; import java.awt.Color; import images.*; import java.awt.Dimension; import javax.swing.border.BevelBorder; public class MainFrame extends JFrame { // Modes of operation, MODE_DISTRIBUTED connects the client to DCD++ (simulation enginer that uses SOAP for inter-node communication) // MODE_PARALLEL connects the client to PCD++ (simulation engine that uses MPI for inter-node communication) private final int MODE_DISTRIBUTED= 1; private final int MODE_PARALLEL= 2; private int mode = MODE_DISTRIBUTED; //"PARALLEL" , "DISTRIBUTED" // Table to hold the DEVS source file names (.h and .cpp) int tableIndex = 0; Object[] tableHeader = {"Model Name", "Header File","CPP File"}; Object[][] tableData = new Object[3][10]; // The file seprator is dependent on the running platform (i.e. Windows/Linux) String fileSeparator = null; // Number of nodes used to run the simulation (used for PCD++ when mode= MODE_PARALLEL) private int numberOfNodes = -1; // Used to distinguish between an exsisting session and new session to be created when the user // logs in private boolean isExsistingSession = false; // Used to store the status of the simulation private String simulationStatus = "IDLE"; // "IDLE" , "COMPILING", "RUNNING", "DONE" private boolean simulationStarted = false; private boolean simulationRunning = false; // The names of the log and output files generated by the simulator private String savedLogFileName = null; private String savedSessionLogFileName = null; private String savedParsingInfoFileName = null; private String savedOutputFileName = null; // A timer object used to keep monitoring the status of the simulator private Timer statusTimer = null; // Stubs classes used to access the simulation service (DCD++) private CDppPortType cdppPortType = null; private CDppPortTypeService cdppService= null ; // Stub classes used to access the simulation service (PCD++) private PCDppPortType pcdppPortType = null; private PCDppPortTypeService pcdppService = null; // The file name of ma,grid config, partition, event, DEVS files that are sent to the simulator private String maFileName = null; private String gcFileName = null; private String partitionFileName = null; private String supportFileName = null; private String eventFileName = null; private String devsHFileName = null; private String devsCPPFileName = null; // Used to check whether the user has set the required files for the simulator private boolean isMAFileSet = false; private boolean isEventFileSet = false; private boolean isGCFileSet = false; private boolean isSupportFileSet = false; private boolean isPartitionFileSet = false; private boolean isDEVSModelSet = false; // Used to store the address of the simulation service private String serviceAddress = null; // The sessionID is assigned when after each successful authentication process // it can be an idea for a new session or an already exsisting one private int sessionID = -1; private boolean isLoggedOn = false; // The authentication windows used by the client to set the sessionID private JFrame authenticateFrame = null; // User management window private JFrame userFrame = null; // Swing component definition JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); JMenuBar jMenuBar1 = new JMenuBar(); JMenu jMenuFile = new JMenu(); JMenuItem jMenuFileExit = new JMenuItem(); JMenu jMenuHelp = new JMenu(); JMenuItem jMenuHelpAbout = new JMenuItem(); JToolBar jToolBar = new JToolBar(); JButton jButtonLogin = new JButton(); JButton jButtonLogoff = new JButton(); JButton jButtonRetrieveLog = new JButton(); JLabel statusBar = new JLabel(); JPanel jPanel1 = new JPanel(); JPanel jPanel2 = new JPanel(); JPanel jPanel3 = new JPanel(); JPanel jPanel4 = new JPanel(); JPanel jPanel5 = new JPanel(); JPanel jPanel6 = new JPanel(); TitledBorder titledBorder1 = new TitledBorder(""); Border border1 = BorderFactory.createEtchedBorder(Color.white, new Color(165, 163, 151)); Border border2 = new TitledBorder(border1, "Status"); Border border3 = BorderFactory.createEtchedBorder(Color.white, new Color(165, 163, 151)); Border border4 = new TitledBorder(border3, "Status"); Border border5 = BorderFactory.createEtchedBorder(Color.white, new Color(165, 163, 151)); Border border6 = new TitledBorder(border5, "Status"); ButtonGroup buttonGroup1 = new ButtonGroup(); JRadioButton jRBDistributed = new JRadioButton(); JRadioButton jRBParallel = new JRadioButton(); TitledBorder titledBorder2 = new TitledBorder(""); Border border7 = BorderFactory.createEtchedBorder(Color.white, new Color(165, 163, 151)); Border border8 = new TitledBorder(border7, "Session Options"); JProgressBar jProgressBar1 = new JProgressBar(); XYLayout xYLayout1 = new XYLayout(); JLabel jLabel1 = new JLabel(); XYLayout xYLayout2 = new XYLayout(); XYLayout xYLayout3 = new XYLayout(); JLabel jLabel2 = new JLabel(); XYLayout xYLayout4 = new XYLayout(); JComboBox jComboServiceAddress = new JComboBox(); Border border9 = BorderFactory.createEtchedBorder(Color.white, new Color(165, 163, 151)); Border border10 = new TitledBorder(border9, "Session Type"); JLabel jLabelMA = new JLabel(); XYLayout xYLayout5 = new XYLayout(); JLabel jLabelGC = new JLabel(); JLabel jLabelPartition = new JLabel(); JFormattedTextField jFTextMA = new JFormattedTextField(); JFormattedTextField jFormattedTextField3 = new JFormattedTextField(); JFormattedTextField jFTextGC = new JFormattedTextField(); JFormattedTextField jFTextPartition = new JFormattedTextField(); JButton jButtonSetMA = new JButton(); JButton jButtonSelectMA = new JButton(); JButton jButtonSelectGC = new JButton(); JButton jButtonSetGC = new JButton(); JButton jButtonSelectPartition = new JButton(); JButton jButtonSetPartition = new JButton(); // //TODO addition of the set include file button JButton jButtonSelectInc = new JButton(); JButton jButtonSetInc = new JButton(); private String incFileName = null; private boolean isIncFileSet = false; JFormattedTextField jFTextInc = new JFormattedTextField(); // // Table to hold the include file names (.imc) int tableIndexInc = 0; Object[] tableHeaderInc = {"Include File Name"}; Object[][] tableDataInc = new Object[3][20]; JLabel jLabelInc = new JLabel(); JScrollPane jScrollPaneInc = new JScrollPane(); JTable jTableInc = new JTable(tableDataInc, tableHeaderInc); TitledBorder titledBorderInc = new TitledBorder(""); // // // FileFilter used for fileChooser CDppFileFilter fileFilter = new CDppFileFilter(); // // // // //The name of the include file saved private String savedTmpFileName = null; JButton jButtonRetrieveTmp = new JButton(); // // JFileChooser jFileChooser1 = new JFileChooser(); JLabel jLabel3 = new JLabel(); XYLayout xYLayout6 = new XYLayout(); JLabel jLabel4 = new JLabel(); JLabel jLabel5 = new JLabel(); JFormattedTextField jFTextEvent = new JFormattedTextField(); JFormattedTextField jFTextSupport = new JFormattedTextField(); JFormattedTextField jFormattedTextField5 = new JFormattedTextField(); JFormattedTextField jFormattedTextField6 = new JFormattedTextField(); JFormattedTextField jFTextH = new JFormattedTextField(); JFormattedTextField jFTextCPP = new JFormattedTextField(); JLabel jLabel6 = new JLabel(); JButton jButtonSelectEvent = new JButton(); JButton jButtonSetEvent = new JButton(); JButton jButtonSelectSupport = new JButton(); JButton jButtonSetSupport = new JButton(); JButton jButtonSelectH = new JButton(); JButton jButtonSetDEVS = new JButton(); JButton jButtonSelectCPP = new JButton(); JLabel jLabelSessionID = new JLabel(); TitledBorder titledBorder3 = new TitledBorder(""); JButton jButtonRetrieveSessionLog = new JButton(); JButton jButtonRetrieveParsingInfo = new JButton(); JButton jButtonExit = new JButton(); JButton jButtonStart = new JButton(); JButton jButtonStop = new JButton(); JTextField jTextInterval = new JTextField(); TitledBorder titledBorder4 = new TitledBorder(""); JCheckBox jCheckBoxSimTime = new JCheckBox(); JCheckBox jCheckBoxParsing = new JCheckBox(); JTextField jTextSimTime = new JTextField(); JScrollPane jScrollPane1 = new JScrollPane(); JTable jTable1 = new JTable(tableData, tableHeader); TitledBorder titledBorder5 = new TitledBorder(""); JButton jButtonUsers = new JButton(); JButton jButtonOutput = new JButton(); boolean packFrame = false; public MainFrame() { try { fileSeparator = System.getProperty("file.separator"); this.setDefaultLookAndFeelDecorated(true); this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); jbInit(); } catch (Exception exception) { exception.printStackTrace(); } } class StatusMonitor implements ActionListener { public void actionPerformed(ActionEvent evt) { try { switch (mode) { // Checks the status of the simulator (DCD++/PCD++) case MODE_DISTRIBUTED: simulationStatus = cdppPortType.getStatus(sessionID); break; case MODE_PARALLEL: simulationStatus = pcdppPortType.getStatus(sessionID); break; } statusBar.setText(""); // Update the status bar if ( simulationStatus.equals("COMPILING") ){ jProgressBar1.setString("The code is being compiled"); } else if (simulationStatus.equals("RUNNING")){ jProgressBar1.setString("The simulation is running"); } else if (simulationStatus.equals("DONE")) { jProgressBar1.setString("The simulation is over"); statusTimer.stop(); jProgressBar1.setEnabled(false); jProgressBar1.setIndeterminate(false); } } catch (Exception excep) { excep.printStackTrace(); } } } // Used by the authentication frame/window to set the sessionID variable to be used // for subsequent access to the simulation service public void setSessionID(int id) { if ( id != -1 ) { this.sessionID = id; jLabelSessionID.setText(Integer.toString(id)); isLoggedOn = true; } } // Checks if the user want to connect to an exsisiting session public boolean isExsistingSession() { return isExsistingSession; } // Sets the isExsistingSession variable public void isExsistingSession(boolean isExsisting) { isExsistingSession = isExsisting; } // Retrieves the instance of the stub class used to access the DCD++ service public CDppPortType getCDppPortType() { return cdppPortType; } // Retrieves the instance of the stub class used to access the PCD++ service public PCDppPortType getPCDppPortType() { return pcdppPortType; } // Checks the current mode (MODE_DISTRIBUTED / MODE_PARALLEL) public int getMode() { return mode; } // Initializes the Swing components private void jbInit() throws Exception { jFileChooser1.addChoosableFileFilter(fileFilter); titledBorder5 = new TitledBorder(BorderFactory.createLineBorder(Color. white, 2), "DEVS Model Files (The file name should match the model name)"); ClassLoader cl = this.getClass().getClassLoader(); border6 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(165, 163, 151)), ""); titledBorder4 = new TitledBorder("Session ID"); contentPane = (JPanel) getContentPane(); contentPane.setLayout(borderLayout1); this.setResizable(false); // // TODO Dimensions have been modified // setSize(new Dimension(558, 700)); this.setTitle("Simulation Service Client"); this.addWindowListener(new MainFrame_this_windowAdapter(this)); // setTitle("Frame Title"); statusBar.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); statusBar.setForeground(UIManager.getColor("windowText")); statusBar.setBorder(BorderFactory.createEtchedBorder()); statusBar.setText(" "); jMenuFile.setText("File"); jMenuFileExit.setText("Exit"); jMenuFileExit.addActionListener(new MainFrame_jMenuFileExit_ActionAdapter(this)); jMenuHelp.setText("Help"); jMenuHelpAbout.setText("About"); jMenuHelpAbout.addActionListener(new MainFrame_jMenuHelpAbout_ActionAdapter(this)); jPanel1.setLayout(xYLayout3); jPanel2.setBorder(BorderFactory.createEtchedBorder()); jPanel2.setLayout(xYLayout4); jPanel3.setBorder(BorderFactory.createEtchedBorder()); jPanel3.setLayout(xYLayout5); jPanel4.setBorder(BorderFactory.createEtchedBorder()); jPanel4.setLayout(xYLayout6); jPanel6.setBorder(border10); jPanel6.setLayout(xYLayout2); jPanel5.setBorder(border6); jPanel5.setLayout(xYLayout1); jRBDistributed.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jRBDistributed.setToolTipText(""); jRBDistributed.setSelected(true); jRBDistributed.setText("Distributed-SOAP"); jRBDistributed.addActionListener(new MainFrame_jRBDistributed_actionAdapter(this)); jRBParallel.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jRBParallel.setText("Parallel-MPI"); jRBParallel.addActionListener(new MainFrame_jRBParallel_actionAdapter(this)); jLabel1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jLabel1.setToolTipText(""); jLabel1.setText("Interval (m. seconds)"); jLabel2.setText("Server Address"); jComboServiceAddress.setBackground(Color.white); jComboServiceAddress.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jComboServiceAddress.setForeground(Color.blue); jComboServiceAddress.setBorder(BorderFactory.createEtchedBorder()); jComboServiceAddress.setEditable(true); jLabelMA.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabelMA.setText("MA File"); jLabelGC.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabelGC.setText("Grid Config. File"); jLabelPartition.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabelPartition.setText("Partition File"); jFTextMA.setForeground(Color.blue); jFTextMA.setEditable(false); jFormattedTextField3.setText("jFormattedTextField3"); jFTextGC.setForeground(Color.blue); jFTextGC.setEditable(false); jFTextPartition.setForeground(Color.blue); jFTextPartition.setEditable(false); jButtonSetMA.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSetMA.setText("Set"); jButtonSetMA.addActionListener(new MainFrame_jButtonSetMA_actionAdapter(this)); jButtonSelectMA.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectMA.setText("Select"); jButtonSelectMA.addActionListener(new MainFrame_jButtonSelectMA_actionAdapter(this)); jButtonSelectGC.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectGC.setText("Select"); jButtonSelectGC.addActionListener(new MainFrame_jButtonSelectGC_actionAdapter(this)); jButtonSetGC.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSetGC.setText("Set"); jButtonSetGC.addActionListener(new MainFrame_jButtonSetGC_actionAdapter(this)); jButtonSetPartition.setEnabled(false); jButtonSetPartition.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSetPartition.setText("Set"); jButtonSetPartition.addActionListener(new MainFrame_jButtonSetPartition_actionAdapter(this)); jButtonSelectPartition.setEnabled(false); jButtonSelectPartition.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectPartition.setText("Select"); jLabel3.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabel3.setText("Event File"); jLabel4.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabel4.setText("Support File"); jLabel5.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabel5.setText("DEVS Model (.h)"); jFTextEvent.setForeground(Color.blue); jFTextEvent.setEditable(false); jFTextEvent.setText(""); jFTextSupport.setForeground(Color.blue); jFTextSupport.setEditable(false); jFormattedTextField5.setEditable(false); jButtonSelectPartition.addActionListener(new MainFrame_jButtonSelectPartition_actionAdapter(this)); jFormattedTextField6.setEnabled(false); jFTextH.setForeground(Color.blue); jFTextH.setEditable(false); jFTextCPP.setForeground(Color.blue); jFTextCPP.setEditable(false); jLabel6.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabel6.setToolTipText(""); jLabel6.setHorizontalAlignment(SwingConstants.LEFT); jLabel6.setText(" (.cpp)"); jButtonSelectEvent.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectEvent.setText("Select"); jButtonSelectEvent.addActionListener(new MainFrame_jButtonSelectEvent_actionAdapter(this)); jButtonSetEvent.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jButtonSetEvent.setText("Set"); jButtonSetEvent.addActionListener(new MainFrame_jButtonSetEvent_actionAdapter(this)); jButtonSelectSupport.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectSupport.setText("Select"); jButtonSelectSupport.addActionListener(new MainFrame_jButtonSelectSupport_actionAdapter(this)); jButtonSetSupport.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSetSupport.setText("Set"); jButtonSetSupport.addActionListener(new MainFrame_jButtonSetSupport_actionAdapter(this)); jButtonSelectH.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectH.setText("Select"); jButtonSelectH.addActionListener(new MainFrame_jButtonSelectH_actionAdapter(this)); jButtonSetDEVS.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSetDEVS.setText("Set"); jButtonSetDEVS.addActionListener(new MainFrame_jButtonSetDEVS_actionAdapter(this)); jButtonSelectCPP.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectCPP.setText("Select"); jButtonSelectCPP.addActionListener(new MainFrame_jButtonSelectCPP_actionAdapter(this)); jLabelSessionID.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabelSessionID.setForeground(Color.blue); jLabelSessionID.setBorder(titledBorder4); jLabelSessionID.setToolTipText(""); jLabelSessionID.setHorizontalAlignment(SwingConstants.CENTER); jLabelSessionID.setText(" "); jButtonRetrieveSessionLog.setBorder(BorderFactory.createEtchedBorder()); jButtonRetrieveSessionLog.setToolTipText("Retrieve Session Log"); jButtonRetrieveSessionLog.setIcon(new ImageIcon(cl.getResource("images/sessionLog.gif"))); jButtonRetrieveSessionLog.addActionListener(new MainFrame_jButtonRetrieveSessionLog_actionAdapter(this)); jButtonLogoff.addActionListener(new MainFrame_jButtonLogoff_actionAdapter(this)); jButtonRetrieveParsingInfo.setBorder(BorderFactory.createEtchedBorder()); jButtonRetrieveParsingInfo.setToolTipText("Retrieve Parsing Info. File"); jButtonRetrieveParsingInfo.setIcon(new ImageIcon( cl.getResource("images/parsing.gif"))); jButtonRetrieveParsingInfo.addActionListener(new MainFrame_jButtonRetrieveParsingInfo_actionAdapter(this)); jButtonExit.setBorder(BorderFactory.createEtchedBorder()); jButtonExit.setToolTipText("Exit"); jButtonExit.setIcon(new ImageIcon(cl.getResource("images/exit.gif"))); jButtonExit.addActionListener(new MainFrame_jButtonExit_actionAdapter(this)); jButtonLogin.addActionListener(new MainFrame_jButtonLogin_actionAdapter(this)); jButtonStop.setBorder(BorderFactory.createEtchedBorder()); jButtonStop.setToolTipText("Stop Simulation"); jButtonStop.setIcon(new ImageIcon(cl.getResource("images/stop.gif"))); jButtonStop.addActionListener(new MainFrame_jButtonStop_actionAdapter(this)); jButtonStart.setBorder(BorderFactory.createEtchedBorder()); jButtonStart.setToolTipText("Start Simulation"); jButtonStart.setIcon(new ImageIcon(cl.getResource("images/start.gif"))); jButtonStart.addActionListener(new MainFrame_jButtonStart_actionAdapter(this)); jProgressBar1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jProgressBar1.setForeground(Color.blue); jTextInterval.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jTextInterval.setForeground(Color.blue); jTextInterval.setText("500"); jCheckBoxSimTime.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jCheckBoxSimTime.setText("Set Execution Time"); jCheckBoxSimTime.addActionListener(new MainFrame_jCheckBoxSimTime_actionAdapter(this)); jCheckBoxParsing.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jCheckBoxParsing.setText("Generate Parsing Info."); jTextSimTime.setEnabled(false); jTextSimTime.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jTextSimTime.setForeground(Color.blue); jButtonLogin.setBorder(BorderFactory.createEtchedBorder()); jButtonRetrieveLog.setBorder(BorderFactory.createEtchedBorder()); jButtonRetrieveLog.addActionListener(new MainFrame_jButtonRetrieveLog_actionAdapter(this)); jButtonLogoff.setBorder(BorderFactory.createEtchedBorder()); jTable1.setPreferredScrollableViewportSize(new Dimension(200,40)); jTable1.addFocusListener(new MainFrame_jTable1_focusAdapter(this)); // jTable1.setEnabled(false); jTable1.setForeground(Color.blue); jTable1.setBorder(BorderFactory.createEtchedBorder()); TableColumn column = jTable1.getColumnModel().getColumn(1); column.setPreferredWidth(200); column.setResizable(false); column = jTable1.getColumnModel().getColumn(2); column.setPreferredWidth(200); column.setResizable(false); column = jTable1.getColumnModel().getColumn(0); column.setResizable(false); jScrollPane1.setBorder(titledBorder5); jButtonUsers.addActionListener(new MainFrame_jButtonUsers_actionAdapter(this)); jButtonUsers.setBorder(BorderFactory.createEtchedBorder()); jButtonUsers.setIcon(new ImageIcon (cl.getResource("images/users.gif"))); jButtonOutput.setBorder(BorderFactory.createEtchedBorder()); jButtonOutput.setToolTipText("Retrieve Output File"); jButtonOutput.setIcon(new ImageIcon(cl.getResource("images/output.gif"))); jButtonOutput.addActionListener(new MainFrame_jButtonOutput_actionAdapter(this)); jMenuBar1.add(jMenuFile); jMenuFile.add(jMenuFileExit); jMenuBar1.add(jMenuHelp); jMenuHelp.add(jMenuHelpAbout); setJMenuBar(jMenuBar1); jButtonLogin.setIcon(new ImageIcon(cl.getResource("images/login.gif"))); jButtonLogin.setToolTipText("Log On"); jButtonLogoff.setIcon(new ImageIcon(cl.getResource("images/logoff.gif"))); jButtonLogoff.setToolTipText("Log Off"); jButtonRetrieveLog.setIcon(new ImageIcon(cl.getResource("images/log.gif"))); jButtonRetrieveLog.setToolTipText("Retrieve Log Archive"); jToolBar.add(jButtonLogin); jToolBar.add(jButtonUsers); jToolBar.add(jButtonStart); jToolBar.add(jButtonStop); jToolBar.add(jButtonRetrieveLog); jToolBar.add(jButtonOutput); jToolBar.add(jButtonRetrieveSessionLog); jToolBar.add(jButtonRetrieveParsingInfo); jToolBar.add(jButtonRetrieveTmp); jToolBar.add(jButtonLogoff); jToolBar.add(jButtonExit); contentPane.add(jPanel1, java.awt.BorderLayout.CENTER); jPanel2.add(jLabel2, new XYConstraints(13, 109, -1, -1)); buttonGroup1.add(jRBDistributed); buttonGroup1.add(jRBParallel); jPanel3.add(jLabelMA, new XYConstraints(9, 11, -1, -1)); jPanel3.add(jLabelGC, new XYConstraints(8, 38, -1, -1)); jPanel3.add(jLabelPartition, new XYConstraints(7, 63, -1, -1)); jPanel2.add(jComboServiceAddress, new XYConstraints(105, 105, 422, 23)); jFTextMA.add(jFormattedTextField3); contentPane.add(jToolBar, java.awt.BorderLayout.NORTH); jPanel1.add(jPanel3, new XYConstraints(4, 145, 546, 102)); jPanel4.add(jLabel5, new XYConstraints(6, 74, -1, -1)); jPanel4.add(jLabel3, new XYConstraints(7, 15, 67, -1)); jPanel4.add(jLabel4, new XYConstraints(5, 46, -1, -1)); jFTextSupport.add(jFormattedTextField5); jFTextSupport.add(jFormattedTextField6); contentPane.add(statusBar, java.awt.BorderLayout.SOUTH); jPanel3.add(jButtonSetMA, new XYConstraints(472, 10, 64, -1)); jPanel3.add(jFTextGC, new XYConstraints(100, 39, 296, 22)); jPanel3.add(jFTextMA, new XYConstraints(100, 11, 296, 22)); jPanel3.add(jButtonSetGC, new XYConstraints(472, 38, 64, -1)); jPanel3.add(jButtonSelectPartition, new XYConstraints(400, 65, -1, 24)); jPanel3.add(jButtonSetPartition, new XYConstraints(472, 65, 64, 24)); jPanel4.add(jLabel6, new XYConstraints(6, 101, 89, -1)); jPanel4.add(jButtonSelectSupport, new XYConstraints(400, 42, -1, 26)); jPanel4.add(jButtonSetEvent, new XYConstraints(471, 14, 64, 25)); jPanel4.add(jButtonSelectH, new XYConstraints(400, 70, -1, 26)); jPanel4.add(jButtonSelectCPP, new XYConstraints(400, 97, -1, 26)); jPanel4.add(jButtonSelectEvent, new XYConstraints(400, 14, -1, -1)); jPanel4.add(jFTextSupport, new XYConstraints(101, 44, 295, 21)); jPanel4.add(jFTextH, new XYConstraints(101, 72, 295, 21)); jPanel4.add(jFTextCPP, new XYConstraints(101, 100, 295, 21)); jPanel4.add(jButtonSetDEVS, new XYConstraints(471, 70, 64, 53)); jPanel3.add(jButtonSelectGC, new XYConstraints(400, 38, -1, -1)); jPanel3.add(jButtonSelectMA, new XYConstraints(400, 10, -1, -1)); jPanel3.add(jFTextPartition, new XYConstraints(100, 67, 295, -1)); jPanel4.add(jButtonSetSupport, new XYConstraints(471, 42, 64, 26)); jScrollPane1.getViewport().add(jTable1); jPanel1.add(jPanel2, new XYConstraints(0, 2, 550, 142)); jPanel1.add(jPanel4, new XYConstraints(4, 249, 546, 335)); jPanel4.add(jScrollPane1, new XYConstraints(5, 125, 531, 86)); jPanel4.add(jFTextEvent, new XYConstraints(101, 14, 296, 22)); jPanel5.add(jCheckBoxParsing, new XYConstraints(0, 0, 204, -1)); jPanel5.add(jCheckBoxSimTime, new XYConstraints(0, 27, -1, -1)); jPanel5.add(jLabel1, new XYConstraints(6, 52, 136, 22)); jPanel5.add(jTextInterval, new XYConstraints(144, 52, 51, 22)); jPanel5.add(jProgressBar1, new XYConstraints(197, 51, 175, 23)); jPanel6.add(jRBDistributed, new XYConstraints(3, 5, 130, 22)); jPanel6.add(jRBParallel, new XYConstraints(3, 31, 101, 27)); jPanel2.add(jPanel5, new XYConstraints(153, 9, 387, 91)); jPanel2.add(jPanel6, new XYConstraints(2, 2, 144, 100)); jPanel5.add(jTextSimTime, new XYConstraints(145, 28, 138, -1)); jPanel5.add(jLabelSessionID, new XYConstraints(289, 2, 83, 47)); // // jFTextInc.setForeground(Color.blue); jFTextInc.setEditable(false); jLabelInc.setFont(new java.awt.Font("Dialog", Font.BOLD, 12)); jLabelInc.setText("Inlude Files (.inc)"); jPanel4.add(jLabelInc, new XYConstraints(7, 220, 67, -1)); jFTextInc.setForeground(Color.blue); jFTextInc.setEditable(false); jFTextInc.setText(""); jPanel4.add(jFTextInc, new XYConstraints(101, 220, 296, 22)); jButtonSelectInc.setFont(new java.awt.Font("Dialog", Font.BOLD, 11)); jButtonSelectInc.setText("Select"); jButtonSelectInc.addActionListener(new MainFrame_jButtonSelectInc_actionAdapter(this)); jPanel4.add(jButtonSelectInc, new XYConstraints(400, 220, -1, -1)); jButtonSetInc.setFont(new java.awt.Font("Tahoma", Font.BOLD, 11)); jButtonSetInc.setText("Set"); jButtonSetInc.addActionListener(new MainFrame_jButtonSetInc_actionAdapter(this)); jPanel4.add(jButtonSetInc, new XYConstraints(471, 220, 64, 25)); jTableInc.setPreferredScrollableViewportSize(new Dimension(200,40)); jTableInc.addFocusListener(new MainFrame_jTable1_focusAdapter(this)); jTableInc.setForeground(Color.blue); jTableInc.setBorder(BorderFactory.createEtchedBorder()); TableColumn columnInc = jTableInc.getColumnModel().getColumn(0); columnInc.setResizable(false); titledBorderInc = new TitledBorder(BorderFactory.createLineBorder(Color. white, 2), "Include Files"); jScrollPaneInc.setBorder(titledBorderInc); jScrollPaneInc.getViewport().add(jTableInc); jPanel4.add(jScrollPaneInc, new XYConstraints(5, 245, 531, 86)); // // // // jButtonRetrieveTmp.setToolTipText("Retrieve Temporary MA file"); jButtonRetrieveTmp.setIcon(new ImageIcon(cl.getResource("images/tmp.gif"))); jButtonRetrieveTmp.setBorder(BorderFactory.createEtchedBorder()); jButtonRetrieveTmp.addActionListener(new MainFrame_jButtonRetrieveTmp_actionAdapter(this)); // // // The default service addresses that can be used by the client //TODO Remove it : list of server adresses String[] serverAddresses = new String[] { "http://deepthought.sce.carleton.ca:8080/axis/services/CDppPortType", "http://deepthought.sce.carleton.ca:8080/axis/services/PCDppPortType" }; for ( int i =0 ; i < serverAddresses.length; i++) { jComboServiceAddress.addItem(serverAddresses[i]); } } /** * File | Exit action performed. * * @param actionEvent ActionEvent */ void jMenuFileExit_actionPerformed(ActionEvent actionEvent) { System.exit(0); } /** * Help | About action performed. * * @param actionEvent ActionEvent */ void jMenuHelpAbout_actionPerformed(ActionEvent actionEvent) { MainFrame_AboutBox dlg = new MainFrame_AboutBox(this); Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); dlg.setModal(true); dlg.pack(); dlg.show(); } // This functions sets/enables/disable different parameters when the user selects the // DISTRIBUTED mode public void jRBDistributed_actionPerformed(ActionEvent e) { jButtonSelectGC.setEnabled(true); jButtonSetGC.setEnabled(true); jButtonSelectPartition.setEnabled(false); jButtonSetPartition.setEnabled(false); jButtonSelectH.setEnabled(true); jButtonSelectCPP.setEnabled(true); jButtonSetDEVS.setEnabled(true); jComboServiceAddress.setSelectedIndex(0); mode = MODE_DISTRIBUTED; } // This functions sets/enables/disable different parameters when the user selects the // PARALLEL mode public void jRBParallel_actionPerformed(ActionEvent e) { jButtonSelectGC.setEnabled(false); jButtonSetGC.setEnabled(false); jButtonSelectPartition.setEnabled(true); jButtonSetPartition.setEnabled(true); jButtonSelectH.setEnabled(false); jButtonSelectCPP.setEnabled(false); jButtonSetDEVS.setEnabled(false); jComboServiceAddress.setSelectedIndex(1); mode = MODE_PARALLEL; } // Allows the user to select the MA file to be sent to the simulator public void jButtonSelectMA_actionPerformed(ActionEvent e) { fileFilter.setDescription("MA files"); fileFilter.addExtension(".ma"); jFileChooser1.setDialogTitle("MA File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if ( returnValue == JFileChooser.APPROVE_OPTION) { jFTextMA.setText(jFileChooser1.getSelectedFile().getPath()); maFileName = jFileChooser1.getSelectedFile().getPath(); } fileFilter.clear(); } // TODO Addition of the jButtonSelectInc_actionPerformed method // Allows the user to select the Include file to be sent to the simulator public void jButtonSelectInc_actionPerformed(ActionEvent e) { fileFilter.setDescription("includes files"); fileFilter.addExtension(".inc"); jFileChooser1.setDialogTitle("Include File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if ( returnValue == JFileChooser.APPROVE_OPTION) { jFTextInc.setText(jFileChooser1.getSelectedFile().getPath()); incFileName = jFileChooser1.getSelectedFile().getPath(); } fileFilter.clear(); } // Allows the user to select the grid configuration file to be sent to the simulator public void jButtonSelectGC_actionPerformed(ActionEvent e) { fileFilter.setDescription("Grid confg file"); fileFilter.addExtension(".xml"); jFileChooser1.setDialogTitle("Grid Configuration File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if(returnValue == JFileChooser.APPROVE_OPTION) { jFTextGC.setText(jFileChooser1.getSelectedFile().getPath()); gcFileName = jFileChooser1.getSelectedFile().getPath(); } fileFilter.clear(); } // Allows the user to select the partition file to be sent to the simulator public void jButtonSelectPartition_actionPerformed(ActionEvent e) { jFileChooser1.setDialogTitle("Partiton File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if( returnValue == JFileChooser.APPROVE_OPTION) { jFTextPartition.setText(jFileChooser1.getSelectedFile().getPath()); partitionFileName = jFileChooser1.getSelectedFile().getPath(); } } // Allows the user to select the event file to be sent to the simulator public void jButtonSelectEvent_actionPerformed(ActionEvent e) { fileFilter.setDescription("Event file"); fileFilter.addExtension(".ev"); jFileChooser1.setDialogTitle("Event File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if( returnValue == JFileChooser.APPROVE_OPTION) { jFTextEvent.setText(jFileChooser1.getSelectedFile().getPath()); eventFileName = jFileChooser1.getSelectedFile().getPath(); System.out.println("The selected event file is : " + eventFileName); } fileFilter.clear(); } // Allows the user to select the initiali values file to be sent to the simulator public void jButtonSelectSupport_actionPerformed(ActionEvent e) { jFileChooser1.setDialogTitle("Support File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if( returnValue == JFileChooser.APPROVE_OPTION) { jFTextSupport.setText(jFileChooser1.getSelectedFile().getPath()); supportFileName = jFileChooser1.getSelectedFile().getPath(); } } // Allows the user to select a header file for a DEVS model (used for DCD++ only) public void jButtonSelectH_actionPerformed(ActionEvent e) { fileFilter.setDescription("Header files"); fileFilter.addExtension(".hpp"); fileFilter.addExtension(".h"); fileFilter.addExtension(".h++"); jFileChooser1.setDialogTitle("DEVS Header File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if( returnValue == JFileChooser.APPROVE_OPTION) { jFTextH.setText(jFileChooser1.getSelectedFile().getPath()); devsHFileName = jFileChooser1.getSelectedFile().getPath(); } fileFilter.clear(); } // Allows the user to select a cpp file for a DEVS file (used for DCD++ only) public void jButtonSelectCPP_actionPerformed(ActionEvent e) { fileFilter.setDescription("C++ files"); fileFilter.addExtension(".cpp"); fileFilter.addExtension(".c"); fileFilter.addExtension(".c++"); jFileChooser1.setDialogTitle("DESV CPP File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); int returnValue = jFileChooser1.showOpenDialog(this); if( returnValue == JFileChooser.APPROVE_OPTION) { jFTextCPP.setText(jFileChooser1.getSelectedFile().getPath()); devsCPPFileName = jFileChooser1.getSelectedFile().getPath(); statusBar.setText("DEVS CPP file was selected..."); } fileFilter.clear(); } // Sends the header and cpp files of a DEVS model public void jButtonSetDEVS_actionPerformed(ActionEvent e) { if ( isLoggedOn == false){ JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( ( devsHFileName == null ) || (devsCPPFileName == null) ){ if (devsHFileName == null && devsCPPFileName == null) JOptionPane.showMessageDialog(this,"Please select the H & CPP files first", "H & CPP Files Not Selected",JOptionPane.ERROR_MESSAGE); else if (devsHFileName != null && devsCPPFileName == null) JOptionPane.showMessageDialog(this,"Please select the CPP file first", "CPP File Not Selected",JOptionPane.ERROR_MESSAGE); else if (devsHFileName == null && devsCPPFileName != null) JOptionPane.showMessageDialog(this,"Please select the H file first", "H File Not Selected",JOptionPane.ERROR_MESSAGE); } else { String hShortName, cppShortName; if(fileSeparator != null) { hShortName = devsHFileName.substring( devsHFileName.lastIndexOf(fileSeparator)+1); cppShortName = devsCPPFileName.substring(devsCPPFileName.lastIndexOf(fileSeparator)+1); }else { hShortName = devsHFileName.substring( devsHFileName.lastIndexOf("\\")+1); cppShortName = devsCPPFileName.substring(devsCPPFileName.lastIndexOf("\\")+1); } File hFile, cppFile ; hFile = new File(devsHFileName); cppFile = new File(devsCPPFileName); DataHandler dhHFile,dhCPPFile; dhHFile = new DataHandler(new FileDataSource(hFile)); dhCPPFile = new DataHandler(new FileDataSource(cppFile)); try { statusBar.setText(cdppPortType.setDEVSModel (sessionID,cppShortName,dhCPPFile, hShortName,dhHFile)); isDEVSModelSet = true; // Updates the table to include the set DEVS model files if ( tableIndex < 10 ) { tableData[tableIndex][0] = hShortName.substring(0,hShortName.lastIndexOf(".") ); tableData[tableIndex][1] = devsHFileName; tableData[tableIndex][2] = devsCPPFileName; tableIndex++; jTable1.repaint(); } } catch (Exception excep) { excep.printStackTrace(); } } } // Logs off the simulation session when the user closes the main client window public void this_windowClosing(WindowEvent e) { if (authenticateFrame != null ) { authenticateFrame.setVisible(false); authenticateFrame.dispose(); if(isLoggedOn) { try { switch(mode) { case MODE_DISTRIBUTED: cdppPortType.logOff(sessionID); break; case MODE_PARALLEL: pcdppPortType.logOff(sessionID); break; } } catch (Exception excep) { excep.printStackTrace(); } } } } // Send the MA file to the simulation service public void jButtonSetMA_actionPerformed(ActionEvent e) { if ( isLoggedOn == false){ JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( maFileName == null) { JOptionPane.showMessageDialog(this,"Please select the MA file first.","MA File Not Selected", JOptionPane.ERROR_MESSAGE); } else { String maShortName = null; if(fileSeparator != null) { maShortName = maFileName.substring(maFileName.lastIndexOf(fileSeparator) + 1); }else { maShortName = maFileName.substring(maFileName.lastIndexOf("\\") + 1); } File maFile = new File(maFileName); DataHandler maDataHandler = new DataHandler(new FileDataSource(maFile)); try { switch(mode){ case MODE_DISTRIBUTED: statusBar.setText( cdppPortType.setMAFile(sessionID, maShortName, maDataHandler) ); break; case MODE_PARALLEL: statusBar.setText( pcdppPortType.setMAFile(sessionID, maShortName, maDataHandler) ); break; } isMAFileSet = true; }catch (Exception excep) { excep.printStackTrace(); } } } // TODO Addition of the method jButtonSetInclude_actionPerformed // Send the INCLUDE file to the simulation service public void jButtonSetInc_actionPerformed(ActionEvent e) { if ( isLoggedOn == false){ JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( incFileName == null ){ JOptionPane.showMessageDialog(this,"Please select the include file first", "Include file Not Selected",JOptionPane.ERROR_MESSAGE); } else { String incShortName = null; if(fileSeparator != null) { incShortName = incFileName.substring(incFileName.lastIndexOf(fileSeparator) + 1); }else { incShortName = incFileName.substring(incFileName.lastIndexOf("\\") + 1); } File incFile = new File(incFileName); DataHandler incDataHandler = new DataHandler(new FileDataSource(incFile)); try { switch(mode){ case MODE_DISTRIBUTED: statusBar.setText( cdppPortType.setIncludeFile(sessionID, incShortName, incDataHandler) ); break; case MODE_PARALLEL: statusBar.setText( pcdppPortType.setIncludeFile(sessionID, incShortName, incDataHandler) ); break; } isIncFileSet = true; // Updates the table to include the include file(s) if ( tableIndexInc < 10 ) { tableDataInc[tableIndexInc][0] = incShortName.substring(0,incShortName.lastIndexOf(".") ); tableIndexInc++; jTableInc.repaint(); } }catch (Exception excep) { excep.printStackTrace(); } } } // Sends the grid config. file to the simulation service public void jButtonSetGC_actionPerformed(ActionEvent e) { if ( isLoggedOn == false){ JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else if (gcFileName == null) { JOptionPane.showMessageDialog(this,"Please select the G.C. file first.","GC File Not Selected", JOptionPane.ERROR_MESSAGE); } else { String gcShortName = null; if(fileSeparator != null) { gcShortName = gcFileName.substring(gcFileName.lastIndexOf(fileSeparator) + 1); }else { gcShortName = gcFileName.substring(gcFileName.lastIndexOf("\\") + 1); } File gcFile = new File(gcFileName); DataHandler dhGCFile = new DataHandler(new FileDataSource(gcFile)); try { switch(mode) { case MODE_DISTRIBUTED: statusBar.setText(cdppPortType.setGridConfigFile(sessionID,gcShortName, dhGCFile)); break; case MODE_PARALLEL: statusBar.setText(pcdppPortType.setGridConfigFile(sessionID,gcShortName, dhGCFile)); break; } isGCFileSet = true; }catch (Exception excep) { excep.printStackTrace(); } } } // Sends the partition file to the simulation service public void jButtonSetPartition_actionPerformed(ActionEvent e) { if ( isLoggedOn == false){ JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( partitionFileName == null) { JOptionPane.showMessageDialog(this,"Please select the Partition file first.", "Partition File Not Selected",JOptionPane.ERROR_MESSAGE); }else { String partitionShortName = null; if (fileSeparator != null ) { partitionShortName = partitionFileName.substring(partitionFileName.lastIndexOf(fileSeparator)+1); }else { partitionShortName = partitionFileName.substring(partitionFileName.lastIndexOf("\\")+1); } File partitionFile = new File(partitionFileName); DataHandler dhPartitionFile = new DataHandler(new FileDataSource(partitionFile)); try { statusBar.setText( pcdppPortType.setPartitionFile(sessionID, partitionShortName,dhPartitionFile) ); isPartitionFileSet = true; } catch(Exception excep) { excep.printStackTrace(); } } } // Sends the event file to the simulation service public void jButtonSetEvent_actionPerformed(ActionEvent e) { if ( isLoggedOn == false){ JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( eventFileName == null) { JOptionPane.showMessageDialog(this,"Please select the Event file first", "Event File Not Selected",JOptionPane.ERROR_MESSAGE); } else { String eventShortName = null; if ( fileSeparator != null ) { eventShortName = eventFileName.substring(eventFileName.lastIndexOf(fileSeparator) + 1); }else{ eventShortName = eventFileName.substring(eventFileName.lastIndexOf("\\") + 1); } File eventFile = new File(eventFileName); DataHandler dhEventFile =new DataHandler(new FileDataSource(eventFile)); try { switch(mode) { case MODE_DISTRIBUTED: statusBar.setText(cdppPortType.setEventFile(sessionID,eventShortName, dhEventFile)); break; case MODE_PARALLEL: statusBar.setText(pcdppPortType.setEventFile(sessionID,eventShortName, dhEventFile)); break; } isEventFileSet = true; } catch (Exception excep) { excep.printStackTrace(); } } } // Sends the intial value file to the simulation service public void jButtonSetSupport_actionPerformed(ActionEvent e) { if ( isLoggedOn == false){ JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else if (supportFileName == null) { JOptionPane.showMessageDialog(this, "Please select the Support file first", "Support File Not Selected",JOptionPane.ERROR_MESSAGE); } else { String supportShortName = null; if(fileSeparator != null ) { supportShortName = supportFileName.substring(supportFileName.lastIndexOf(fileSeparator) + 1); }else { supportShortName = supportFileName.substring(supportFileName.lastIndexOf("\\") + 1); } File supportFile = new File(supportFileName); DataHandler dhSupportFile = new DataHandler(new FileDataSource(supportFile)); try { switch(mode) { case MODE_DISTRIBUTED: statusBar.setText(cdppPortType.setSupportFile(sessionID, supportShortName,dhSupportFile)); break; case MODE_PARALLEL: statusBar.setText(pcdppPortType.setSupportFile(sessionID, supportShortName,dhSupportFile)); break; } isSupportFileSet = true; } catch (Exception excep) { excep.printStackTrace(); } } } // Logs off the current simulation sessions public void jButtonLogoff_actionPerformed(ActionEvent e) { if (isLoggedOn) { try { switch(mode) { case MODE_DISTRIBUTED: if(cdppPortType != null) { cdppPortType.logOff(sessionID); } break; case MODE_PARALLEL: if(pcdppPortType != null) { pcdppPortType.logOff(sessionID); } break; } sessionID = -1; jLabelSessionID.setText(" "); isLoggedOn = false; } catch (Exception excep) { excep.printStackTrace(); } } else { JOptionPane.showMessageDialog(this, "You are NOT logged on !", "Error",JOptionPane.ERROR_MESSAGE); } } // When the use closed the main window public void jButtonExit_actionPerformed(ActionEvent e) { System.exit(0); } // Contact the user tried to login: // 1) the login window is shown to the user // 2) the service stubs classes are initialized public void jButtonLogin_actionPerformed(ActionEvent e) { if (isLoggedOn == false) { serviceAddress = jComboServiceAddress.getSelectedItem().toString(); authenticateFrame = new AuthenticateFrame(this, serviceAddress); switch ( mode) { case MODE_DISTRIBUTED: cdppService = new CDppPortTypeServiceLocator(); try { cdppPortType = cdppService.getCDppPortType(new URL(serviceAddress)); } catch (Exception excep){ excep.printStackTrace(); } break; case MODE_PARALLEL: pcdppService = new PCDppPortTypeServiceLocator(); try{ pcdppPortType = pcdppService.getPCDppPortType(new URL(serviceAddress)); }catch (Exception excep) { excep.printStackTrace(); } break; } } else { JOptionPane.showMessageDialog(this,"You already logged on, you need to log off first.", "Error", JOptionPane.ERROR_MESSAGE); } } // Starts the simulation session: // 1) sets the parsing info option // 2) sets the execution time // 3) sets the number of nodes to be used in the simulation (only for PCD++) // 4) starts the simulation public void jButtonStart_actionPerformed(ActionEvent e) { if(isLoggedOn == false) { JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); }else if ( (mode==MODE_DISTRIBUTED) && (!isMAFileSet || !isGCFileSet ) ) { JOptionPane.showMessageDialog(this, "You need to set the MA and Grid Configuration files before starting the simulation!", "Error", JOptionPane.ERROR_MESSAGE); } else if ( (mode==MODE_PARALLEL) && ( !isMAFileSet || !isPartitionFileSet ) ) { JOptionPane.showMessageDialog(this, "You need to set the MA and Partition files before starting the simulation!", "Error", JOptionPane.ERROR_MESSAGE); } else { try { if(jCheckBoxParsing.isSelected()== true ) { System.out.println("Parsing info. is going to be set"); switch(mode){ case MODE_DISTRIBUTED: cdppPortType.enableParsingInfo(sessionID); break; case MODE_PARALLEL: pcdppPortType.enableParsingInfo(sessionID); break; } } if( jCheckBoxSimTime.isSelected() == true) { System.out.println("The execution time is going to be set"); switch(mode) { case MODE_DISTRIBUTED: cdppPortType.setExecutionTime(sessionID, jTextSimTime.getText()); break; case MODE_PARALLEL: pcdppPortType.setExecutionTime(sessionID, jTextSimTime.getText()); break; } } switch(mode) { case MODE_DISTRIBUTED: statusBar.setText(cdppPortType.startSimulationService(sessionID)); simulationStatus = cdppPortType.getStatus(sessionID); break; case MODE_PARALLEL: numberOfNodes=Integer.parseInt(JOptionPane.showInputDialog(this,"Enter the number of nodes to be used, plese.", "Number of Nodes",JOptionPane.INFORMATION_MESSAGE)); statusBar.setText(pcdppPortType.setNumberOfNodes(sessionID, numberOfNodes)); statusBar.setText(pcdppPortType.startSimulationService(sessionID)); simulationStatus = pcdppPortType.getStatus(sessionID); break; } jProgressBar1.setIndeterminate(true); if(simulationStatus.equals("COMPILING")){ jProgressBar1.setString("The code is being compiled"); } else if ( simulationStatus.equals("RUNNING")) { jProgressBar1.setString("The Simulation is running"); } jProgressBar1.setStringPainted(true); statusTimer = new Timer( Integer.parseInt(jTextInterval.getText() ), new StatusMonitor()); statusTimer.start(); }catch (Exception excep) { excep.printStackTrace(); } } } // Alows the user to stop the simulation public void jButtonStop_actionPerformed(ActionEvent e) { if (!isLoggedOn) { JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); }else if ( !simulationStarted){ JOptionPane.showMessageDialog(this, "The simulation did NOT start yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( simulationStarted && simulationRunning) { JOptionPane.showMessageDialog(this, "The simulation is still running.", "Error", JOptionPane.ERROR_MESSAGE); }else if (simulationStarted && !simulationRunning) { try { switch(mode) { case MODE_DISTRIBUTED: cdppPortType.killSimulation(sessionID); break; case MODE_PARALLEL: pcdppPortType.killSimulation(sessionID); break; } statusTimer.stop(); statusBar.setText("The simulation has been killed!"); jProgressBar1.setEnabled(false); jProgressBar1.setIndeterminate(false); jProgressBar1.setString("The simulation has been killed"); } catch (Exception excep){ excep.printStackTrace(); } } } // Retrieved the session log file (contains the output messages/warnings generated // by the simulator while running public void jButtonRetrieveSessionLog_actionPerformed(ActionEvent e) { if( !isLoggedOn ) { JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else { if (isExsistingSession()) { retrieveSessionLog(); } else { if (simulationStatus.equals("IDLE")) { JOptionPane.showMessageDialog(this, "The simulation did NOT start yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("RUNNING")) { JOptionPane.showMessageDialog(this, "The simulation did NOT finish yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("DONE")) { retrieveSessionLog(); } } } } // Retrieves the parsing info file (used for debugging Cell-DEVS models) public void jButtonRetrieveParsingInfo_actionPerformed(ActionEvent e) { if( !isLoggedOn ) { JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else { if ( isExsistingSession ) { retrieveParsingInfoLog(); }else { if ( simulationStatus.equals("IDLE")) { JOptionPane.showMessageDialog(this, "The simulation did NOT start yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("RUNNING")) { JOptionPane.showMessageDialog(this, "The simulation did NOT finish yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("DONE")) { retrieveParsingInfoLog(); } } } } // Enables the execution time to be set by the user public void jCheckBoxSimTime_actionPerformed(ActionEvent e) { if(jCheckBoxSimTime.isSelected()) { jTextSimTime.setEnabled(true); }else{ jTextSimTime.setEnabled(false); } } // Refreshes the list of DEVS mode files sent to the simulation service public void jTable1_focusLost(FocusEvent e) { jTable1.repaint(); } // Refreshes the list of INC mode files sent to the simulation service public void jTableInc_focusLost(FocusEvent e) { jTableInc.repaint(); } // Shows the user management window public void jButtonUsers_actionPerformed(ActionEvent e) { if (userFrame == null ) { userFrame = new UserFrame(this, this.serviceAddress, this.sessionID); } else { userFrame.setVisible(true); } } // Retrieves the output file generated by the simulation service public void jButtonOutput_actionPerformed(ActionEvent e) { if( !isLoggedOn ) { JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else { if( isExsistingSession() ) { retrieveOutputFile(); }else { if (simulationStatus.equals("IDLE")) { JOptionPane.showMessageDialog(this, "The simulation did NOT start yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("RUNNING")) { JOptionPane.showMessageDialog(this, "The simulation did NOT finish yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("DONE")){ retrieveOutputFile(); } } } } // Retrieves the log file generated by the simulation service (used for animating the simulation results) public void jButtonRetrieveLog_actionPerformed(ActionEvent e) { if( !isLoggedOn ) { JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else { if( isExsistingSession() ) { retrieveLogArchive(); } else { if(simulationStatus.equals("IDLE")) { JOptionPane.showMessageDialog(this, "The simulation did NOT start yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( simulationStatus.equals("RUNNING") ) { JOptionPane.showMessageDialog(this, "The simulation did NOT finish yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("DONE")) { retrieveLogArchive(); } } } } //TODO Addition of the jButtonRetrieveTmp_actionPerformed method // Retrieves the temporary MA file generated by the simulation service (usefull when .inc files are sent on server) public void jButtonRetrieveTmp_actionPerformed(ActionEvent e) { if( !isLoggedOn ) { JOptionPane.showMessageDialog(this, "Please log in before performing this step.", "Error", JOptionPane.ERROR_MESSAGE); } else { if( isExsistingSession() ) { retrieveTmpFile(); } else { if(simulationStatus.equals("IDLE")) { JOptionPane.showMessageDialog(this, "The simulation did NOT start yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if ( simulationStatus.equals("RUNNING") ) { JOptionPane.showMessageDialog(this, "The simulation did NOT finish yet.", "Error", JOptionPane.ERROR_MESSAGE); } else if (simulationStatus.equals("DONE")) { retrieveTmpFile(); } } } } // The function that is used for actually retrieving the log file(s) generated by the // simulation service private void retrieveLogArchive() { jFileChooser1.setDialogTitle("Log Archive"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); if (jFileChooser1.showSaveDialog(this) == JFileChooser.APPROVE_OPTION){ savedLogFileName = jFileChooser1.getSelectedFile().getPath(); System.out.println("the chosen file name is : "+ savedLogFileName); SaveMonitor saveMonitor = null; switch(mode){ case MODE_DISTRIBUTED: saveMonitor = new SaveMonitor(sessionID, savedLogFileName, cdppPortType); break; case MODE_PARALLEL: saveMonitor = new SaveMonitor(sessionID, savedLogFileName, pcdppPortType); break; } saveMonitor.pack(); saveMonitor.setVisible(true); } } // TODO Addition of the retrieveTmpFile method // The function that is used for actually retrieving the temp file generated by the // simulation service private void retrieveTmpFile() { jFileChooser1.setDialogTitle("Temporary MA file"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); if (jFileChooser1.showSaveDialog(this) ==JFileChooser.APPROVE_OPTION) { savedTmpFileName = jFileChooser1.getSelectedFile().getPath(); DataHandler dhReceivedTmpFile = null; try { switch(mode) { case MODE_DISTRIBUTED: dhReceivedTmpFile = cdppPortType.retrieveTmpFile(sessionID); break; //TODO The retrieveTmpFile methode must be implemented for parallel mode /* case MODE_PARALLEL: dhReceivedOutputFile = pcdppPortType.retrieveOutputFile(sessionID); break;*/ } File receivedTmpFile = new File( dhReceivedTmpFile.getName()); if (receivedTmpFile.exists()) { File savedTmpFile = new File( savedTmpFileName); BufferedReader in = new BufferedReader(new FileReader( receivedTmpFile )); BufferedWriter out = new BufferedWriter(new FileWriter( savedTmpFile)); int c = -1; while ((c = in.read()) != -1) { out.write((char) c); } in.close(); out.close(); statusBar.setText("The temporary MA file was retrieved successfully!"); } } catch (Exception excep) { excep.printStackTrace(); } } } // The function that is used to actually retrieve the output file generated by the // simulation service private void retrieveOutputFile() { jFileChooser1.setDialogTitle("Output File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); if (jFileChooser1.showSaveDialog(this) ==JFileChooser.APPROVE_OPTION) { savedOutputFileName = jFileChooser1.getSelectedFile().getPath(); DataHandler dhReceivedOutputFile = null; try { switch(mode) { case MODE_DISTRIBUTED: dhReceivedOutputFile = cdppPortType.retrieveOutputFile(sessionID); break; case MODE_PARALLEL: dhReceivedOutputFile = pcdppPortType.retrieveOutputFile(sessionID); break; } File receivedOutputFile = new File( dhReceivedOutputFile.getName()); if (receivedOutputFile.exists()) { File savedOutputFile = new File( savedOutputFileName); BufferedReader in = new BufferedReader(new FileReader( receivedOutputFile )); BufferedWriter out = new BufferedWriter(new FileWriter( savedOutputFile)); int c = -1; while ((c = in.read()) != -1) { out.write((char) c); } in.close(); out.close(); statusBar.setText("The output file was retrieved successfully!"); } } catch (Exception excep) { excep.printStackTrace(); } } } // The function that is used to actually retrieve the parsing info file // (used to debug Cell-DEVS model) private void retrieveParsingInfoLog(){ jFileChooser1.setDialogTitle("Parsing Info. File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); if (jFileChooser1.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { savedParsingInfoFileName = jFileChooser1.getSelectedFile().getPath(); DataHandler dhReceivedParsingInfoFile = null; try { switch(mode) { case MODE_DISTRIBUTED: dhReceivedParsingInfoFile = cdppPortType.retrieveParsingInfoFile(sessionID); break; case MODE_PARALLEL: dhReceivedParsingInfoFile = pcdppPortType.retrieveParsingInfoFile(sessionID); break; } File receivedParsingInfoFile = new File( dhReceivedParsingInfoFile.getName()); if (receivedParsingInfoFile.exists()) { File savedParsingInfoFile = new File( savedParsingInfoFileName); BufferedReader in = new BufferedReader(new FileReader(receivedParsingInfoFile)); BufferedWriter out = new BufferedWriter(new FileWriter(savedParsingInfoFile)); int c = -1; while ((c = in.read()) != -1) { out.write((char) c); } in.close(); out.close(); statusBar.setText("The parsing info. file was retrieved successfully!"); } } catch (Exception excep) { excep.printStackTrace(); } } } // The function that is actually used to retrieve the session log file private void retrieveSessionLog(){ jFileChooser1.setDialogTitle("Session Log File"); jFileChooser1.setFileSelectionMode(JFileChooser.FILES_ONLY); if (jFileChooser1.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { savedSessionLogFileName = jFileChooser1.getSelectedFile().getPath(); DataHandler dhReceivedSessionLogFile = null; try { switch(mode) { case MODE_DISTRIBUTED: dhReceivedSessionLogFile = cdppPortType.retrieveSessionLogFile(sessionID); break; case MODE_PARALLEL: dhReceivedSessionLogFile = pcdppPortType.retrieveSessionLogFile(sessionID); break; } File receivedSessionLogFile = new File( dhReceivedSessionLogFile.getName()); if (receivedSessionLogFile.exists()) { File savedSessionLogFile = new File( savedSessionLogFileName); BufferedReader in = new BufferedReader(new FileReader(receivedSessionLogFile)); BufferedWriter out = new BufferedWriter(new FileWriter(savedSessionLogFile)); int c = -1; while ((c = in.read()) != -1) { out.write((char) c); } in.close(); out.close(); statusBar.setText("The session log file was retrieved successfully!"); } } catch (Exception excep) { excep.printStackTrace(); } } } } class MainFrame_jButtonOutput_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonOutput_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonOutput_actionPerformed(e); } } class MainFrame_jButtonRetrieveLog_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonRetrieveLog_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonRetrieveLog_actionPerformed(e); } } //Addition of the MainFrame_jButtonRetrieveTmp_actionAdapter internal class class MainFrame_jButtonRetrieveTmp_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonRetrieveTmp_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonRetrieveTmp_actionPerformed(e); } } class MainFrame_jButtonUsers_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonUsers_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonUsers_actionPerformed(e); } } class MainFrame_jTable1_focusAdapter extends FocusAdapter { private MainFrame adaptee; MainFrame_jTable1_focusAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void focusLost(FocusEvent e) { adaptee.jTable1_focusLost(e); } } class MainFrame_jTableInc_focusAdapter extends FocusAdapter { private MainFrame adaptee; MainFrame_jTableInc_focusAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void focusLost(FocusEvent e) { adaptee.jTableInc_focusLost(e); } } class MainFrame_jCheckBoxSimTime_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jCheckBoxSimTime_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jCheckBoxSimTime_actionPerformed(e); } } class MainFrame_jButtonRetrieveSessionLog_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonRetrieveSessionLog_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonRetrieveSessionLog_actionPerformed(e); } } class MainFrame_jButtonStop_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonStop_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonStop_actionPerformed(e); } } class MainFrame_jButtonStart_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonStart_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonStart_actionPerformed(e); } } class MainFrame_jButtonLogin_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonLogin_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonLogin_actionPerformed(e); } } class MainFrame_jButtonLogoff_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonLogoff_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonLogoff_actionPerformed(e); } } class MainFrame_jButtonSetSupport_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSetSupport_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSetSupport_actionPerformed(e); } } class MainFrame_jButtonSetEvent_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSetEvent_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSetEvent_actionPerformed(e); } } class MainFrame_jButtonSetInc_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSetInc_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSetInc_actionPerformed(e); } } class MainFrame_jButtonSetPartition_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSetPartition_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSetPartition_actionPerformed(e); } } class MainFrame_jButtonSetGC_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSetGC_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSetGC_actionPerformed(e); } } class MainFrame_jButtonSetMA_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSetMA_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSetMA_actionPerformed(e); } } class MainFrame_this_windowAdapter extends WindowAdapter { private MainFrame adaptee; MainFrame_this_windowAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void windowClosing(WindowEvent e) { adaptee.this_windowClosing(e); } } class MainFrame_jButtonExit_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonExit_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonExit_actionPerformed(e); } } class MainFrame_jButtonSetDEVS_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSetDEVS_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSetDEVS_actionPerformed(e); } } class MainFrame_jButtonSelectCPP_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectCPP_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectCPP_actionPerformed(e); } } class MainFrame_jButtonSelectH_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectH_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectH_actionPerformed(e); } } class MainFrame_jButtonSelectSupport_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectSupport_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectSupport_actionPerformed(e); } } class MainFrame_jButtonSelectEvent_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectEvent_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectEvent_actionPerformed(e); } } class MainFrame_jButtonSelectPartition_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectPartition_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectPartition_actionPerformed(e); } } class MainFrame_jButtonPartition_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonPartition_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectPartition_actionPerformed(e); adaptee.jButtonSelectPartition_actionPerformed(e); } } class MainFrame_jButtonSelectGC_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectGC_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectGC_actionPerformed(e); } } class MainFrame_jButtonSelectMA_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectMA_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectMA_actionPerformed(e); } } // TODO Addition of the MainFrame_jButtonSelectInc_actionAdapter method class MainFrame_jButtonSelectInc_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonSelectInc_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonSelectInc_actionPerformed(e); } } class MainFrame_jRBDistributed_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jRBDistributed_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jRBDistributed_actionPerformed(e); } } class MainFrame_jRBParallel_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jRBParallel_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jRBParallel_actionPerformed(e); } } class MainFrame_jMenuFileExit_ActionAdapter implements ActionListener { MainFrame adaptee; MainFrame_jMenuFileExit_ActionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent actionEvent) { adaptee.jMenuFileExit_actionPerformed(actionEvent); } } class MainFrame_jMenuHelpAbout_ActionAdapter implements ActionListener { MainFrame adaptee; MainFrame_jMenuHelpAbout_ActionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent actionEvent) { adaptee.jMenuHelpAbout_actionPerformed(actionEvent); } } class MainFrame_jButtonRetrieveParsingInfo_actionAdapter implements ActionListener { private MainFrame adaptee; MainFrame_jButtonRetrieveParsingInfo_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButtonRetrieveParsingInfo_actionPerformed(e); } }