Skip to content
Snippets Groups Projects
Commit 4c811307 authored by Minh Hiep Pham's avatar Minh Hiep Pham :speech_balloon:
Browse files

added operation question mark in CPU node + fixed help text in JDialogPragma

parent d530b4b0
No related branches found
No related tags found
1 merge request!116added operation question mark in CPU node and fixed help text in JDialogPragma
...@@ -211,6 +211,9 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener { ...@@ -211,6 +211,9 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
JTextArea jft16 = new JTextArea("CPU Extension Construct"); JTextArea jft16 = new JTextArea("CPU Extension Construct");
instructionHelpList.add(jft16); instructionHelpList.add(jft16);
JTextArea jft17 = new JTextArea("Operation");
instructionHelpList.add(jft17);
for(int i = 0; i < instructionHelpList.size(); i++) { for(int i = 0; i < instructionHelpList.size(); i++) {
Icon myIcon = IconManager.imgic32; Icon myIcon = IconManager.imgic32;
JButton but = new JButton(myIcon); JButton but = new JButton(myIcon);
...@@ -512,10 +515,18 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener { ...@@ -512,10 +515,18 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
// operation // operation
c4.gridwidth = 1; c4.gridwidth = 1;
panel4.add(new JLabel("Operation:"), c4); panel4.add(new JLabel("Operation:"), c4);
c4.gridwidth = GridBagConstraints.REMAINDER; //end row //c4.gridwidth = GridBagConstraints.REMAINDER; //end row
operation = new JTextField(""+node.getOperation(), 15); operation = new JTextField(""+node.getOperation(), 15);
panel4.add(operation, c4); panel4.add(operation, c4);
//issue 183
c4.weighty = 0.5;
c4.weightx = 0.5;
c4.gridwidth = GridBagConstraints.REMAINDER;
panel4.add(buttons.get(16),c4);
c4.weighty = 1.0;
c4.weightx = 1.0;
// extension constructs // extension constructs
c4.gridwidth = 1; c4.gridwidth = 1;
panel4.add(new JLabel("CPU Extension Construct:"), c4); panel4.add(new JLabel("CPU Extension Construct:"), c4);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
package ui.window; package ui.window;
import myutil.TraceManager;
import ui.util.IconManager; import ui.util.IconManager;
import javax.swing.*; import javax.swing.*;
...@@ -308,6 +309,7 @@ public class JDialogPragma extends JDialogBase implements ActionListener { ...@@ -308,6 +309,7 @@ public class JDialogPragma extends JDialogBase implements ActionListener {
//setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); //setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
helpPopup = new JPopupMenu(); helpPopup = new JPopupMenu();
JTextArea jft = new JTextArea("Pragma Guidelines: \n #Authenticity: Compare if two Attributes are equal at given states \n #Confidentiality: Query whether the attacker knows the value of this attribute. \n #PublicConstant: Declare string as public constant \n #PrivateConstant: Declare string as private constant \n #InitialSessionKnowledge: Knowledge at the start of each session\n #InitialSystemKnowledge: Knowledge at the start of the system \n #PrivatePublicKeys: Set two attribute of a block as Private and Public Key respectively \n #Public: Declare variable public \n #SecrecyAssumption: Assume attribute confidential, but query to verify \n #Secret: See #Confidentiality"); JTextArea jft = new JTextArea("Pragma Guidelines: \n #Authenticity: Compare if two Attributes are equal at given states \n #Confidentiality: Query whether the attacker knows the value of this attribute. \n #PublicConstant: Declare string as public constant \n #PrivateConstant: Declare string as private constant \n #InitialSessionKnowledge: Knowledge at the start of each session\n #InitialSystemKnowledge: Knowledge at the start of the system \n #PrivatePublicKeys: Set two attribute of a block as Private and Public Key respectively \n #Public: Declare variable public \n #SecrecyAssumption: Assume attribute confidential, but query to verify \n #Secret: See #Confidentiality");
jft.setEditable(false);
helpPopup.add(jft); helpPopup.add(jft);
textarea = new JTextArea(); textarea = new JTextArea();
...@@ -387,6 +389,15 @@ public class JDialogPragma extends JDialogBase implements ActionListener { ...@@ -387,6 +389,15 @@ public class JDialogPragma extends JDialogBase implements ActionListener {
help(); help();
} }
}); });
helpPopup.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "closeJTextArea");
helpPopup.getActionMap().put("closeJTextArea", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
helpPopup.setVisible(false);
}
});
JPanel jp = new JPanel(); JPanel jp = new JPanel();
jp.add(cancel); jp.add(cancel);
jp.add(close); jp.add(close);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment