diff --git a/src/main/java/myutil/DataElement.java b/src/main/java/myutil/DataElement.java index b1f6b0a37d2e537121a30122180ea1471418eb1b..74d420df00cb0d50e75c5804061149b90faf644a 100644 --- a/src/main/java/myutil/DataElement.java +++ b/src/main/java/myutil/DataElement.java @@ -39,28 +39,7 @@ package myutil; -import avatartranslator.*; -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; +import java.util.ArrayList; /** * Class DataElement @@ -116,7 +95,4 @@ public class DataElement implements GenericTree { } - - - } // Class diff --git a/src/main/java/myutil/JFrameStatistics.java b/src/main/java/myutil/JFrameStatistics.java index 8001bf3a0f789646b8bcf99885e3e20a9bb82891..e23b26163c3035c090c0a59a2c2e5ef6c1a69bfc 100644 --- a/src/main/java/myutil/JFrameStatistics.java +++ b/src/main/java/myutil/JFrameStatistics.java @@ -39,34 +39,20 @@ package myutil; -import avatartranslator.*; -import avatartranslator.directsimulation.*; -import common.ConfigurationTTool; -import myutil.*; -import myutilsvg.SVGGeneration; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.data.general.DefaultPieDataset; import org.jfree.data.statistics.HistogramDataset; 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 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; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.HashMap; /** * Class JFrameStatistics @@ -84,11 +70,8 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT protected Thread t; protected int threadMode = 0; protected boolean go; - - private String title; - ArrayList<DataElement> elements; - + private String title; public JFrameStatistics(String _title, ArrayList<DataElement> _elements) { @@ -127,7 +110,7 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT mainPane = new JTabbedPane(); 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); mainPanel.add(split, BorderLayout.CENTER); @@ -153,7 +136,6 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT } - public void actionPerformed(ActionEvent ae) { if (ae.getSource() == buttonClose) { quit(); @@ -211,7 +193,7 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT @SuppressWarnings("unchecked") public void showPieChart(DataElement de) { - String title = "PieChart of " + de.toString() ; + String title = "PieChart of " + de.toString(); // Tab already exist? if (mainPane.indexOfTab(title) > -1) { @@ -219,19 +201,19 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT return; } - DefaultPieDataset dataset = new DefaultPieDataset( ); + DefaultPieDataset dataset = new DefaultPieDataset(); 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])) { 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 { map.put(de.data[i], 0); } } - for(Double d: map.keySet()) { + for (Double d : map.keySet()) { dataset.setValue(d, map.get(d)); } @@ -253,14 +235,13 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT myChart.setMouseWheelEnabled(true); mainPane.addTab(title, myChart); ButtonTabComponent ctb = new ButtonTabComponent(mainPane); - mainPane.setTabComponentAt(mainPane.getTabCount()-1, ctb); - mainPane.setSelectedIndex(mainPane.getTabCount()-1); + mainPane.setTabComponentAt(mainPane.getTabCount() - 1, ctb); + mainPane.setSelectedIndex(mainPane.getTabCount() - 1); mainPane.validate(); } - // tree public int getChildCount() { return elements.size(); @@ -286,8 +267,4 @@ public class JFrameStatistics extends JFrame implements ActionListener, GenericT } - - - - } // Class diff --git a/src/main/java/myutil/TreeModelStats.java b/src/main/java/myutil/TreeModelStats.java index 6d14a7c8ee11fc390345cda67be59699ebaa89b5..592df3a389f7f5c127eec7578d3d955bf5cc389b 100644 --- a/src/main/java/myutil/TreeModelStats.java +++ b/src/main/java/myutil/TreeModelStats.java @@ -39,8 +39,6 @@ package myutil; -import ui.GTURTLEModeling; - import javax.swing.event.TreeModelListener; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; @@ -79,8 +77,6 @@ public class TreeModelStats implements TreeModel { // if (parent instanceof GenericTree) { return ((GenericTree) parent).getChild(index); - } else if (parent instanceof GTURTLEModeling) { - return jFStats.getChild(index); } return null; } @@ -120,7 +116,7 @@ public class TreeModelStats implements TreeModel { */ public boolean isLeaf(Object node) { if (node instanceof GenericTree) { - return (((GenericTree)node).getChildCount() == 0); + return (((GenericTree) node).getChildCount() == 0); } return true; diff --git a/src/main/java/myutil/TreeRendererStats.java b/src/main/java/myutil/TreeRendererStats.java index d5f65bed64b9196fb67a7f0e88732655f54c1f64..d7369b6e7866842953acf3d82ff14949a8e51b83 100644 --- a/src/main/java/myutil/TreeRendererStats.java +++ b/src/main/java/myutil/TreeRendererStats.java @@ -1,26 +1,26 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * 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 * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,85 +31,46 @@ * 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 * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - - 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.tree.DefaultTreeCellRenderer; import java.awt.*; - /** - * Class TreeRendererStats - * Icons and tooltiptext for the main tree - * Creation: 11/01/2021 - * @version 1.0 11/01/2021 - * @author Ludovic APVRILLE + * Class TreeRendererStats + * Icons and tooltiptext for the main tree + * Creation: 11/01/2021 + * + * @author Ludovic APVRILLE + * @version 1.0 11/01/2021 */ -public class TreeRendererStats extends DefaultTreeCellRenderer { +public class TreeRendererStats extends DefaultTreeCellRenderer { public TreeRendererStats() { } public Component getTreeCellRendererComponent( - JTree tree, - Object value, - boolean sel, - boolean expanded, - boolean leaf, - int row, - boolean hasFocus) { + JTree tree, + Object value, + boolean sel, + boolean expanded, + boolean leaf, + int row, + boolean hasFocus) { super.getTreeCellRendererComponent( - tree, value, sel, - expanded, leaf, row, - hasFocus); + tree, value, sel, + expanded, leaf, row, + hasFocus); if (value instanceof DataElement) { //setIcon(IconManager.imgic80);