diff --git a/build.txt b/build.txt index c5638be4d597fd2a9965137aa587ab79c07d0596..adb468b6415a4feb173e6e187ae6c2182612db3c 100644 --- a/build.txt +++ b/build.txt @@ -1 +1 @@ -14744 \ No newline at end of file +14746 \ No newline at end of file diff --git a/src/main/java/attacktrees/Attack.java b/src/main/java/attacktrees/Attack.java index 5898e0b8082ad33ff922cb6cfd090d7e82331c0c..0ce8d9dcd5f974ec8b69e1bb1139b966fd9ddd01 100644 --- a/src/main/java/attacktrees/Attack.java +++ b/src/main/java/attacktrees/Attack.java @@ -62,6 +62,7 @@ public class Attack extends AttackElement { private ArrayList<AttackNode> destinationNodes; private boolean isRoot; private boolean isEnabled = true; + private String description; private int attackCost; private int attackExperience; @@ -81,6 +82,14 @@ public class Attack extends AttackElement { isRoot = _root; } + public String getDescription() { + return description; + } + + public void setDescription(String _description) { + description = _description; + } + public boolean isEnabled() { return isEnabled; } diff --git a/src/main/java/attacktrees/AttackNode.java b/src/main/java/attacktrees/AttackNode.java index 7ef31226721c33d484e8717fcf97e7b3a215d87c..e1b11daeb2fe9a3ab0295ea9c197bafe9857aa14 100644 --- a/src/main/java/attacktrees/AttackNode.java +++ b/src/main/java/attacktrees/AttackNode.java @@ -76,6 +76,9 @@ public abstract class AttackNode extends AttackElement { } + public String getType() { + return type; + } public void setResultingAttack(Attack _attack) { resultingAttack = _attack; } diff --git a/src/main/java/ui/atd/ATDAttack.java b/src/main/java/ui/atd/ATDAttack.java index 4e2350d7096e4f028a6a5548129a4a84c95f151c..ace420d7f80770ea0845ae08be4e8c2158df5198 100644 --- a/src/main/java/ui/atd/ATDAttack.java +++ b/src/main/java/ui/atd/ATDAttack.java @@ -455,7 +455,10 @@ CanBeDisabled*/ { return isRootAttack; } - public void setIsRootAttack(boolean bool) { isRootAttack = bool; } + public void setRootAttack(boolean _isRootAttack) { + isRootAttack = _isRootAttack; + } + public void wasUnswallowed() { setFather(null); diff --git a/src/main/java/ui/atd/ATDConstraint.java b/src/main/java/ui/atd/ATDConstraint.java index 48a716f4ca237a150642601c757c50d42a0e9b10..7101c3b781aeb47722012afb8e4830ff2a0baf25 100644 --- a/src/main/java/ui/atd/ATDConstraint.java +++ b/src/main/java/ui/atd/ATDConstraint.java @@ -253,6 +253,18 @@ public class ATDConstraint extends TGCScalableWithInternalComponent implements S return (value.compareTo(STEREOTYPES[5]) == 0); } + public void setType(String _type) { + _type = _type.toUpperCase(); + + for(int i=STEREOTYPES.length-1; i>0; i--) { + if (STEREOTYPES[i].indexOf(_type) > - 1) { + value = STEREOTYPES[i]; + break; + } + } + value = STEREOTYPES[0]; + } + protected String translateExtraParam() { StringBuffer sb = new StringBuffer("<extraparam>\n"); sb.append("<info equation=\"" + GTURTLEModeling.transformString(getEquation())); diff --git a/src/main/java/ui/atd/AttackTreeDiagramPanel.java b/src/main/java/ui/atd/AttackTreeDiagramPanel.java index cbfe3ac9b6107ef8cc43a8895fd9372d7c8056f0..a68f5f205166692335050b6e57820530d2acd23b 100644 --- a/src/main/java/ui/atd/AttackTreeDiagramPanel.java +++ b/src/main/java/ui/atd/AttackTreeDiagramPanel.java @@ -203,13 +203,8 @@ public class AttackTreeDiagramPanel extends TDiagramPanel implements TDPWithAttr // We draw the attack ATDAttack attack = new ATDAttack(_x, _y, getMinX(), getMaxX(), getMinY(), getMaxY(), true, null, this); attack.setValue(_att.getName()); - attack.setIsRootAttack(_att.isRoot()); - - String attackDesc = _att.getDescription(); - if (!attackDesc.isEmpty()) { - attack.setDescription(attackDesc); - } - + attack.setRootAttack(_att.isRoot()); + attack.setDescription(_att.getDescription()); addBuiltComponent(attack); _mapOfComponents.put(_att, attack); @@ -253,11 +248,8 @@ public class AttackTreeDiagramPanel extends TDiagramPanel implements TDPWithAttr // We create the ATDConstraint _y = _y + 70; ATDConstraint constraint = new ATDConstraint(_x, _y, getMinX(), getMaxX(), getMinY(), getMaxY(), true, null, this); - - String contraintType = "<<" + nextNode.getType() + ">>"; - constraint.setValue(contraintType); - - + //constraint.setValue(nextNode.getName()); + constraint.setType(nextNode.getType()); addBuiltComponent(constraint); _mapOfComponents.put(nextNode, constraint); diff --git a/src/main/java/ui/util/DefaultText.java b/src/main/java/ui/util/DefaultText.java index 83d21a09f222eaeaff65691b1ebf95a7b78795a3..0e625d686ea7b08d325a534420e260e302158093 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 = "14743"; - public static String DATE = "2024/04/09 03:22:30 CET"; + public static String BUILD = "14745"; + public static String DATE = "2024/04/11 03:22:09 CET"; public static StringBuffer sbAbout = makeAbout(); diff --git a/src/main/java/ui/window/JFrameAI.java b/src/main/java/ui/window/JFrameAI.java index cbed87d77cadf83712e998a515155691d043a61d..84f520725c6db07ddb64517419f4e8e30d7693f3 100644 --- a/src/main/java/ui/window/JFrameAI.java +++ b/src/main/java/ui/window/JFrameAI.java @@ -218,6 +218,7 @@ public class JFrameAI extends JFrame implements ActionListener { chatPanelAction.add(listOfPossibleActions); panelTop.add(chatPanelAction, BorderLayout.CENTER); listOfPossibleActions.addActionListener(this); + listOfPossibleActions.setMinimumSize(new Dimension(50, 100)); JPanel modelSelectionPanel = new JPanel(); modelSelectionPanel.add(new JLabel("Selected AI model:"));