Skip to content
Snippets Groups Projects
Commit d37ba164 authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Update on import in myutil

parent 69d2f4a1
No related branches found
No related tags found
No related merge requests found
...@@ -39,28 +39,7 @@ ...@@ -39,28 +39,7 @@
package myutil; package myutil;
import avatartranslator.*; import java.util.ArrayList;
import avatartranslator.directsimulation.*;
import common.ConfigurationTTool;
import myutil.*;
import myutilsvg.SVGGeneration;
import ui.*;
import ui.avatarbd.AvatarBDPortConnector;
import ui.interactivesimulation.LatencyTableModel;
import ui.interactivesimulation.SimulationLatency;
import ui.util.IconManager;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.*;
import java.util.List;
/** /**
* Class DataElement * Class DataElement
...@@ -116,7 +95,4 @@ public class DataElement implements GenericTree { ...@@ -116,7 +95,4 @@ public class DataElement implements GenericTree {
} }
} // Class } // Class
...@@ -39,34 +39,20 @@ ...@@ -39,34 +39,20 @@
package myutil; package myutil;
import avatartranslator.*;
import avatartranslator.directsimulation.*;
import common.ConfigurationTTool;
import myutil.*;
import myutilsvg.SVGGeneration;
import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel; import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart; import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset; import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.statistics.HistogramDataset; import org.jfree.data.statistics.HistogramDataset;
import org.jfree.data.statistics.HistogramType; import org.jfree.data.statistics.HistogramType;
import ui.*;
import ui.avatarbd.AvatarBDPortConnector;
import ui.interactivesimulation.LatencyTableModel;
import ui.interactivesimulation.SimulationLatency;
import ui.util.IconManager; import ui.util.IconManager;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage; import java.awt.event.ActionListener;
import java.io.File; import java.util.ArrayList;
import java.util.*; import java.util.HashMap;
import java.util.List;
/** /**
* Class JFrameStatistics * Class JFrameStatistics
...@@ -84,11 +70,8 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT ...@@ -84,11 +70,8 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT
protected Thread t; protected Thread t;
protected int threadMode = 0; protected int threadMode = 0;
protected boolean go; protected boolean go;
private String title;
ArrayList<DataElement> elements; ArrayList<DataElement> elements;
private String title;
public JFrameStatistics(String _title, ArrayList<DataElement> _elements) { public JFrameStatistics(String _title, ArrayList<DataElement> _elements) {
...@@ -127,7 +110,7 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT ...@@ -127,7 +110,7 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT
mainPane = new JTabbedPane(); mainPane = new JTabbedPane();
showStat.add(mainPane); showStat.add(mainPane);
JSplitPane split =new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftTreePanel, showStat); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftTreePanel, showStat);
split.setDividerLocation(0.80); split.setDividerLocation(0.80);
mainPanel.add(split, BorderLayout.CENTER); mainPanel.add(split, BorderLayout.CENTER);
...@@ -153,7 +136,6 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT ...@@ -153,7 +136,6 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT
} }
public void actionPerformed(ActionEvent ae) { public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == buttonClose) { if (ae.getSource() == buttonClose) {
quit(); quit();
...@@ -211,7 +193,7 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT ...@@ -211,7 +193,7 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void showPieChart(DataElement de) { public void showPieChart(DataElement de) {
String title = "PieChart of " + de.toString() ; String title = "PieChart of " + de.toString();
// Tab already exist? // Tab already exist?
if (mainPane.indexOfTab(title) > -1) { if (mainPane.indexOfTab(title) > -1) {
...@@ -219,19 +201,19 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT ...@@ -219,19 +201,19 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT
return; return;
} }
DefaultPieDataset dataset = new DefaultPieDataset( ); DefaultPieDataset dataset = new DefaultPieDataset();
HashMap<Double, Integer> map = new HashMap<>(); HashMap<Double, Integer> map = new HashMap<>();
for(int i=0; i<de.data.length; i++) { for (int i = 0; i < de.data.length; i++) {
if (map.containsKey(de.data[i])) { if (map.containsKey(de.data[i])) {
Integer myInt = map.get(de.data[i]); Integer myInt = map.get(de.data[i]);
map.put(de.data[i], new Integer(myInt.intValue()+1)); map.put(de.data[i], new Integer(myInt.intValue() + 1));
} else { } else {
map.put(de.data[i], 0); map.put(de.data[i], 0);
} }
} }
for(Double d: map.keySet()) { for (Double d : map.keySet()) {
dataset.setValue(d, map.get(d)); dataset.setValue(d, map.get(d));
} }
...@@ -253,14 +235,13 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT ...@@ -253,14 +235,13 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT
myChart.setMouseWheelEnabled(true); myChart.setMouseWheelEnabled(true);
mainPane.addTab(title, myChart); mainPane.addTab(title, myChart);
ButtonTabComponent ctb = new ButtonTabComponent(mainPane); ButtonTabComponent ctb = new ButtonTabComponent(mainPane);
mainPane.setTabComponentAt(mainPane.getTabCount()-1, ctb); mainPane.setTabComponentAt(mainPane.getTabCount() - 1, ctb);
mainPane.setSelectedIndex(mainPane.getTabCount()-1); mainPane.setSelectedIndex(mainPane.getTabCount() - 1);
mainPane.validate(); mainPane.validate();
} }
// tree // tree
public int getChildCount() { public int getChildCount() {
return elements.size(); return elements.size();
...@@ -286,8 +267,4 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT ...@@ -286,8 +267,4 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT
} }
} // Class } // Class
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
package myutil; package myutil;
import ui.GTURTLEModeling;
import javax.swing.event.TreeModelListener; import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreeModel; import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
...@@ -79,8 +77,6 @@ public class TreeModelStats implements TreeModel { ...@@ -79,8 +77,6 @@ public class TreeModelStats implements TreeModel {
// //
if (parent instanceof GenericTree) { if (parent instanceof GenericTree) {
return ((GenericTree) parent).getChild(index); return ((GenericTree) parent).getChild(index);
} else if (parent instanceof GTURTLEModeling) {
return jFStats.getChild(index);
} }
return null; return null;
} }
...@@ -120,7 +116,7 @@ public class TreeModelStats implements TreeModel { ...@@ -120,7 +116,7 @@ public class TreeModelStats implements TreeModel {
*/ */
public boolean isLeaf(Object node) { public boolean isLeaf(Object node) {
if (node instanceof GenericTree) { if (node instanceof GenericTree) {
return (((GenericTree)node).getChildCount() == 0); return (((GenericTree) node).getChildCount() == 0);
} }
return true; return true;
......
/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
* *
* ludovic.apvrille AT enst.fr * ludovic.apvrille AT enst.fr
* *
* This software is a computer program whose purpose is to allow the * This software is a computer program whose purpose is to allow the
* edition of TURTLE analysis, design and deployment diagrams, to * edition of TURTLE analysis, design and deployment diagrams, to
* allow the generation of RT-LOTOS or Java code from this diagram, * allow the generation of RT-LOTOS or Java code from this diagram,
* and at last to allow the analysis of formal validation traces * and at last to allow the analysis of formal validation traces
* obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
* from INRIA Rhone-Alpes. * from INRIA Rhone-Alpes.
* *
* This software is governed by the CeCILL license under French law and * This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use, * abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL * modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL * license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info". * "http://www.cecill.info".
* *
* As a counterpart to the access to the source code and rights to copy, * As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only * modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the * with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited * economic rights, and the successive licensors have only limited
* liability. * liability.
* *
* In this respect, the user's attention is drawn to the risks associated * In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the * with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software, * software by the user in light of its specific status of free software,
...@@ -31,85 +31,46 @@ ...@@ -31,85 +31,46 @@
* requirements in conditions enabling the security of their systems and/or * requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the * data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security. * same conditions as regards security.
* *
* The fact that you are presently reading this means that you have had * The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms. * knowledge of the CeCILL license and that you accept its terms.
*/ */
package myutil; package myutil;
import help.HelpEntry;
import translator.CheckingError;
import translator.GroupOfGates;
import ui.*;
import ui.ad.TActivityDiagramPanel;
import ui.atd.AttackTreeDiagramPanel;
import ui.ftd.FaultTreeDiagramPanel;
import ui.avatarad.AvatarADPanel;
import ui.avatarbd.AvatarBDPanel;
import ui.avatarcd.AvatarCDPanel;
import ui.avatardd.ADDDiagramPanel;
import ui.avatarmad.AvatarMADPanel;
import ui.avatarmethodology.AvatarMethodologyDiagramPanel;
import ui.avatarpd.AvatarPDPanel;
import ui.avatarrd.AvatarRDPanel;
import ui.avatarsmd.AvatarSMDPanel;
import ui.cd.TClassDiagramPanel;
import ui.dd.TDeploymentDiagramPanel;
import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel;
import ui.ebrdd.EBRDDPanel;
import graph.RG;
import ui.iod.InteractionOverviewDiagramPanel;
import ui.ncdd.NCDiagramPanel;
import ui.osad.TURTLEOSActivityDiagramPanel;
import ui.oscd.TURTLEOSClassDiagramPanel;
import ui.req.RequirementDiagramPanel;
import ui.sd.SequenceDiagramPanel;
import ui.sysmlsecmethodology.SysmlsecMethodologyDiagramPanel;
import ui.tmlad.TMLActivityDiagramPanel;
import ui.tmlcd.TMLTaskDiagramPanel;
import ui.tmlcompd.TMLComponentTaskDiagramPanel;
import ui.tmlcp.TMLCPPanel;
import ui.tmldd.TMLArchiDiagramPanel;
import ui.tmlsd.TMLSDPanel;
import ui.ucd.UseCaseDiagramPanel;
import ui.util.IconManager;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
import java.awt.*; import java.awt.*;
/** /**
* Class TreeRendererStats * Class TreeRendererStats
* Icons and tooltiptext for the main tree * Icons and tooltiptext for the main tree
* Creation: 11/01/2021 * Creation: 11/01/2021
* @version 1.0 11/01/2021 *
* @author Ludovic APVRILLE * @author Ludovic APVRILLE
* @version 1.0 11/01/2021
*/ */
public class TreeRendererStats extends DefaultTreeCellRenderer { public class TreeRendererStats extends DefaultTreeCellRenderer {
public TreeRendererStats() { public TreeRendererStats() {
} }
public Component getTreeCellRendererComponent( public Component getTreeCellRendererComponent(
JTree tree, JTree tree,
Object value, Object value,
boolean sel, boolean sel,
boolean expanded, boolean expanded,
boolean leaf, boolean leaf,
int row, int row,
boolean hasFocus) { boolean hasFocus) {
super.getTreeCellRendererComponent( super.getTreeCellRendererComponent(
tree, value, sel, tree, value, sel,
expanded, leaf, row, expanded, leaf, row,
hasFocus); hasFocus);
if (value instanceof DataElement) { if (value instanceof DataElement) {
//setIcon(IconManager.imgic80); //setIcon(IconManager.imgic80);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment