Commit bd373334 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Merge branch 'CompareLatencyDetailedAnlysis' into 'master'

Compare latency detailed analysis

See merge request !323
parents 294ea97c c0760ff5
......@@ -231,6 +231,9 @@ using std::max;
#define TAG_CURRTASKc "</currtask>"
#define TAG_ENERGYo "<energy>"
#define TAG_ENERGYc "</energy>"
#define TAG_MODELo "<model>"
#define TAG_MODELc "</model>"
#define EXT_SEP "."
#define EXT_VCD ".vcd"
......
......@@ -379,7 +379,7 @@ void Simulator::schedule2XML(std::ostringstream& glob,std::string& iTraceFileNam
for(BusList::const_iterator j=_simComp->getBusList().begin(); j != _simComp->getBusList().end(); ++j){
(*j)->schedule2XML(glob,myfile);
}
glob << TAG_MODELo<< _simComp->getModelName() << TAG_MODELc; //name of model
glob << std::endl << TAG_GLOBALc << std::endl << TAG_STARTc << std::endl;
myfile << glob.str() << std::endl;
......
......@@ -557,5 +557,20 @@ public class TMLArchitecture {
return bridgeList;
}
public List<HwA> getHwA() {
List<HwA> hardwareAccList = new ArrayList<HwA>();
for (HwNode node : hwnodes) {
if (node instanceof HwA) {
HwA hardwareAcc = (HwA) node;
hardwareAccList.add(hardwareAcc);
}
}
return hardwareAccList;
}
}
\ No newline at end of file
......@@ -311,8 +311,6 @@ public class ActionPerformer {
mgui.enhanceDiagram();
} else if (command.equals(mgui.actions[TGUIAction.ACT_NC].getActionCommand())) {
mgui.NC();
} else if (command.equals(mgui.actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].getActionCommand())) {
mgui.latencyDetailedAnalysis();
} else if (command.equals(mgui.actions[TGUIAction.EXTERNAL_ACTION_1].getActionCommand())) {
mgui.executeUserCommand(ConfigurationTTool.ExternalCommand1Host, SpecConfigTTool.ExternalCommand1);
} else if (command.equals(mgui.actions[TGUIAction.EXTERNAL_ACTION_2].getActionCommand())) {
......
......@@ -646,14 +646,7 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem = codeG.add(mgui.actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION]);
menuItem.setName("CodeG Executable");
menuItem.addMouseListener(mgui.mouseHandler);
if (mgui.isExperimentalOn()) {
vAndV.addSeparator();
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_GEN_LATENCY_GRAPH]);
menuItem.setName("Latency Detailed Analysis");
menuItem.addMouseListener(mgui.mouseHandler);
}
// View
menuItem = view.add(mgui.actions[TGUIAction.ACT_VIEW_BIRDEYES_EMB]);
menuItem.setName("View Hide Birdeye");
......
......@@ -68,7 +68,6 @@ import ui.avatarrd.AvatarRDPanel;
import ui.avatarsmd.AvatarSMDPanel;
import ui.cd.TClassDiagramPanel;
import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel;
import ui.directedgraph.JFrameLatencyDetailedAnalysis;
import ui.ebrdd.EBRDDPanel;
import ui.eln.ELNDiagramPanel;
import ui.file.*;
......@@ -82,6 +81,7 @@ import ui.osad.TURTLEOSActivityDiagramPanel;
import ui.prosmd.ProactiveSMDPanel;
import ui.req.Requirement;
import ui.req.RequirementDiagramPanel;
import ui.simulationtraceanalysis.latencyDetailedAnalysisMain;
import ui.syscams.SysCAMSComponentTaskDiagramPanel;
import ui.syscams.SysCAMSCompositeComponent;
import ui.tmlad.TMLActivityDiagramPanel;
......@@ -106,12 +106,19 @@ import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
import org.xml.sax.SAXException;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.*;
import java.util.List;
......@@ -197,7 +204,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
public final static byte NOT_OPENED = 0;
public final static byte OPENED = 1;
public final static byte MODEL_OK = 2;
public final static byte MODEL_CHANGED = 3;
public final static byte MODEL_CHANGED = 3;
public final static byte MODEL_SAVED = 4;
public final static byte RTLOTOS_OK = 5;
public final static byte BACKWARD = 6;
......@@ -329,7 +336,11 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
private JFrameInteractiveSimulation jfis;
private JFrameAvatarInteractiveSimulation jfais;
private JFrameCompareSimulationTraces cSimTrace;
private JFrameLatencyDetailedAnalysis latencyDetailedAnalysis;
private latencyDetailedAnalysisMain latencyDetailedAnalysisMain;
// Help
private HelpManager helpManager;
......@@ -339,10 +350,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
private Invariant currentInvariant;
// Thread for autosave
private PeriodicBehaviorThread pbt;
private TMLArchiPanel tmlap; // Used to retrieve the currently opened architecture panel
private PeriodicBehaviorThread pbt;
// Plugin management
// public static PluginManager pluginManager;
......@@ -4061,7 +4070,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
}
}
} else if (tp instanceof TMLArchiPanel) {
tmlap = (TMLArchiPanel) tp;
TMLArchiPanel tmlap = (TMLArchiPanel) tp;
JDialogSelectTMLNodes.validated = tmlap.validated;
JDialogSelectTMLNodes.ignored = tmlap.ignored;
Vector<TGComponent> tmlNodesToValidate = new Vector<TGComponent>();
......@@ -9543,10 +9552,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
}
// Get the currently opened architecture panel
public TMLArchiPanel getCurrentArchiPanel() {
return tmlap;
}
// DraggableTabbedPaneCallbackInterface
public void hasBeenDragged(int initialPosition, int destinationPosition) {
......@@ -9569,85 +9575,19 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
cSimTrace.setVisible(true);
}
public void latencyDetailedAnalysis() {
Vector<TGComponent> tmlNodesToValidate = new Vector<TGComponent>();
List<TMLComponentDesignPanel> cpanels;
TMLComponentDesignPanel compdp;
TURTLEPanel tp = getCurrentTURTLEPanel();
// tmlap = (TMLArchiPanel) tp;
if (gtm == null) {
} else {
if (gtm.getTMLMapping() != null) {
TMLMapping<TGComponent> map = gtm.getTMLMapping();
for (TGComponent component : tmlap.tmlap.getComponentList()) {
tmlNodesToValidate.add(component);
}
TGComponent tgc;
List<TMLArchiArtifact> artifacts;
String namePanel;
TURTLEPanel tup;
Iterator<? extends TGComponent> iterator = tmlNodesToValidate.listIterator();
cpanels = new ArrayList<TMLComponentDesignPanel>();
while (iterator.hasNext()) {
tgc = iterator.next();
if (tgc instanceof TMLArchiNode) {
artifacts = ((TMLArchiNode) (tgc)).getAllTMLArchiArtifacts();
for (TMLArchiArtifact artifact : artifacts) {
namePanel = artifact.getReferenceTaskName();
try {
tup = getTURTLEPanel(namePanel);
if (tup instanceof TMLComponentDesignPanel) {
compdp = (TMLComponentDesignPanel) (tup);
if (!cpanels.contains(compdp)) {
cpanels.add(compdp);
}
}
} catch (Exception e) {
// Just in case the mentionned panel is not a TML design Panel
}
}
}
}
latencyDetailedAnalysis = new JFrameLatencyDetailedAnalysis(map, cpanels);
latencyDetailedAnalysis.setIconImage(IconManager.img9);
GraphicLib.centerOnParent(latencyDetailedAnalysis, 900, 600);
latencyDetailedAnalysis.setVisible(true);
} else {
if (gtm.getArtificialTMLMapping() != null) {
TMLMapping<TGComponent> map = gtm.getArtificialTMLMapping();
TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel) tp;
cpanels = new ArrayList<TMLComponentDesignPanel>();
cpanels.add(tmlcdp);
latencyDetailedAnalysis = new JFrameLatencyDetailedAnalysis(map, cpanels);
latencyDetailedAnalysis.setIconImage(IconManager.img9);
GraphicLib.centerOnParent(latencyDetailedAnalysis, 900, 600);
latencyDetailedAnalysis.setVisible(true);
} else {
}
}
}
// dp.getPanels();
public void compareLatencyForXML(SimulationTrace selectedST, boolean b) {
latencyDetailedAnalysisMain = new latencyDetailedAnalysisMain(1,this,selectedST,b,false,0);
}
public JFrameLatencyDetailedAnalysis getLatencyDetailedAnalysis() {
return latencyDetailedAnalysis;
public void latencyDetailedAnalysisForXML(SimulationTrace selectedST, boolean b, boolean compare, int j) throws XPathExpressionException, ParserConfigurationException, SAXException, IOException {
latencyDetailedAnalysisMain = new latencyDetailedAnalysisMain(2,this,selectedST,b ,compare,j);
}
} // Class MainGUI
......@@ -179,8 +179,7 @@ public class ModeManager {
actions[TGUIAction.ACT_GEN_CCODE].setEnabled(true);
actions[TGUIAction.ACT_GEN_AUT].setEnabled(true);
actions[TGUIAction.ACT_GEN_AUTS].setEnabled(true);
actions[TGUIAction.ACT_GEN_UPPAAL].setEnabled(true);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(true);
actions[TGUIAction.ACT_GEN_UPPAAL].setEnabled(true);
break;
case MainGUI.AVATAR_SYNTAXCHECKING_OK:
actions[TGUIAction.ACT_AVATAR_SIM].setEnabled(true);
......@@ -249,8 +248,7 @@ public class ModeManager {
actions[TGUIAction.ACT_AVATAR_FV_UPPAAL].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
break;
case MainGUI.METHO_CHANGED:
actions[TGUIAction.ACT_GEN_RTLOTOS].setEnabled(false);
......@@ -298,8 +296,7 @@ public class ModeManager {
actions[TGUIAction.ACT_AVATAR_FV_UPPAAL].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
break;
case MainGUI.MODEL_SAVED:
......
......@@ -682,8 +682,7 @@ public class TGUIAction extends AbstractAction {
//--
public static final int MOVE_ENABLED = 463;
public static final int FIRST_DIAGRAM = 464;
public static final int ACT_GEN_LATENCY_GRAPH = 519;
public static final int FIRST_DIAGRAM = 464;
public static final int NB_ACTION = 528;
private static final TAction [] actions = new TAction[NB_ACTION];
......@@ -1425,7 +1424,7 @@ public class TGUIAction extends AbstractAction {
actions[MOVE_ENABLED] = new TAction("Move", "Move enabled", IconManager.imgic780, IconManager.imgic780, "Move enabled (shift + arrow)", "Move", 0);
actions[FIRST_DIAGRAM] = new TAction("FirstDiagram", "First Diagram", IconManager.imgic142, IconManager.imgic142, "Switch the the first diagram", "Switch to the first diagram", 0);
actions[ACT_GEN_LATENCY_GRAPH] = new TAction("generate-latency-graph", "Analyze Latency Graph", IconManager.imgic1118, IconManager.imgic1118, "Analyze Latency Graph", "Analyze Latency Graph", '0');
}
public String getActionCommand() {
......
......@@ -44,13 +44,8 @@ import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Map;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
......@@ -60,8 +55,6 @@ import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;
import javax.swing.filechooser.FileNameExtensionFilter;
......@@ -69,40 +62,23 @@ import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.jgrapht.Graph;
import org.jgrapht.graph.DefaultDirectedGraph;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.io.Attribute;
import org.jgrapht.io.EdgeProvider;
import org.jgrapht.io.GmlImporter;
import org.jgrapht.io.GraphImporter;
import org.jgrapht.io.GraphMLImporter;
import org.jgrapht.io.ImportException;
import org.jgrapht.io.VertexProvider;
import org.xml.sax.SAXException;
import common.ConfigurationTTool;
import myutil.TraceManager;
import ui.MainGUI;
import ui.SimulationTrace;
/**
* Class JFrameCompareSimulationTraces : open the compare popup with all the
* related functionality (browse for second file, difference in simulation
* traces and latency calculation button )
*
* Creation: 19/07/2019
*
* @author Maysam ZOOR
*/
public class JFrameCompareSimulationTraces extends JFrame implements ActionListener {
public class JFrameCompareSimulationTraces extends JFrame implements ActionListener, WindowListener {
private JButton browse, parse, difference, latencyDetails, graph;
private JButton browse, parse, difference, latencyDetails, latencyAnalysis;
private JFileChooser fc, fc2;
private File file;
private SimulationTrace selectedST;
private SimulationTrace selectedST, secondSelectedST;
private static Vector<SimulationTransaction> transFile1;
Vector<String> dropDown1, dropDown2 = new Vector<String>();
private JFrame JFrameTest;
MainGUI _mgui;
public Vector<SimulationTransaction> getTransFile1() {
return transFile1;
......@@ -124,23 +100,30 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
private SimulationTransaction st = new SimulationTransaction();
private JTextField file2 = new JTextField();
private boolean panelAdded = false;
private boolean latencyPanelAdded = false;
private static JPanelCompareXmlGraph newContentPane;
private JComboBox<Object> devicesDropDownCombo1 = new JComboBox<Object>();
private JComboBox<Object> devicesDropDownCombo2 = new JComboBox<Object>();
private JComboBox<Object> tracesCombo1, tracesCombo2;
public JFrameCompareSimulationTraces(MainGUI _mgui, String _title, SimulationTrace sST, boolean visible) {
JPanel latencyPanel = new JPanel(new GridBagLayout());;
private JComboBox<String> devicesDropDownCombo1 = new JComboBox<String>();
private JComboBox<String> devicesDropDownCombo2 = new JComboBox<String>();
private JComboBox<String> tracesCombo1, tracesCombo2;
private Thread t, t1;
public JFrameCompareSimulationTraces(MainGUI mgui, String _title, SimulationTrace sST, boolean visible) {
super(_title);
this.selectedST = sST;
GridLayout myLayout = new GridLayout(3, 1);
_mgui = mgui;
// this.setBackground(Color.RED);
this.setLayout(myLayout);
addWindowListener(this);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
//addWindowListener(this);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
if (ConfigurationTTool.SystemCCodeDirectory.length() > 0) {
fc = new JFileChooser(ConfigurationTTool.SystemCCodeDirectory);
......@@ -198,25 +181,6 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
c.weighty = 1;
buttonPanel.add(file2, c);
JLabel lab3 = new JLabel("Secound Graph ", JLabel.LEFT);
c.fill = GridBagConstraints.NORTHWEST;
c.gridx = 0;
c.gridy = 2;
c.weightx = 1;
c.weighty = 1;
c.anchor = GridBagConstraints.WEST;
buttonPanel.add(lab3, c);
graph = new JButton("Graph");
graph.addActionListener(this);
c.fill = GridBagConstraints.NORTHWEST;
c.gridx = 0;
c.gridy = 3;
c.weightx = 1;
c.weighty = 1;
buttonPanel.add(graph, c);
browse = new JButton("Browse");
browse.addActionListener(this);
c.fill = GridBagConstraints.NORTHWEST;
......@@ -235,6 +199,15 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
c.weighty = 1;
buttonPanel.add(parse, c);
/*latencyAnalysis = new JButton("latencyAnalysis");
latencyAnalysis.addActionListener(this);
c.fill = GridBagConstraints.NORTHWEST;
c.gridx = 1;
c.gridy = 4;
c.weightx = 5;
c.weighty = 1;
buttonPanel.add(latencyAnalysis, c);*/
difference = new JButton("difference");
difference.addActionListener(this);
c.fill = GridBagConstraints.NORTHWEST;
......@@ -248,6 +221,7 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
this.pack();
this.setVisible(visible);
JFrameTest= this;
}
......@@ -300,69 +274,143 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
final DefaultComboBoxModel<Object> model = new DefaultComboBoxModel<Object>(transacationsDropDown1);
tracesCombo1.setModel(model);
// tracesCombo1.setModel(model);
} else if (e.getSource() == devicesDropDownCombo2) {
Vector<Object> transacationsDropDown2 = newContentPane.loadTransacationsDropDown(devicesDropDownCombo2.getSelectedItem());
final DefaultComboBoxModel<Object> model = new DefaultComboBoxModel<Object>(transacationsDropDown2);
tracesCombo2.setModel(model);
// tracesCombo2.setModel(model);
} else if (e.getSource() == graph) {
} /*else if (e.getSource() == latencyAnalysis) {
if (ConfigurationTTool.SystemCCodeDirectory.length() > 0) {
fc2 = new JFileChooser(ConfigurationTTool.SystemCCodeDirectory);
} else {
fc2 = new JFileChooser();
t = new Thread() {
public void run() {
try {
_mgui.latencyDetailedAnalysisForXML(selectedST, true, false,1);
} catch (XPathExpressionException | ParserConfigurationException | SAXException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
t.start();
try {
t.join();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (t.getState() == Thread.State.TERMINATED) {
dropDown1 = _mgui.getLatencyDetailedAnalysis().getCheckedTransactions();
}
FileNameExtensionFilter filter = new FileNameExtensionFilter("graphml files", "graphml");
fc2.setFileFilter(filter);
secondSelectedST = new SimulationTrace("file2", SimulationTrace.XML_DIPLO, file2.getText());
int returnVal = fc2.showOpenDialog(JFrameCompareSimulationTraces.this);
System.out.println("load drop down1: " + _mgui.getLatencyDetailedAnalysis().getCheckedTransactions().size());
if (returnVal == JFileChooser.APPROVE_OPTION) {
file = fc2.getSelectedFile();
// file2.setText(file.getPath());
t1 = new Thread() {
public void run() {
try {
_mgui.latencyDetailedAnalysisForXML(secondSelectedST, true,false,2);
} catch (XPathExpressionException | ParserConfigurationException | SAXException | IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
}
t1.start();
FileReader ps = null;
try {
ps = new FileReader(file);
} catch (FileNotFoundException e1) {
t1.join();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
VertexProvider<String> vertexProvider = (id, attributes) -> {
String cv = new String(id);
cv.replaceAll("\\s+", "");
cv.replaceAll("(", "");
cv.replaceAll(")", "");
return cv;
if (t1.getState() == Thread.State.TERMINATED) {
};
dropDown2 = _mgui.getLatencyDetailedAnalysis().getCheckedTransactions();
}
System.out.println("load drop down2: " + _mgui.getLatencyDetailedAnalysis().getCheckedTransactions().size());
EdgeProvider<String, DefaultEdge> edgeProvider = (from, to, label, attributes) -> new DefaultEdge();
if (!latencyPanelAdded) {
DrawLatencyPanel();
GraphMLImporter<String, DefaultEdge> importer = new GraphMLImporter<String, DefaultEdge>(vertexProvider, edgeProvider);
latencyPanelAdded = true;
latencyPanel.revalidate();
latencyPanel.repaint();
latencyPanel.setVisible(true);
this.add(latencyPanel);
this.pack();
} else {
this.revalidate();
latencyPanel.revalidate();
latencyPanel.repaint();
try {
Graph<String, DefaultEdge> importedGraph = new DefaultDirectedGraph<>(DefaultEdge.class);
;
importer.importGraph(importedGraph, ps);
System.out.print(importedGraph.vertexSet().size());
} catch (ImportException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
this.revalidate();
this.repaint();
this.pack();
this.revalidate();
this.repaint();
this.setVisible(true);
}*/
}
/*
* else if (e.getSource() == graph) {
*
* if (ConfigurationTTool.SystemCCodeDirectory.length() > 0) { fc2 = new
* JFileChooser(ConfigurationTTool.SystemCCodeDirectory); } else { fc2 = new
* JFileChooser(); }
*
* FileNameExtensionFilter filter = new FileNameExtensionFilter("graphml files",
* "graphml"); fc2.setFileFilter(filter);
*
* int returnVal = fc2.showOpenDialog(JFrameCompareSimulationTraces.this);
*
* if (returnVal == JFileChooser.APPROVE_OPTION) { file = fc2.getSelectedFile();
* // file2.setText(file.getPath());
*
* }
*
* FileReader ps = null; try { ps = new FileReader(file); } catch
* (FileNotFoundException e1) { // TODO Auto-generated catch block
* e1.printStackTrace(); }
*
* VertexProvider<String> vertexProvider = (id, attributes) -> { String cv = new
* String(id); cv.replaceAll("\\s+", ""); cv.replaceAll("(", "");
* cv.replaceAll(")", ""); return cv;
*
* };
*
* EdgeProvider<String, DefaultEdge> edgeProvider = (from, to, label,
* attributes) -> new DefaultEdge();
*
* GraphMLImporter<String, DefaultEdge> importer = new GraphMLImporter<String,
* DefaultEdge>(vertexProvider, edgeProvider);
*
* try { Graph<String, DefaultEdge> importedGraph = new
* DefaultDirectedGraph<>(DefaultEdge.class); ;
* importer.importGraph(importedGraph, ps);
* System.out.print(importedGraph.vertexSet().size()); } catch (ImportException
* e1) { // TODO Auto-generated catch block e1.printStackTrace(); }
*
* }
*/
// }
public int parseXML(String file1Path, String file2Path) throws SAXException, IOException, ParserConfigurationException {
if (file1Path.length() == 0 || file2Path.length() == 0)
......@@ -402,8 +450,6 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
this.add(newContentPane);
DrawLatencyPanel();
panelAdded = true;
}
......@@ -413,19 +459,16 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
private void DrawLatencyPanel() {
JPanel latencyPanel = new JPanel(new GridBagLayout()); // use FlowLayout
latencyPanel = new JPanel(new GridBagLayout()); // use FlowLayout
GridBagConstraints c = new GridBagConstraints();
latencyPanel.setBorder(new javax.swing.border.TitledBorder("Latency for Simulation Traces File"));
c.fill = GridBagConstraints.NORTHWEST;
new JTextField();
Vector<Object> devicesDropDown1 = newContentPane.loadDevicesDropDown();
devicesDropDownCombo1 = new JComboBox<Object>(devicesDropDown1);
devicesDropDownCombo1 = new JComboBox<String>(dropDown1);
Vector<Object> transacationsDropDown1 = newContentPane.loadTransacationsDropDown(devicesDropDownCombo1.getSelectedItem());
tracesCombo1 = new JComboBox<Object>(transacationsDropDown1);
tracesCombo1 = new JComboBox<String>(dropDown1);
c.fill = GridBagConstraints.NORTHWEST;
c.gridx = 0;
......@@ -441,16 +484,12 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
c.weightx = 1;
c.weighty = 1;
latencyPanel.add(tracesCombo1, c);
this.add(latencyPanel);
devicesDropDownCombo1.addActionListener(this);
Vector<Object> devicesDropDown2 = newContentPane.loadDevicesDropDown();
devicesDropDownCombo2 = new JComboBox<String>(dropDown2);
devicesDropDownCombo2 = new JComboBox<Object>(devicesDropDown2);
Vector<Object> transacationsDropDown2 = newContentPane.loadTransacationsDropDown(devicesDropDownCombo2.getSelectedItem());
tracesCombo2 = new JComboBox<Object>(transacationsDropDown2);
tracesCombo2 = new JComboBox<String>(dropDown2);
c.fill = GridBagConstraints.NORTHWEST;
c.gridx = 1;
......@@ -463,7 +502,6 @@ public class JFrameCompareSimulationTraces extends JFrame implements ActionListe
c.gridy = 1;
latencyPanel.add(tracesCombo2, c);
this.add(latencyPanel);