diff --git a/modeling/AVATAR/CoffeeMachine_Avatar.xml b/modeling/AVATAR/CoffeeMachine_Avatar.xml index c84292d8b987d52620edeb34d0fe08d3f72578b0..9dc6a280f25704237e6a8bf8ba406adb10be84d4 100644 --- a/modeling/AVATAR/CoffeeMachine_Avatar.xml +++ b/modeling/AVATAR/CoffeeMachine_Avatar.xml @@ -1459,7 +1459,7 @@ <MainCode value="}"/> <Optimized value="true" /> <considerTimingOperators value="true" /> -<Validated value="Wallet;CoffeeMachine;CoffeeButton;TeaButton;" /> +<Validated value="" /> <Ignored value="" /> <CONNECTOR type="5002" id="771" index="0" uid="f480e606-bbb6-4ab7-8f89-8abb37ff40bb" > diff --git a/src/main/java/ai/AIChatData.java b/src/main/java/ai/AIChatData.java index 7cb22e32df67a2021d0fb70d29e4812cf3901f36..38570c34ab8a487b59157e7568c88e4577808fd0 100644 --- a/src/main/java/ai/AIChatData.java +++ b/src/main/java/ai/AIChatData.java @@ -59,8 +59,8 @@ import javax.swing.*; public class AIChatData { - public AIInterface aiinterface; + public boolean knowledgeOnProperties = false; public int knowledgeOnBlockJSON = -1; public boolean knowledgeOnAMULET = false; diff --git a/src/main/java/ui/window/JFrameAI.java b/src/main/java/ui/window/JFrameAI.java index 658f9711b61e074f298e44b9358078f99cbfd237..b8716b111de6020542150dbb3281f536ebc33863 100644 --- a/src/main/java/ui/window/JFrameAI.java +++ b/src/main/java/ui/window/JFrameAI.java @@ -46,6 +46,7 @@ import ai.AISysMLV2DiagramContent; import avatartranslator.AvatarSpecification; import help.HelpEntry; import help.HelpManager; +import myutil.AIInterface; import myutil.GraphicLib; import myutil.TraceManager; import ui.*; @@ -78,15 +79,21 @@ public class JFrameAI extends JFrame implements ActionListener { private static String[] POSSIBLE_ACTIONS = {"Chat - Chat on any topic you like, or help the AI give a better answer on a previous question", "Identify requirements - Provide a system specification", "Classify requirements - select a" + " requirement diagram first", + "Identify use cases", "Identify properties - Select a block diagram first. You can also provide a system specification", "Identify system blocks - Provide a system specification", "Identify software blocks - Provide a system specification", "Identify state" + - " machines - Select a block diagram. Additionally, you can provide a system specification", "A(I)MULET - Select a block diagram first"}; + " machines - Select a block diagram. Additionally, you can provide a system specification", + "A(I)MULET - Select a block diagram first"}; - private static String[] AIInteractClass = {"AIChat", "AIReqIdent", "AIReqClassification", "AIDesignPropertyIdentification", "AIBlock", + private static String[] AIInteractClass = {"AIChat", "AIReqIdent", "AIReqClassification", "AIChat", "AIDesignPropertyIdentification", "AIBlock", "AISoftwareBlock", "AIStateMachine", "AIAmulet"}; private static String[] INFOS = {"Chat on any topic you like", "Identify requirements from the specification of a system", "Classify " + - "requirements from a requirement diagram", "Identify the typical properties to be proven from a block diagram", "Identify the system " + + "requirements from a requirement diagram", "Identify use cases and actors from a system specification", + "Identify the typical properties" + + " to be proven " + + "from a block" + + " diagram", "Identify the system " + "blocks from a specification", "Identify the software blocks from a specification", "Identify the state machines from a system " + "specification and a block diagram", "Formalize mutations to be performed on a block diagram"}; @@ -303,10 +310,17 @@ public class JFrameAI extends JFrame implements ActionListener { currentChatIndex = answerPane.getSelectedIndex(); ChatData selected = selectedChat(); - if (selected.makeAIChatData()) { + boolean chatDataMade = selected.aiChatData != null; + + if (!chatDataMade) { + chatDataMade = selected.makeAIChatData(); + } + + if (chatDataMade) { String selectedClass = AIInteractClass[listOfPossibleActions.getSelectedIndex()]; selected.aiInteract = ai.AIInteract.getInstance("ai." + selectedClass, selected.aiChatData); + if (selected.aiInteract == null) { error("Unknow selected type"); return; @@ -358,6 +372,8 @@ public class JFrameAI extends JFrame implements ActionListener { applyRequirementClassification(); } else if (selectedChat.aiInteract instanceof ai.AIDesignPropertyIdentification) { // nothing up to now :-) + } else if (selectedChat.aiInteract instanceof ai.AIStateMachine) { + // nothing up to now :-) } else if (selectedChat.aiInteract instanceof ai.AIAmulet) { applyMutations(); } @@ -482,7 +498,10 @@ public class JFrameAI extends JFrame implements ActionListener { private void printInfos() { int index = listOfPossibleActions.getSelectedIndex(); + Font tmpFont = console.getFont(); + console.setFont(tmpFont.deriveFont(Font.BOLD)); GraphicLib.appendToPane(console, "Your selection: " + INFOS[index] + "\n", Color.darkGray); + console.setFont(tmpFont); } private void setOptionsJTextPane(JTextPane jta, boolean _isEditable) {