diff --git a/src/main/java/ui/ActionPerformer.java b/src/main/java/ui/ActionPerformer.java index 5f177d037fba1c62fbbc2a7f9dcedf3052efc5a7..a711b3051aab7fac8ef1adfc61efd9b8f73d9436 100644 --- a/src/main/java/ui/ActionPerformer.java +++ b/src/main/java/ui/ActionPerformer.java @@ -928,6 +928,38 @@ public class ActionPerformer { } else if (command.equals(mgui.actions[TGUIAction.CAMS_GENCODE].getActionCommand())){ mgui.syscamsExecutableCodeGeneration(); + // ELN + } else if (command.equals(mgui.actions[TGUIAction.ELN_EDIT].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.EDIT, -1); + } else if (command.equals(mgui.actions[TGUIAction.ELN_CONNECTOR].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_CONNECTOR); + } else if (command.equals(mgui.actions[TGUIAction.ELN_RESISTOR].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_RESISTOR); + } else if (command.equals(mgui.actions[TGUIAction.ELN_CAPACITOR].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_CAPACITOR); + } else if (command.equals(mgui.actions[TGUIAction.ELN_INDUCTOR].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_INDUCTOR); + } else if (command.equals(mgui.actions[TGUIAction.ELN_VOLTAGE_CONTROLLED_VOLTAGE_SOURCE].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_VOLTAGE_CONTROLLED_VOLTAGE_SOURCE); + } else if (command.equals(mgui.actions[TGUIAction.ELN_VOLTAGE_CONTROLLED_CURRENT_SOURCE].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_VOLTAGE_CONTROLLED_CURRENT_SOURCE); + } else if (command.equals(mgui.actions[TGUIAction.ELN_CURRENT_CONTROLLED_VOLTAGE_SOURCE].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_CURRENT_CONTROLLED_VOLTAGE_SOURCE); + } else if (command.equals(mgui.actions[TGUIAction.ELN_CURRENT_CONTROLLED_CURRENT_SOURCE].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_CURRENT_CONTROLLED_CURRENT_SOURCE); + } else if (command.equals(mgui.actions[TGUIAction.ELN_NULLOR].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_NULLOR); + } else if (command.equals(mgui.actions[TGUIAction.ELN_GYRATOR].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_GYRATOR); + } else if (command.equals(mgui.actions[TGUIAction.ELN_IDEAL_TRANSFORMER].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_IDEAL_TRANSFORMER); + } else if (command.equals(mgui.actions[TGUIAction.ELN_TRANSMISSION_LINE].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_TRANSMISSION_LINE); + } else if (command.equals(mgui.actions[TGUIAction.ELN_INDEPENDENT_VOLTAGE_SOURCE].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_INDEPENDENT_VOLTAGE_SOURCE); + } else if (command.equals(mgui.actions[TGUIAction.ELN_INDEPENDENT_CURRENT_SOURCE].getActionCommand())){ + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ELN_INDEPENDENT_CURRENT_SOURCE); + // Attack Tree Diagrams } else if (command.equals(mgui.actions[TGUIAction.ATD_BLOCK].getActionCommand())) { mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.ATD_BLOCK); diff --git a/src/main/java/ui/ELNDesignPanel.java b/src/main/java/ui/ELNDesignPanel.java new file mode 100644 index 0000000000000000000000000000000000000000..3296df2d18a159a6808bc2ff8bbab3b587ad128b --- /dev/null +++ b/src/main/java/ui/ELNDesignPanel.java @@ -0,0 +1,183 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici + * + * ludovic.apvrille AT enst.fr + * andrea.enrici 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, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * 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 ui; + +import myutil.GraphicLib; +import ui.eln.ELNDiagramPanel; +import ui.eln.ELNDiagramToolBar; +import ui.util.IconManager; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.util.Vector; + +/** + * Class ELNDesignPanel + * Managenemt of ELN design panels + * Creation: 11/06/2018 + * @version 1.0 11/06/2018 + * @author Irina Kit Yan LEE + * @see MainGUI + */ + +public class ELNDesignPanel extends TURTLEPanel { + + public ELNDiagramPanel elndp; + + public Vector<TGComponent> validated, ignored; + + public ELNDesignPanel(MainGUI _mgui) { + super(_mgui); + + // Issue #41 Ordering of tabbed panes + tabbedPane = GraphicLib.createTabbedPane();// new JTabbedPane(); + + cl = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + mgui.paneDesignAction(e); + } + }; + + tabbedPane.addChangeListener(cl); + tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui)); + + // Issue #41: Ordering of tabbed panes + tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); + } + + public void init() { + + // Toolbar + ELNDiagramToolBar toolBarELN = new ELNDiagramToolBar(mgui); + toolbars.add(toolBarELN); + + toolBarPanel = new JPanel(); + toolBarPanel.setLayout(new BorderLayout()); + + // Diagram + elndp = new ELNDiagramPanel(mgui, toolBarELN); + elndp.setName("ELN Diagram"); + elndp.tp = this; + tdp = elndp; + panels.add(elndp); // Always first in list + JScrollDiagramPanel jsp = new JScrollDiagramPanel(elndp); + elndp.jsp = jsp; + jsp.setWheelScrollingEnabled(true); + jsp.getVerticalScrollBar().setUnitIncrement(MainGUI.INCREMENT); + toolBarPanel.add(toolBarELN, BorderLayout.NORTH); + toolBarPanel.add(jsp, BorderLayout.CENTER); + tabbedPane.addTab("ELN Diagram", IconManager.imgic1208, toolBarPanel, + "Opens ELN diagram"); + tabbedPane.setSelectedIndex(0); + + mgui.changeMade(elndp, TDiagramPanel.NEW_COMPONENT); + } + + public String saveHeaderInXml(String extensionToName) { + if (extensionToName == null) { + return "<Modeling type=\"ELN\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; + } + return "<Modeling type=\"ELN\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n"; + } + + public String saveTailInXml() { + return "</Modeling>\n\n\n"; + } + + public String toString() { + return mgui.getTitleAt(this) + "(ELN Application diagram)"; + } + +// public SysCAMSBlockTDF getBlockTDFComponentByName(String _name) { +// return elndp.getBlockTDFComponentByName(_name); +// } +// +// public SysCAMSBlockDE getBlockDEComponentByName(String _name) { +// return elndp.getBlockDEComponentByName(_name); +// } + // + // public String[] getCompOutChannels(){ + // return syscamsctdp.getCompOutChannels(); + // } + // + // public String[] getCompInChannels(){ + // return syscamsctdp.getCompInChannels(); + // } + // + // public java.util.List<String> getAllSysCAMSCommunicationNames(String _name) { + // return syscamsctdp.getAllSysCAMSCommunicationNames(_name); + // } + // + // public java.util.List<String> getAllSysCAMSInputPorts( String _name ) { + // return syscamsctdp.getAllSysCAMSInputPorts( _name ); + // } + +// public java.util.List<String> getAllCompositeComponent(String _name) { +// return elndp.getAllCompositeComponent(_name); +// } +// +// public Vector<String> getAllSysCAMSTasksAttributes() { +// return elndp.getAllSysCAMSTasksAttributes(); +// } +// +// public java.util.List<String> getAllSysCAMSTaskNames(String _name) { +// return elndp.getAllSysCAMSTaskNames(_name); +// } +// +// public String[] getAllOutTDF(String nameOfComponent) { +// return elndp.getAllOutTDF(nameOfComponent); +// } +// +// public String[] getAllInTDF(String nameOfComponent) { +// return elndp.getAllInTDF(nameOfComponent); +// } +// +// public String[] getAllOutDE(String nameOfComponent) { +// return elndp.getAllOutDE(nameOfComponent); +// } +// +// public String[] getAllInDE(String nameOfComponent) { +// return elndp.getAllInDE(nameOfComponent); +// } +} diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java index 2e824f3cfd1fb54388cab84a6f546c32e4754875..f5e76a81373a83a4305c71fbb42d98ff86b7ed88 100644 --- a/src/main/java/ui/GTURTLEModeling.java +++ b/src/main/java/ui/GTURTLEModeling.java @@ -116,6 +116,7 @@ import ui.prosmd.ProactiveSMDPanel; import ui.req.Requirement; import ui.req.RequirementDiagramPanel; import ui.sysmlsecmethodology.SysmlsecMethodologyDiagramPanel; +import ui.eln.*; import ui.tmlad.*; import ui.tmlcd.TMLTaskDiagramPanel; import ui.tmlcd.TMLTaskOperator; @@ -4706,7 +4707,35 @@ public class GTURTLEModeling { makePostLoading(camsp, beginIndex); } } + } else if (tdp instanceof ELNDiagramPanel) { + nl = doc.getElementsByTagName("ELNDiagramPanelCopy"); + if (nl == null) { + return; + } + + ELNDiagramPanel elndp = (ELNDiagramPanel) tdp; + + for (i = 0; i < nl.getLength(); i++) { + adn = nl.item(i); + if (adn.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) adn; + + if (elndp == null) { + throw new MalformedModelingException(); + } + + decX = _decX; + decY = _decY; + + makeXMLComponents(elt.getElementsByTagName("COMPONENT"), elndp); + makeXMLConnectors(elt.getElementsByTagName("CONNECTOR"), elndp); + makeXMLComponents(elt.getElementsByTagName("SUBCOMPONENT"), elndp); + connectConnectorsToRealPoints(elndp); + elndp.structureChanged(); + makePostLoading(elndp, beginIndex); + } + } } else if (tdp instanceof AvatarADPanel) { nl = doc.getElementsByTagName("AvatarADPanelCopy"); @@ -4915,6 +4944,8 @@ public class GTURTLEModeling { loadSysmlsecMethodology(node); } else if (type.compareTo("SystemC-AMS") == 0) { loadSysCAMS(node); + } else if (type.compareTo("ELN") == 0) { + loadELN(node); } else if (type.compareTo("TML Design") == 0) { loadTMLDesign(node); } else if (type.compareTo("TML Component Design") == 0) { @@ -5445,7 +5476,7 @@ public class GTURTLEModeling { } } - public void loadSysCAMS(Node node) throws MalformedModelingException, SAXException { + public void loadSysCAMS(Node node) throws MalformedModelingException, SAXException { Element elt = (Element) node; String nameTab; NodeList diagramNl; @@ -5472,6 +5503,33 @@ public class GTURTLEModeling { } } + public void loadELN(Node node) throws MalformedModelingException, SAXException { + Element elt = (Element) node; + String nameTab; + NodeList diagramNl; + int indexDesign; + + nameTab = elt.getAttribute("nameTab"); + + indexDesign = mgui.createELN(nameTab); + + diagramNl = node.getChildNodes(); + + for (int j = 0; j < diagramNl.getLength(); j++) { + //TraceManager.addDev("Design nodes: " + j); + node = diagramNl.item(j); + if (node.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) node; + if (elt.getTagName().compareTo("ELNDiagramPanel") == 0) { + // Class diagram + TraceManager.addDev("Loading ELN"); + loadELNDiagram(elt, indexDesign); + TraceManager.addDev("End loading ELN"); + } + } + } + } + public void loadTMLDesign(Node node) throws MalformedModelingException, SAXException { Element elt = (Element) node; String nameTab; @@ -5750,6 +5808,11 @@ public class GTURTLEModeling { //TraceManager.addDev("Connectors..."); ((SysCAMSComponentTaskDiagramPanel) tdp).setConnectorsToFront(); } + + if (tdp instanceof ELNDiagramPanel) { + //TraceManager.addDev("Connectors..."); + ((ELNDiagramPanel) tdp).setConnectorsToFront(); + } } // AVATAR @@ -5979,6 +6042,19 @@ public class GTURTLEModeling { loadDiagram(elt, tdp); } + + public void loadELNDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException { + String name; + TDiagramPanel tdp; + + // class diagram name + name = elt.getAttribute("name"); + mgui.setELNDiagramName(indexDesign, name); + tdp = mgui.getMainTDiagramPanel(indexDesign); + tdp.setName(name); + + loadDiagram(elt, tdp); + } public void loadTMLTaskDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException { diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java index 8ce95e55f52f8ae74eeff94d3f95b04bd8507c60..f0bee610bd15e5ffe247e28d4cafc47fc3c54be7 100644 --- a/src/main/java/ui/MainGUI.java +++ b/src/main/java/ui/MainGUI.java @@ -1076,6 +1076,22 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per return index; } + public int addELNDesignPanel(String name, int index) { + if (index == -1) { + index = tabs.size(); + } + ELNDesignPanel elndp = new ELNDesignPanel(this); + tabs.add(index, elndp); + mainTabbedPane.add(elndp.tabbedPane, index); + mainTabbedPane.setToolTipTextAt(index, "Open ELN design diagrams"); + mainTabbedPane.setTitleAt(index, name); + mainTabbedPane.setIconAt(index, IconManager.imgic60); + //mainTabbedPane.addTab(name, IconManager.imgic14, dp.tabbedPane, "Opens design diagrams"); + elndp.init(); + //ystem.out.println("Design added"); + return index; + } + //Return the list of all the TMLArchiDiagramPanels public Vector<TMLArchiPanel> getTMLArchiDiagramPanels() { @@ -1470,12 +1486,18 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per return index; } - public int createSysCAMSComponentDesign(String name) { + public int createSysCAMSComponentDesign(String name) { int index = addSysCAMSComponentDesignPanel(name, -1); mainTabbedPane.setSelectedIndex(index); return index; } + public int createELN(String name) { + int index = addELNDesignPanel(name, -1); + mainTabbedPane.setSelectedIndex(index); + return index; + } + public int createADD(String name) { int index = addADDPanel(name, -1); mainTabbedPane.setSelectedIndex(index); @@ -1863,7 +1885,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per //frame.repaint(); } - public void newSysCAMS() { + public void newSysCAMS() { //TraceManager.addDev("NEW DESIGN"); addSysCAMSComponentDesignPanel("SystemC_AMS", -1); tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0); @@ -1871,6 +1893,15 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per //paneAction(null); //frame.repaint(); } + + public void newELN() { + //TraceManager.addDev("NEW DESIGN"); + addELNDesignPanel("ELN", -1); + tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0); + mainTabbedPane.setSelectedIndex(tabs.size() - 1); + //paneAction(null); + //frame.repaint(); + } public void newADD() { //TraceManager.addDev("NEW Avatar deployment"); @@ -3846,6 +3877,44 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } } } + } else if (tp instanceof ELNDesignPanel) { + ELNDesignPanel elndp = (ELNDesignPanel) tp; + JDialogSelectELNComponent.validated = elndp.validated; + JDialogSelectELNComponent.ignored = elndp.ignored; + Vector<TGComponent> ELNComponentsToValidate = new Vector<TGComponent>(); + JDialogSelectELNComponent jdselnc = new JDialogSelectELNComponent(frame, ELNComponentsToValidate, elndp.elndp.getComponentList(), "Choosing ELN components to validate"); + if (!automatic) { + GraphicLib.centerOnParent(jdselnc); + jdselnc.setVisible(true); // Blocked until dialog has been closed + } else { + jdselnc.closeDialog(); + } + if (ELNComponentsToValidate.size() > 0) { + elndp.validated = JDialogSelectELNComponent.validated; + elndp.ignored = JDialogSelectELNComponent.ignored; +// b = gtm.translateSysCAMSComponentDesign(syscamsComponentsToValidate, syscamscdp, jdssyscamsc.getOptimize()); + expandToWarnings(); + expandToErrors(); + if (b) { + //setMode(MainGUI.MODEL_OK); + setMode(MainGUI.GEN_SYSTEMC_OK); + setMode(MainGUI.MODEL_OK); + ret = true; + if (!automatic) { + JOptionPane.showMessageDialog(frame, + "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate make proofs (safety, security and performance) or generate executable code", + "Syntax analysis successful on ELN designs", + JOptionPane.INFORMATION_MESSAGE); + } + } else { + if (!automatic) { + JOptionPane.showMessageDialog(frame, + "The ELN design contains several errors", + "Syntax analysis failed", + JOptionPane.INFORMATION_MESSAGE); + } + } + } } else if (tp instanceof TMLArchiPanel) { tmlap = (TMLArchiPanel) tp; JDialogSelectTMLNodes.validated = tmlap.validated; @@ -6102,6 +6171,21 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per return ll; } + public List<TGComponent> getAllELNComponents() { + TURTLEPanel tp; + List<TGComponent> ll = new LinkedList<TGComponent>(); + + for (int i = 0; i < tabs.size(); i++) { + tp = tabs.elementAt(i); + + if (tp instanceof ELNDesignPanel) { + ll.addAll(((ELNDesignPanel) tp).elndp.getComponentList()); + } + } + + return ll; + } + public ArrayList<SysCAMSComponentTaskDiagramPanel> getAllPanelsReferencingSysCAMSCompositeComponent(SysCAMSCompositeComponent syscamscc) { TURTLEPanel tp; ArrayList<SysCAMSComponentTaskDiagramPanel> foundPanels = new ArrayList<SysCAMSComponentTaskDiagramPanel>(); @@ -6416,10 +6500,15 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per tp.tabbedPane.setTitleAt(0, name); } - public void setSysCAMSComponentTaskDiagramName(int indexDesign, String name) { + public void setSysCAMSComponentTaskDiagramName(int indexDesign, String name) { TURTLEPanel tp = tabs.elementAt(indexDesign); tp.tabbedPane.setTitleAt(0, name); } + + public void setELNDiagramName(int indexDesign, String name) { + TURTLEPanel tp = tabs.elementAt(indexDesign); + tp.tabbedPane.setTitleAt(0, name); + } public void setTMLArchitectureDiagramName(int indexDesign, String name) { TURTLEPanel tp = tabs.elementAt(indexDesign); @@ -8935,7 +9024,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per private JPopupMenu menu; private JMenuItem rename, remove, moveRight, moveLeft, newDesign, newAnalysis, newDeployment, newRequirement/*, newTMLDesign*/, newTMLComponentDesign, newTMLArchi, newProactiveDesign, newTURTLEOSDesign, - newNCDesign, sort, clone, newAttackTree, newFaultTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo, newSysCAMS; + newNCDesign, sort, clone, newAttackTree, newFaultTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo, newSysCAMS, newELN; private JMenuItem newAVATARAnalysis; public PopupListener(MainGUI _mgui) { @@ -8993,7 +9082,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per newTMLComponentDesign = createMenuItem("New Partitioning - Functional view"); newTMLArchi = createMenuItem("New Partitioning - Architecture and Mapping"); newTMLCP = createMenuItem("New Partitioning - Communication Pattern"); - newSysCAMS = createMenuItem("New SystemC-AMS Block Diagram"); //ajout CD + newSysCAMS = createMenuItem("New SystemC-AMS Block Diagram"); + newELN = createMenuItem("New ELN Diagram"); newProactiveDesign = createMenuItem("New Proactive Design"); newTURTLEOSDesign = createMenuItem("New TURTLE-OS Design"); newNCDesign = createMenuItem("New Network Calculus Design"); @@ -9081,6 +9171,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per menu.add(newTMLArchi); menu.addSeparator(); menu.add(newSysCAMS); + menu.add(newELN); menu.addSeparator(); } } @@ -9231,7 +9322,10 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } else if (e.getSource() == newSysCAMS) { ModeManager.setMode(CREATE_NEW_PANEL, actions, mainBar, mgui); mgui.newSysCAMS(); - } + } else if (e.getSource() == newELN) { + ModeManager.setMode(CREATE_NEW_PANEL, actions, mainBar, mgui); + mgui.newELN(); + } } }; } diff --git a/src/main/java/ui/TDiagramPanel.java b/src/main/java/ui/TDiagramPanel.java index 73b5bffb1740d94257571d4331e74b930973456e..c38d4ad80b179e70a60accd8da42fb611ca41c3d 100755 --- a/src/main/java/ui/TDiagramPanel.java +++ b/src/main/java/ui/TDiagramPanel.java @@ -52,9 +52,9 @@ import ui.avatarmad.AvatarMADAssumption; import ui.avatarrd.AvatarRDRequirement; import ui.avatarsmd.AvatarSMDState; import ui.cd.*; -import ui.syscams.SysCAMSBlockDE; -import ui.syscams.SysCAMSBlockTDF; -import ui.syscams.SysCAMSCompositeComponent; +import ui.eln.*; +import ui.eln.sca_eln.*; +import ui.syscams.*; import ui.ncdd.NCEqNode; import ui.ncdd.NCRouteArtifact; import ui.ncdd.NCSwitchNode; @@ -2596,9 +2596,22 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { || (o instanceof TMLCRecordComponent && this.checkTMLCRecordComponent((TMLCRecordComponent) o, name)) || (o instanceof TMLCCompositeComponent && this.checkTMLCCompositeComponent((TMLCCompositeComponent) o, name)) || (o instanceof TMLTaskInterface && this.checkTMLTaskInterface((TMLTaskInterface) o, name)) - || (o instanceof SysCAMSBlockTDF && this.checkSysCAMSBlockTDFComponent((SysCAMSBlockTDF) o, name)) + || (o instanceof SysCAMSBlockTDF && this.checkSysCAMSBlockTDFComponent((SysCAMSBlockTDF) o, name)) || (o instanceof SysCAMSBlockDE && this.checkSysCAMSBlockDEComponent((SysCAMSBlockDE) o, name)) || (o instanceof SysCAMSCompositeComponent && this.checkSysCAMSCompositeComponent((SysCAMSCompositeComponent) o, name)) + || (o instanceof ELNComponentResistor && this.checkELNComponentResistor((ELNComponentResistor) o, name)) + || (o instanceof ELNComponentCapacitor && this.checkELNComponentCapacitor((ELNComponentCapacitor) o, name)) + || (o instanceof ELNComponentInductor && this.checkELNComponentInductor((ELNComponentInductor) o, name)) + || (o instanceof ELNComponentVoltageControlledVoltageSource && this.checkELNComponentVoltageControlledVoltageSource((ELNComponentVoltageControlledVoltageSource) o, name)) + || (o instanceof ELNComponentVoltageControlledCurrentSource && this.checkELNComponentVoltageControlledCurrentSource((ELNComponentVoltageControlledCurrentSource) o, name)) + || (o instanceof ELNComponentCurrentControlledVoltageSource && this.checkELNComponentCurrentControlledVoltageSource((ELNComponentCurrentControlledVoltageSource) o, name)) + || (o instanceof ELNComponentCurrentControlledCurrentSource && this.checkELNComponentCurrentControlledCurrentSource((ELNComponentCurrentControlledCurrentSource) o, name)) + || (o instanceof ELNComponentNullor && this.checkELNComponentNullor((ELNComponentNullor) o, name)) + || (o instanceof ELNComponentGyrator && this.checkELNComponentGyrator((ELNComponentGyrator) o, name)) + || (o instanceof ELNComponentIdealTransformer && this.checkELNComponentIdealTransformer((ELNComponentIdealTransformer) o, name)) + || (o instanceof ELNComponentTransmissionLine && this.checkELNComponentTransmissionLine ((ELNComponentTransmissionLine) o, name)) + || (o instanceof ELNComponentIndependentVoltageSource && this.checkELNComponentIndependentVoltageSource((ELNComponentIndependentVoltageSource) o, name)) + || (o instanceof ELNComponentIndependentCurrentSource && this.checkELNComponentIndependentCurrentSource((ELNComponentIndependentCurrentSource) o, name)) || (o instanceof ATDBlock && this.checkATDBlock((ATDBlock) o, name)) || (o instanceof AvatarBDBlock && this.checkAvatarBDBlock((AvatarBDBlock) o, name)) || (o instanceof AvatarCDBlock && this.checkAvatarCDBlock((AvatarCDBlock) o, name)) @@ -2660,6 +2673,58 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { return false; } + public boolean checkELNComponentResistor(ELNComponentResistor o, String name) { + return false; + } + + public boolean checkELNComponentCapacitor(ELNComponentCapacitor o, String name) { + return false; + } + + public boolean checkELNComponentInductor(ELNComponentInductor o, String name) { + return false; + } + + public boolean checkELNComponentVoltageControlledVoltageSource(ELNComponentVoltageControlledVoltageSource o, String name) { + return false; + } + + public boolean checkELNComponentVoltageControlledCurrentSource(ELNComponentVoltageControlledCurrentSource o, String name) { + return false; + } + + public boolean checkELNComponentCurrentControlledVoltageSource(ELNComponentCurrentControlledVoltageSource o, String name) { + return false; + } + + public boolean checkELNComponentCurrentControlledCurrentSource(ELNComponentCurrentControlledCurrentSource o, String name) { + return false; + } + + public boolean checkELNComponentNullor(ELNComponentNullor o, String name) { + return false; + } + + public boolean checkELNComponentGyrator(ELNComponentGyrator o, String name) { + return false; + } + + public boolean checkELNComponentIdealTransformer(ELNComponentIdealTransformer o, String name) { + return false; + } + + public boolean checkELNComponentTransmissionLine(ELNComponentTransmissionLine o, String name) { + return false; + } + + public boolean checkELNComponentIndependentVoltageSource(ELNComponentIndependentVoltageSource o, String name) { + return false; + } + + public boolean checkELNComponentIndependentCurrentSource(ELNComponentIndependentCurrentSource o, String name) { + return false; + } + public boolean checkATDBlock(ATDBlock o, String name) { return false; } @@ -2782,7 +2847,7 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { }); } - public String findSysCAMSPrimitiveComponentName(String name) { + public String findSysCAMSPrimitiveComponentName(String name) { return this.findGoodName(name, new NameChecker() { public boolean checkSysCAMSBlockTDFComponent(SysCAMSBlockTDF o, String name) { return o.getValue().equals(name); @@ -2801,6 +2866,50 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { }); } + public String findELNComponentName(String name) { + return this.findGoodName(name, new NameChecker() { + public boolean checkELNComponentResistor(ELNComponentResistor o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentCapacitor(ELNComponentCapacitor o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentInductor(ELNComponentInductor o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentVoltageControlledVoltageSource(ELNComponentVoltageControlledVoltageSource o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentVoltageControlledCurrentSource(ELNComponentVoltageControlledCurrentSource o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentCurrentControlledVoltageSource(ELNComponentCurrentControlledVoltageSource o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentCurrentControlledCurrentSource(ELNComponentCurrentControlledCurrentSource o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentNullor(ELNComponentNullor o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentGyrator(ELNComponentGyrator o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentIdealTransformer(ELNComponentIdealTransformer o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentTransmissionLine(ELNComponentTransmissionLine o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentIndependentVoltageSource(ELNComponentIndependentVoltageSource o, String name) { + return o.getValue().equals(name); + } + public boolean checkELNComponentIndependentCurrentSource(ELNComponentIndependentCurrentSource o, String name) { + return o.getValue().equals(name); + } + }); + } + public String findBlockName(String name) { return this.findGoodName(name, new NameChecker() { public boolean checkATDBlock(ATDBlock o, String name) { diff --git a/src/main/java/ui/TGComponentManager.java b/src/main/java/ui/TGComponentManager.java index 875b88510636b976d8cbb4de636ac0a27237b8f6..6e7dce642a4e0a0cd860b4887f90861ec372a6d9 100644 --- a/src/main/java/ui/TGComponentManager.java +++ b/src/main/java/ui/TGComponentManager.java @@ -59,6 +59,8 @@ import ui.dd.TDDNode; import ui.dd.TGConnectorLinkNode; import ui.diplodocusmethodology.*; import ui.ebrdd.*; +import ui.eln.*; +import ui.eln.sca_eln.*; import ui.ftd.*; import ui.iod.*; import ui.ncdd.*; @@ -342,6 +344,22 @@ public class TGComponentManager { public static final int CAMS_PORT_CONVERTER = 1606; public static final int CAMS_CLUSTER = 1607; + // ELN + public static final int ELN_CONNECTOR = 1610; + public static final int ELN_RESISTOR = 1611; + public static final int ELN_CAPACITOR = 1612; + public static final int ELN_INDUCTOR = 1613; + public static final int ELN_VOLTAGE_CONTROLLED_VOLTAGE_SOURCE = 1614; + public static final int ELN_VOLTAGE_CONTROLLED_CURRENT_SOURCE = 1615; + public static final int ELN_CURRENT_CONTROLLED_VOLTAGE_SOURCE = 1616; + public static final int ELN_CURRENT_CONTROLLED_CURRENT_SOURCE = 1617; + public static final int ELN_NULLOR = 1618; + public static final int ELN_GYRATOR = 1619; + public static final int ELN_IDEAL_TRANSFORMER = 1620; + public static final int ELN_TRANSMISSION_LINE = 1621; + public static final int ELN_INDEPENDENT_VOLTAGE_SOURCE = 1622; + public static final int ELN_INDEPENDENT_CURRENT_SOURCE = 1623; + // SMD diagram public static final int PROSMD_START_STATE = 2000; public static final int PROSMD_STOP_STATE = 2001; @@ -1251,6 +1269,46 @@ public class TGComponentManager { case CAMS_CLUSTER: tgc = new SysCAMSCompositeComponent(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; + // ELN + case ELN_RESISTOR: + tgc = new ELNComponentResistor(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_CAPACITOR: + tgc = new ELNComponentCapacitor(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_INDUCTOR: + tgc = new ELNComponentInductor(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_VOLTAGE_CONTROLLED_VOLTAGE_SOURCE: + tgc = new ELNComponentVoltageControlledVoltageSource(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_VOLTAGE_CONTROLLED_CURRENT_SOURCE: + tgc = new ELNComponentVoltageControlledCurrentSource(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_CURRENT_CONTROLLED_VOLTAGE_SOURCE: + tgc = new ELNComponentCurrentControlledVoltageSource(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_CURRENT_CONTROLLED_CURRENT_SOURCE: + tgc = new ELNComponentCurrentControlledCurrentSource(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_NULLOR: + tgc = new ELNComponentNullor(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_GYRATOR: + tgc = new ELNComponentGyrator(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_IDEAL_TRANSFORMER: + tgc = new ELNComponentIdealTransformer(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_TRANSMISSION_LINE: + tgc = new ELNComponentTransmissionLine(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_INDEPENDENT_VOLTAGE_SOURCE: + tgc = new ELNComponentIndependentVoltageSource(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case ELN_INDEPENDENT_CURRENT_SOURCE: + tgc = new ELNComponentIndependentCurrentSource(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; // Communication patterns + SD case TMLCP_CHOICE: tgc = new TMLCPChoice(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); @@ -1646,7 +1704,37 @@ public class TGComponentManager { } else if (tgc instanceof SysCAMSCompositeComponent) { return CAMS_CLUSTER; - // Others + // ELN + } else if (tgc instanceof ELNConnector) { + return ELN_CONNECTOR; + } else if (tgc instanceof ELNComponentResistor) { + return ELN_RESISTOR; + } else if (tgc instanceof ELNComponentCapacitor) { + return ELN_CAPACITOR; + } else if (tgc instanceof ELNComponentInductor) { + return ELN_INDUCTOR; + } else if (tgc instanceof ELNComponentInductor) { + return ELN_VOLTAGE_CONTROLLED_VOLTAGE_SOURCE; + } else if (tgc instanceof ELNComponentInductor) { + return ELN_VOLTAGE_CONTROLLED_CURRENT_SOURCE; + } else if (tgc instanceof ELNComponentInductor) { + return ELN_CURRENT_CONTROLLED_VOLTAGE_SOURCE; + } else if (tgc instanceof ELNComponentInductor) { + return ELN_CURRENT_CONTROLLED_CURRENT_SOURCE; + } else if (tgc instanceof ELNComponentNullor) { + return ELN_NULLOR; + } else if (tgc instanceof ELNComponentGyrator) { + return ELN_GYRATOR; + } else if (tgc instanceof ELNComponentIdealTransformer) { + return ELN_IDEAL_TRANSFORMER; + } else if (tgc instanceof ELNComponentTransmissionLine) { + return ELN_TRANSMISSION_LINE; + } else if (tgc instanceof ELNComponentIndependentVoltageSource) { + return ELN_INDEPENDENT_VOLTAGE_SOURCE; + } else if (tgc instanceof ELNComponentIndependentCurrentSource) { + return ELN_INDEPENDENT_CURRENT_SOURCE; + + // Others } else if (tgc instanceof TADDeterministicDelay) { return TAD_DETERMINISTIC_DELAY; } else if (tgc instanceof TADParallel) { @@ -2339,6 +2427,9 @@ public class TGComponentManager { case CAMS_CONNECTOR: tgc = new SysCAMSPortConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); break; + case ELN_CONNECTOR: + tgc = new ELNConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + break; case CONNECTOR_NODE_TMLARCHI: tgc = new TMLArchiConnectorNode(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); break; diff --git a/src/main/java/ui/TGUIAction.java b/src/main/java/ui/TGUIAction.java index f98927cb5b3caeb3ebb98e349b602d95976fd749..9a3cc2e26c9a07ad827c94008d0bc51247d03ed1 100644 --- a/src/main/java/ui/TGUIAction.java +++ b/src/main/java/ui/TGUIAction.java @@ -284,7 +284,24 @@ public class TGUIAction extends AbstractAction { public static final int CAMS_PORT_CONVERTER = 479; public static final int CAMS_CLUSTER = 480; public static final int CAMS_GENCODE = 481; - + + // ELN + public static final int ELN_EDIT = 482; + public static final int ELN_CONNECTOR = 483; + public static final int ELN_RESISTOR = 484; + public static final int ELN_CAPACITOR = 485; + public static final int ELN_INDUCTOR = 486; + public static final int ELN_VOLTAGE_CONTROLLED_VOLTAGE_SOURCE = 487; + public static final int ELN_VOLTAGE_CONTROLLED_CURRENT_SOURCE = 488; + public static final int ELN_CURRENT_CONTROLLED_VOLTAGE_SOURCE = 489; + public static final int ELN_CURRENT_CONTROLLED_CURRENT_SOURCE = 490; + public static final int ELN_NULLOR = 491; + public static final int ELN_GYRATOR = 492; + public static final int ELN_IDEAL_TRANSFORMER = 493; + public static final int ELN_TRANSMISSION_LINE = 494; + public static final int ELN_INDEPENDENT_VOLTAGE_SOURCE = 495; + public static final int ELN_INDEPENDENT_CURRENT_SOURCE = 496; + public static final int EBRDD_EDIT = 271; public static final int EBRDD_CONNECTOR = 272; public static final int EBRDD_START = 273; @@ -637,7 +654,7 @@ public class TGUIAction extends AbstractAction { public static final int MOVE_ENABLED = 463; public static final int FIRST_DIAGRAM = 464; - public static final int NB_ACTION = 482; + public static final int NB_ACTION = 497; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -1094,7 +1111,7 @@ public class TGUIAction extends AbstractAction { actions[TMLSD_CONTROLLER_INSTANCE] = new TAction("add-controller-instance-tmlsd", "Controller instance", IconManager.imgic500, IconManager.imgic500, "Controller instance", "Add a controller instance to the currently opened communication pattern sequence diagram", 0); actions[TMLSD_ACTION_STATE] = new TAction("add-action-tmlsd", "Action state", IconManager.imgic512, IconManager.imgic512, "Action state", "Add an action state to the currently opened communication pattern sequence diagram", 0); - //System C-AMS + // System C-AMS actions[CAMS_EDIT] = new TAction("add-action-C-AMS", "Action state", IconManager.imgic100, IconManager.imgic101, "Action state", "Add an action state to the currently opened SystemC-AMS diagram", 0); actions[CAMS_BLOCK_TDF] = new TAction("C-AMS-block-TDF", "Add a TDF block", IconManager.imgic8007, IconManager.imgic8007, "TDF block", "Add a TDF block to the currently opened SystemC-AMS Diagram", 0); actions[CAMS_BLOCK_DE] = new TAction("C-AMS-block-DE", "Add a DE block", IconManager.imgic8008, IconManager.imgic8008, "DE block", "Add a DE block to the currently opened SystemC-AMS Diagram", 0); @@ -1105,6 +1122,23 @@ public class TGUIAction extends AbstractAction { actions[CAMS_CLUSTER] = new TAction("C-AMS-cluster", "Add a cluster", IconManager.imgic8006, IconManager.imgic8006, "Cluster", "Add a cluster to the currently opened SystemC-AMS Diagram", 0); actions[CAMS_GENCODE] = new TAction("GENCODE", "GENCODE",IconManager.imgic94, IconManager.imgic94, "Generate SystemC-AMS code", "SystemC-AMS diagram without check syntax", 0); + // ELN + actions[ELN_EDIT] = new TAction("add-action-eln", "Action state", IconManager.imgic100, IconManager.imgic101, "Action state", "Add an action state to the currently opened ELN diagram", 0); + actions[ELN_CONNECTOR] = new TAction("eln-connector", "Add a connection", IconManager.imgic202, IconManager.imgic202, "Connector", "Connects two block of the currently opened ELN Diagram", 0); + actions[ELN_RESISTOR] = new TAction("eln-resistor", "Add a resistor", IconManager.imgic8010, IconManager.imgic8010, "Resistor", "Add a resistor to the currently opened ELN Diagram", 0); + actions[ELN_CAPACITOR] = new TAction("eln-capacitor", "Add a capacitor", IconManager.imgic8011, IconManager.imgic8011, "Capacitor", "Add a capacitor to the currently opened ELN Diagram", 0); + actions[ELN_INDUCTOR] = new TAction("eln-inductor", "Add a inductor", IconManager.imgic8012, IconManager.imgic8012, "Self", "Add a inductor to the currently opened ELN Diagram", 0); + actions[ELN_VOLTAGE_CONTROLLED_VOLTAGE_SOURCE] = new TAction("eln-VCVS", "Add a voltage controlled voltage source", IconManager.imgic8013, IconManager.imgic8013, "Voltage controlled voltage source", "Add a voltage controlled voltage source to the currently opened ELN Diagram", 0); + actions[ELN_VOLTAGE_CONTROLLED_CURRENT_SOURCE] = new TAction("eln-VCCS", "Add a voltage controlled current source", IconManager.imgic8014, IconManager.imgic8014, "Voltage controlled current source", "Add a voltage controlled current source to the currently opened ELN Diagram", 0); + actions[ELN_CURRENT_CONTROLLED_VOLTAGE_SOURCE] = new TAction("eln-CCVS", "Add a current controlled voltage source", IconManager.imgic8015, IconManager.imgic8015, "Current controlled voltage source", "Add a current controlled voltage source to the currently opened ELN Diagram", 0); + actions[ELN_CURRENT_CONTROLLED_CURRENT_SOURCE] = new TAction("eln-CCCS", "Add a current controlled current source", IconManager.imgic8016, IconManager.imgic8016, "Current controlled current source", "Add a current controlled current source to the currently opened ELN Diagram", 0); + actions[ELN_NULLOR] = new TAction("eln-nullor", "Add a nullor", IconManager.imgic8017, IconManager.imgic8017, "Nullor", "Add a nullor to the currently opened ELN Diagram", 0); + actions[ELN_GYRATOR] = new TAction("eln-gyrator", "Add a gyrator", IconManager.imgic8018, IconManager.imgic8018, "Gyrator", "Add a gyrator to the currently opened ELN Diagram", 0); + actions[ELN_IDEAL_TRANSFORMER] = new TAction("eln-ideal-transformer", "Add a ideal transformer", IconManager.imgic8019, IconManager.imgic8019, "Ideal transformer", "Add a ideal transformer to the currently opened ELN Diagram", 0); + actions[ELN_TRANSMISSION_LINE] = new TAction("eln-transmission-line", "Add a transmission line", IconManager.imgic8020, IconManager.imgic8020, "Transmission line", "Add a transmission line to the currently opened ELN Diagram", 0); + actions[ELN_INDEPENDENT_VOLTAGE_SOURCE] = new TAction("eln-vsource", "Add a independent voltage source", IconManager.imgic8021, IconManager.imgic8021, "Independent voltage source", "Add a independent voltage source to the currently opened ELN Diagram", 0); + actions[ELN_INDEPENDENT_CURRENT_SOURCE] = new TAction("eln-isource", "Add a independent current source", IconManager.imgic8022, IconManager.imgic8022, "Independent current source", "Add a independent current source to the currently opened ELN Diagram", 0); + //ProActive State Machine Diagram actions[PROSMD_EDIT] = new TAction("edit-prosmd-diagram", "Edit ProActive state machine diagram", IconManager.imgic100, IconManager.imgic101, "Edit ProActive state machine diagram", "Make it possible to edit the currently opened ProActive state machine diagram", 0); actions[PROSMD_START] = new TAction("add-prosmd-start", "Add Start state", IconManager.imgic222, IconManager.imgic222, "Start", "Add a start state to the currently opened ProActive state machine diagram", 0);