diff --git a/build.txt b/build.txt index bbb544062a10a8b6dfaa66ad74750753d969a638..33fde8bf587dd3eb313383025cc3de54eea08cfc 100644 --- a/build.txt +++ b/build.txt @@ -1 +1 @@ -12680 \ No newline at end of file +12683 \ No newline at end of file diff --git a/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java b/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java index 46f98e7aae524b706f9d17d2b43df083d223383e..e0768d667d19fda7306dc536c89194b5b6e2d5b2 100644 --- a/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java +++ b/src/main/java/avatartranslator/directsimulation/AvatarSimulationBlock.java @@ -697,7 +697,8 @@ public class AvatarSimulationBlock { TraceManager.addDev("Current block " + this.getBlock().getName() + " lastTransaction=" + lastTransaction); } - boolean result = bee.getResultOf(act); + boolean result = bee.getResultOfWithIntExpr(act); + //boolean result = bee.getResultOf(act); if (bee.getError() != null) { TraceManager.addDev("Error: " + bee.getError()); } diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java index 0b4b2d654ca0f515bc009abee023aff52944ad16..bf3fd49ab2ed50cc43dced25ec7520e26101c9db 100644 --- a/src/main/java/ui/MainGUI.java +++ b/src/main/java/ui/MainGUI.java @@ -151,7 +151,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per public JFrame frame; //Main Frame public Container framePanel; //Main pane public Container panelForTab, panelForTree; //panelForAnalysisTab; //panelForDesignTab; - public JSplitPane split; + public JSplitPane split, split1; // Multi analysis / design / deployment public Vector<TURTLEPanel> tabs; @@ -346,6 +346,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per _uppaalOn, boolean _ncOn, boolean _avatarOn, boolean _proverifOn, boolean _avatarOnly, boolean _experimental) { openLast = _openLast; + TraceManager.addDev("openLast=" + openLast); turtleOn = _turtleOn; systemcOn = _systemcOn; lotosOn = _lotosOn; @@ -521,13 +522,18 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per scrollPane.setMinimumSize(new Dimension(25, 200)); jbp = new JBirdPanel(this); jbp.setPreferredSize(new Dimension(200, 200)); - JSplitPane split1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, scrollPane, jbp); + split1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, scrollPane, jbp); - //split1.setLastDividerLocation(500); + //split1.setDividerLocation(700); + split1.setResizeWeight(0.1); + //split1.setOneTouchExpandable(true); //panelForTree.add(scrollPane, BorderLayout.CENTER); split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, split1, panelForTab); framePanel.add(split, BorderLayout.CENTER); + split.setDividerLocation(250); + split1.setResizeWeight(0.9); + split.setOneTouchExpandable(true); //split1.resetToPreferredSizes(); // Creating menus @@ -535,12 +541,14 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per frame.setJMenuBar(jmenubarturtle); // if openLast, must open the latest specification (if it exists) - if (ConfigurationTTool.LastOpenFileDefined) { + if ((ConfigurationTTool.LastOpenFileDefined) && (openLast)) { openLastProject(); + dtree.update(); + //split1.setDividerLocation(600); + //split.setDividerLocation(220); } - //split1.setLastDividerLocation(split1.getHeight() * 4 / 5); - //split1.setLastDividerLocation(900); + // // ToolBar //toolbarDesign = new Vector(); @@ -1713,6 +1721,12 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } frame.setVisible(true); + + //split1.setDividerLocation(0.90); + //split.setDividerLocation(0.2); + + + } public void newTurtleModeling() { diff --git a/src/main/java/ui/avatarrd/AvatarRDRequirement.java b/src/main/java/ui/avatarrd/AvatarRDRequirement.java index 1b2e7a7412737b4fa45236a62f564cca26fef17e..ec15a91a8c2a66058b56887caf7f23b0b989293b 100755 --- a/src/main/java/ui/avatarrd/AvatarRDRequirement.java +++ b/src/main/java/ui/avatarrd/AvatarRDRequirement.java @@ -54,6 +54,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; import java.util.LinkedList; /** @@ -84,8 +85,8 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem private int currentFontSize = -1; private boolean displayText = true; - protected final static String[] REQ_TYPE_STR = {"<<Requirement>>", "<<Safety Requirement>>", "<<Security Requirement>>"}; - protected final static int NB_REQ_TYPE = 3; + protected static String[] REQ_TYPE_STR = {"<<Requirement>>", "<<SafetyRequirement>>", "<<SecurityRequirement>>"}; + protected static int NB_REQ_TYPE = 3; protected final static int REGULAR_REQ = 0; protected final static int SAFETY_REQ = 1; @@ -105,8 +106,8 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem protected String referenceElements = ""; protected String id = ""; - protected LinkedList<String> extraParamIDs; - protected LinkedList<String> extraParamValues; + protected ArrayList<String> extraParamIDs; + protected ArrayList<String> extraParamValues; protected boolean satisfied = false; protected boolean verified = false; @@ -137,8 +138,8 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem minWidth = 1; minHeight = lineHeight; - extraParamIDs = new LinkedList<>(); - extraParamValues = new LinkedList<>(); + extraParamIDs = new ArrayList<>(); + extraParamValues = new ArrayList<>(); nbConnectingPoint = 40; connectingPoint = new TGConnectingPoint[nbConnectingPoint]; @@ -353,6 +354,15 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem } } + // Extra attributes + for (i = 0; i < extraParamIDs.size(); i++) { + if (size < (height - 2)) { + s = extraParamIDs.get(i) + ":" + extraParamValues.get(i); + drawLimitedString(g, s, x + textX, y + size, width, 0); + } + size += currentFontSize; + + } g.setFont(f); } @@ -451,6 +461,27 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem kind = jdr.getKind(); criticality = jdr.getCriticality(); + // Filling extra attributes + String extras = jdr.getExtraAttributes(); + extraParamValues.clear(); + extraParamIDs.clear(); + String[] lines = extras.split(System.getProperty("line.separator")); + for(String line: lines) { + int index0 = line.indexOf(':'); + if (index0 > -1) { + String id = line.substring(0, index0).trim(); + if (id.length() > 0) { + String val = line.substring(index0+1, line.length()).trim(); + if (val.length() > 0) { + extraParamIDs.add(id); + extraParamValues.add(val); + } + + } + } + } + + makeValue(); return true; } @@ -624,6 +655,13 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem sb.append("<referenceElements data=\""); sb.append(referenceElements); sb.append("\" />\n"); + for(int i=0; i<extraParamIDs.size(); i++) { + sb.append("<extraAttribute id=\""); + sb.append(extraParamIDs.get(i)); + sb.append("\" value=\""); + sb.append(extraParamValues.get(i)); + sb.append("\" />\n"); + } sb.append("</extraparam>\n"); return new String(sb); } @@ -684,6 +722,18 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem if (referenceElements.equals("null")) { referenceElements = ""; } + + } else if (elt.getTagName().equals("extraAttribute")) { + // + String tmp1 = elt.getAttribute("id"); + String tmp2 = elt.getAttribute("value"); + if ((tmp1 != null) && (tmp2 != null)) { + if (tmp1.length() > 0) { + extraParamIDs.add(tmp1); + extraParamValues.add(tmp2); + } + } + } else if (elt.getTagName().equals("reqType")) { // s = elt.getAttribute("data"); @@ -789,6 +839,10 @@ public class AvatarRDRequirement extends TGCScalableWithInternalComponent implem if (reqType == SECURITY_REQ) { attr += "Attack tree node(s)= " + attackTreeNode + "\n"; } + for(int i=0; i<extraParamIDs.size(); i++) { + attr += extraParamIDs.get(i) + ": " + extraParamValues.get(i) + "\n"; + } + return attr; } diff --git a/src/main/java/ui/tmldd/TMLArchiBUSNode.java b/src/main/java/ui/tmldd/TMLArchiBUSNode.java index cbeab82a107888378014ef0c2ee0053aeca8f328..401a636bd9d33df55a59ee4f775e459711ac89c4 100755 --- a/src/main/java/ui/tmldd/TMLArchiBUSNode.java +++ b/src/main/java/ui/tmldd/TMLArchiBUSNode.java @@ -153,7 +153,7 @@ public class TMLArchiBUSNode extends TMLArchiCommunicationNode implements Swallo // Icon //g.drawImage(IconManager.imgic1102.getImage(), x + width - 20, y + 4, null); g.drawImage(IconManager.imgic1102.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); + //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); c = g.getColor(); diff --git a/src/main/java/ui/tmldd/TMLArchiBridgeNode.java b/src/main/java/ui/tmldd/TMLArchiBridgeNode.java index 4a16d83d79ef94194f1def9ebb17d6a38bc02729..a2e3d9c73f2832446b002c1b8e77cad64a320ffd 100755 --- a/src/main/java/ui/tmldd/TMLArchiBridgeNode.java +++ b/src/main/java/ui/tmldd/TMLArchiBridgeNode.java @@ -143,7 +143,7 @@ public class TMLArchiBridgeNode extends TMLArchiCommunicationNode implements Swa // Icon //g.drawImage(IconManager.imgic1104.getImage(), x + width - 20, y + 4, null); g.drawImage(IconManager.imgic1104.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); + //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/main/java/ui/tmldd/TMLArchiCPUNode.java b/src/main/java/ui/tmldd/TMLArchiCPUNode.java index c98b722da614504985554198c96e3973974e1525..d6a51eaddaa9f8105cf5d7b38984da10f28fbcb8 100755 --- a/src/main/java/ui/tmldd/TMLArchiCPUNode.java +++ b/src/main/java/ui/tmldd/TMLArchiCPUNode.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,14 +31,12 @@ * 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.tmldd; import myutil.GraphicLib; @@ -56,11 +54,12 @@ import java.awt.*; import java.util.Vector; /** - * Class TMLArchiCPUNode - * Node. To be used in TML architecture diagrams. - * Creation: 02/05/2005 - * @version 1.1 21/05/2008 - * @author Ludovic APVRILLE + * Class TMLArchiCPUNode + * Node. To be used in TML architecture diagrams. + * Creation: 02/05/2005 + * + * @author Ludovic APVRILLE + * @version 1.1 21/05/2008 */ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, WithAttributes, TMLArchiElementInterface { private int textY1 = 15; @@ -82,7 +81,8 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, private int execcTime = HwCPU.DEFAULT_EXECC_TIME; private int cacheMiss = HwCPU.DEFAULT_CACHE_MISS; private int encryption = HwCPU.ENCRYPTION_NONE; - public TMLArchiCPUNode(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + + public TMLArchiCPUNode(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); width = 250; @@ -142,22 +142,22 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, // Filling color g.setColor(ColorManager.CPU_BOX_1); - g.fill3DRect(x+1, y+1, width-1, height-1, true); + g.fill3DRect(x + 1, y + 1, width - 1, height - 1, true); g.setColor(c); // Strings String ster = "<<" + stereotype + ">>"; - int w = g.getFontMetrics().stringWidth(ster); + int w = g.getFontMetrics().stringWidth(ster); Font f = g.getFont(); g.setFont(f.deriveFont(Font.BOLD)); - g.drawString(ster, x + (width - w)/2, y + textY1); + g.drawString(ster, x + (width - w) / 2, y + textY1); g.setFont(f); - w = g.getFontMetrics().stringWidth(name); - g.drawString(name, x + (width - w)/2, y + textY2); + w = g.getFontMetrics().stringWidth(name); + g.drawString(name, x + (width - w) / 2, y + textY2); // Icon g.drawImage(IconManager.imgic1100.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); + //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { @@ -191,11 +191,11 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, int tmp; String tmpName; - JDialogCPUNode dialog = new JDialogCPUNode(frame, "Setting CPU attributes", this, MECType, transactions ); + JDialogCPUNode dialog = new JDialogCPUNode(frame, "Setting CPU attributes", this, MECType, transactions); dialog.setSize(500, 450); - GraphicLib.centerOnParent(dialog, 500, 450 ); - // dialog.show(); // blocked until dialog has been closed - dialog.setVisible( true ); + GraphicLib.centerOnParent(dialog, 500, 450); + // dialog.show(); // blocked until dialog has been closed + dialog.setVisible(true); MECType = dialog.getMECType(); if (!dialog.isRegularClose()) { @@ -404,9 +404,9 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, encryption = dialog.getEncryption(); if (error) { JOptionPane.showMessageDialog(frame, - "Invalid value for the following attributes: " + errors, - "Error", - JOptionPane.INFORMATION_MESSAGE); + "Invalid value for the following attributes: " + errors, + "Error", + JOptionPane.INFORMATION_MESSAGE); return false; } @@ -444,17 +444,17 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, public Vector<TMLArchiArtifact> getArtifactList() { Vector<TMLArchiArtifact> v = new Vector<TMLArchiArtifact>(); - - for(int i=0; i<nbInternalTGComponent; i++) { + + for (int i = 0; i < nbInternalTGComponent; i++) { if (tgcomponent[i] instanceof TMLArchiArtifact) { - v.add( (TMLArchiArtifact) tgcomponent[i] ); + v.add((TMLArchiArtifact) tgcomponent[i]); } } return v; } public void hasBeenResized() { - for(int i=0; i<nbInternalTGComponent; i++) { + for (int i = 0; i < nbInternalTGComponent; i++) { if (tgcomponent[i] instanceof TMLArchiArtifact) { tgcomponent[i].resizeWithFather(); } @@ -486,24 +486,24 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, } @Override - public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException { // try { NodeList nli; Node n1, n2; Element elt; - // int t1id; + // int t1id; String sstereotype = null, snodeName = null; - for(int i=0; i<nl.getLength(); i++) { + for (int i = 0; i < nl.getLength(); i++) { n1 = nl.item(i); // if (n1.getNodeType() == Node.ELEMENT_NODE) { nli = n1.getChildNodes(); // Issue #17 copy-paste error on j index - for(int j=0; j<nli.getLength(); j++) { + for (int j = 0; j < nli.getLength(); j++) { n2 = nli.item(j); // if (n2.getNodeType() == Node.ELEMENT_NODE) { @@ -515,7 +515,7 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, if (sstereotype != null) { stereotype = sstereotype; } - if (snodeName != null){ + if (snodeName != null) { name = snodeName; } @@ -526,38 +526,37 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, } catch (Exception e) { } byteDataSize = Integer.decode(elt.getAttribute("byteDataSize")).intValue(); - schedulingPolicy =Integer.decode(elt.getAttribute("schedulingPolicy")).intValue(); + schedulingPolicy = Integer.decode(elt.getAttribute("schedulingPolicy")).intValue(); goIdleTime = Integer.decode(elt.getAttribute("goIdleTime")).intValue(); pipelineSize = Integer.decode(elt.getAttribute("pipelineSize")).intValue(); taskSwitchingTime = Integer.decode(elt.getAttribute("taskSwitchingTime")).intValue(); branchingPredictionPenalty = Integer.decode(elt.getAttribute("branchingPredictionPenalty")).intValue(); - if ((elt.getAttribute("cacheMiss") != null) && (elt.getAttribute("cacheMiss").length() > 0)){ + if ((elt.getAttribute("cacheMiss") != null) && (elt.getAttribute("cacheMiss").length() > 0)) { cacheMiss = Integer.decode(elt.getAttribute("cacheMiss")).intValue(); } - if ((elt.getAttribute("execiTime") != null) && (elt.getAttribute("execiTime").length() > 0)){ + if ((elt.getAttribute("execiTime") != null) && (elt.getAttribute("execiTime").length() > 0)) { execiTime = Integer.decode(elt.getAttribute("execiTime")).intValue(); } - if ((elt.getAttribute("execcTime") != null) && (elt.getAttribute("execcTime").length() > 0)){ + if ((elt.getAttribute("execcTime") != null) && (elt.getAttribute("execcTime").length() > 0)) { execcTime = Integer.decode(elt.getAttribute("execcTime")).intValue(); } - if ((elt.getAttribute("maxConsecutiveIdleCycles") != null) && (elt.getAttribute("maxConsecutiveIdleCycles").length() > 0)){ + if ((elt.getAttribute("maxConsecutiveIdleCycles") != null) && (elt.getAttribute("maxConsecutiveIdleCycles").length() > 0)) { maxConsecutiveIdleCycles = Integer.decode(elt.getAttribute("maxConsecutiveIdleCycles")).intValue(); } - if ((elt.getAttribute("clockRatio") != null) && (elt.getAttribute("clockRatio").length() > 0)){ + if ((elt.getAttribute("clockRatio") != null) && (elt.getAttribute("clockRatio").length() > 0)) { clockRatio = Integer.decode(elt.getAttribute("clockRatio")).intValue(); } - if ((elt.getAttribute("MECType") != null) && (elt.getAttribute("MECType").length() > 0)){ - if( elt.getAttribute("MECType").length() > 1 ) { //old format + if ((elt.getAttribute("MECType") != null) && (elt.getAttribute("MECType").length() > 0)) { + if (elt.getAttribute("MECType").length() > 1) { //old format MECType = ArchUnitMEC.Types.get(0); - } - else { - MECType = ArchUnitMEC.Types.get( Integer.valueOf( elt.getAttribute("MECType") ) ); + } else { + MECType = ArchUnitMEC.Types.get(Integer.valueOf(elt.getAttribute("MECType"))); } } - if ((elt.getAttribute("sliceTime") != null) && (elt.getAttribute("sliceTime").length() > 0)){ + if ((elt.getAttribute("sliceTime") != null) && (elt.getAttribute("sliceTime").length() > 0)) { sliceTime = Integer.decode(elt.getAttribute("sliceTime")).intValue(); } - if ((elt.getAttribute("encryption") != null) && (elt.getAttribute("encryption").length() > 0)){ + if ((elt.getAttribute("encryption") != null) && (elt.getAttribute("encryption").length() > 0)) { encryption = Integer.decode(elt.getAttribute("encryption")).intValue(); } } @@ -575,55 +574,55 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, return TGComponentManager.CONNECTOR_NODE_TMLARCHI; } - public int getNbOfCores(){ + public int getNbOfCores() { return nbOfCores; } - public int getByteDataSize(){ + public int getByteDataSize() { return byteDataSize; } - public int getPipelineSize(){ + public int getPipelineSize() { return pipelineSize; } - public int getGoIdleTime(){ + public int getGoIdleTime() { return goIdleTime; } - public int getMaxConsecutiveIdleCycles(){ + public int getMaxConsecutiveIdleCycles() { return maxConsecutiveIdleCycles; } - public int getExeciTime(){ + public int getExeciTime() { return execiTime; } - public int getExeccTime(){ + public int getExeccTime() { return execcTime; } - public int getTaskSwitchingTime(){ + public int getTaskSwitchingTime() { return taskSwitchingTime; } - public int getBranchingPredictionPenalty(){ + public int getBranchingPredictionPenalty() { return branchingPredictionPenalty; } - public int getCacheMiss(){ + public int getCacheMiss() { return cacheMiss; } - public int getSchedulingPolicy(){ + public int getSchedulingPolicy() { return schedulingPolicy; } - public int getSliceTime(){ + public int getSliceTime() { return sliceTime; } - public int getEncryption(){ + public int getEncryption() { return encryption; } @@ -645,12 +644,12 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent, attr += "Cache miss (in %) = " + cacheMiss + "\n"; attr += "Clock divider = " + clockRatio + "\n"; attr += "MECType = " + MECType.getIndex() + "\n"; - attr += "encryption = " + encryption+ "\n"; + attr += "encryption = " + encryption + "\n"; return attr; } - public int getComponentType() { + public int getComponentType() { return CONTROLLER; } diff --git a/src/main/java/ui/tmldd/TMLArchiDMANode.java b/src/main/java/ui/tmldd/TMLArchiDMANode.java index e13dd8e3f1798dc3f454155ab1f260fd9c8a7d73..56b2613910d6f924b2b96e630462598fae653322 100755 --- a/src/main/java/ui/tmldd/TMLArchiDMANode.java +++ b/src/main/java/ui/tmldd/TMLArchiDMANode.java @@ -145,7 +145,7 @@ public class TMLArchiDMANode extends TMLArchiCommunicationNode implements Swallo // Icon //g.drawImage(IconManager.imgic1108.getImage(), x + width - 20, y + 4, null); g.drawImage(IconManager.imgic1108.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); + //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/main/java/ui/tmldd/TMLArchiFPGANode.java b/src/main/java/ui/tmldd/TMLArchiFPGANode.java index d62361c6fa7732e7414c9954aae738f3d53e2053..0f75348ccd0ffa510866a18740784eaacd4b021f 100755 --- a/src/main/java/ui/tmldd/TMLArchiFPGANode.java +++ b/src/main/java/ui/tmldd/TMLArchiFPGANode.java @@ -154,7 +154,7 @@ public class TMLArchiFPGANode extends TMLArchiNode implements SwallowTGComponent // Icon g.drawImage(IconManager.imgic1120.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); + //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/main/java/ui/tmldd/TMLArchiFirewallNode.java b/src/main/java/ui/tmldd/TMLArchiFirewallNode.java index 5eed19e5398d45b1a33cb0287be36a7ed60dfe1a..6546aa40cfe3fbdae956b3b8d3524fd0ef8349ab 100644 --- a/src/main/java/ui/tmldd/TMLArchiFirewallNode.java +++ b/src/main/java/ui/tmldd/TMLArchiFirewallNode.java @@ -141,7 +141,7 @@ public class TMLArchiFirewallNode extends TMLArchiCommunicationNode implements S // Icon g.drawImage(IconManager.imgic7001.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); + //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/main/java/ui/tmldd/TMLArchiMemoryNode.java b/src/main/java/ui/tmldd/TMLArchiMemoryNode.java index d370ae492a6d68fbee961b52219eeeed34eb86e2..c9ee0d6c7322cb34926fe4a435a7949333a68556 100755 --- a/src/main/java/ui/tmldd/TMLArchiMemoryNode.java +++ b/src/main/java/ui/tmldd/TMLArchiMemoryNode.java @@ -147,7 +147,7 @@ public class TMLArchiMemoryNode extends TMLArchiCommunicationNode implements Swa // Icon //g.drawImage(IconManager.imgic1108.getImage(), x + width - 20, y + 4, null); g.drawImage(IconManager.imgic1108.getImage(), x + 4, y + 4, null); - g.drawImage(IconManager.img9, x + width - 20, y + 4, null); + //g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/main/java/ui/util/DefaultText.java b/src/main/java/ui/util/DefaultText.java index f2f7b017ee7401f52bdbaec10b1e5e5fc25baea3..1a97da72b27407025dfdd590f7d4e0cef1c85110 100755 --- a/src/main/java/ui/util/DefaultText.java +++ b/src/main/java/ui/util/DefaultText.java @@ -50,8 +50,8 @@ package ui.util; */ public class DefaultText { - public static String BUILD = "12679"; - public static String DATE = "2018/07/03 02:01:37 CET"; + public static String BUILD = "12682"; + public static String DATE = "2018/07/04 02:01:36 CET"; public static StringBuffer sbAbout = makeAbout(); diff --git a/src/main/java/ui/window/JDialogRequirement.java b/src/main/java/ui/window/JDialogRequirement.java index bc1134b9025001c2f18671a0142b64a27d4069a0..e07cd02f7ed12ea59bcfca4ce560499eac15fc68 100755 --- a/src/main/java/ui/window/JDialogRequirement.java +++ b/src/main/java/ui/window/JDialogRequirement.java @@ -47,6 +47,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; import java.util.LinkedList; //import javax.swing.event.*; @@ -76,8 +77,9 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { private String id; private int type; - protected LinkedList<String> extraParamIDs, extraParamValues; - protected LinkedList<JTextField> extraParamTextFields; + protected ArrayList<String> extraParamIDs, extraParamValues; + protected JTextArea jtaAttributes; + //protected ArrayList<JTextField> extraParamTextFieldIDs, extraParamTextFieldValues; // Panel1 protected JTextArea jta; @@ -90,7 +92,7 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { /** Creates new form */ public JDialogRequirement(Frame _frame, String _title, String _id, String _text, String _kind, String _criticality, String _violatedAction, int - _type, String _attackTreeNode, String _referenceElements, LinkedList<String> _extraParamIDs, LinkedList<String> _extraParamValues) { + _type, String _attackTreeNode, String _referenceElements, ArrayList<String> _extraParamIDs, ArrayList<String> _extraParamValues) { super(_frame, _title, true); frame = _frame; id = _id; @@ -104,7 +106,8 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { extraParamIDs = _extraParamIDs; extraParamValues = _extraParamValues; - extraParamTextFields = new LinkedList<JTextField>(); + //extraParamTextFieldIDs = new ArrayList<JTextField>(); + //extraParamTextFieldValues = new ArrayList<JTextField>(); initComponents(); myInitComponents(); @@ -173,11 +176,26 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { jta.setTabSize(3); jta.append(text); jta.setFont(new Font("times", Font.PLAIN, 12)); - + + JScrollPane jsp = new JScrollPane(jta, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); //jsp.setPreferredSize(new Dimension(300, 200)); panel1.add(jsp, c1); //} + + panel1.add(new JLabel("Extra attributes. ID:Value (in one line)"), c1); + jtaAttributes = new JTextArea(); + jtaAttributes.setEditable(true); + jtaAttributes.setMargin(new Insets(10, 10, 10, 10)); + jtaAttributes.setTabSize(3); + for(int k=0; k<extraParamIDs.size(); k++) { + jtaAttributes.append(extraParamIDs.get(k)+ ": " + extraParamValues.get(k)); + } + jtaAttributes.setFont(new Font("times", Font.PLAIN, 12)); + + jsp = new JScrollPane(jtaAttributes, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); + //jsp.setPreferredSize(new Dimension(300, 200)); + panel1.add(jsp, c1); // Panel2 c2.gridwidth = 1; @@ -365,5 +383,9 @@ public class JDialogRequirement extends JDialogBase implements ActionListener { public String getReferenceElements() { return referenceElementsBox.getText(); } + + public String getExtraAttributes() { + return jtaAttributes.getText(); + } } diff --git a/ttool/src/main/java/Main.java b/ttool/src/main/java/Main.java index 2305375662df490fccf3a7613f8b11d98a7c0a67..734848f695291730d546a81026ef98bf95dcfa91 100755 --- a/ttool/src/main/java/Main.java +++ b/ttool/src/main/java/Main.java @@ -322,8 +322,8 @@ public class Main implements ActionListener { } // Checking for update - TToolUpdater tu = new TToolUpdater(mainGUI.frame); - tu.start(); + //TToolUpdater tu = new TToolUpdater(mainGUI.frame); + //tu.start(); } public synchronized void waitFinish() {