Skip to content
Snippets Groups Projects
Commit f22998dc authored by apvrille's avatar apvrille
Browse files

Update on variable modif avatar simu

parent fea27dc6
No related branches found
No related tags found
No related merge requests found
...@@ -127,6 +127,10 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS ...@@ -127,6 +127,10 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS
private int totalNbOfElements = -1; private int totalNbOfElements = -1;
// Edition of variable value
protected JMenuItem edit;
protected int selectedRow;
//private String[] cpuIDs, busIDs, memIDs, taskIDs, chanIDs; //private String[] cpuIDs, busIDs, memIDs, taskIDs, chanIDs;
...@@ -807,13 +811,14 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS ...@@ -807,13 +811,14 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS
JTablejtablePIV.clearSelection(); JTablejtablePIV.clearSelection();
} }
int rowindex = JTablejtablePIV.getSelectedRow(); int selectedRow = JTablejtablePIV.getSelectedRow();
if (rowindex < 0) if (selectedRow < 0)
return; return;
if (e.getComponent() instanceof JTable) { if (e.getComponent() instanceof JTable) {
TraceManager.addDev("Popup at x=" + e.getX() + " y=" + e.getY()); TraceManager.addDev("Popup at x=" + e.getX() + " y=" + e.getY());
//JPopupMenu popup = createYourPopUp(); JPopupMenu popup = createVariablePopup();
//popup.show(e.getComponent(), e.getX(), e.getY()); popup.show(e.getComponent(), e.getX(), e.getY());
} }
} }
}); });
...@@ -2157,6 +2162,8 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS ...@@ -2157,6 +2162,8 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS
} else if (evt.getSource() == down) { } else if (evt.getSource() == down) {
TraceManager.addDev("Source = up"); TraceManager.addDev("Source = up");
downAsyncMsg(); downAsyncMsg();
} else if (evt.getSource() == edit) {
TraceManager.addDev("Edit variable at index: " + selectedRow);
} }
// Check for source of jcheckbox // Check for source of jcheckbox
...@@ -2271,6 +2278,16 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS ...@@ -2271,6 +2278,16 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements AvatarS
} }
private JPopupMenu createVariablePopup() {
JPopupMenu menu = new JPopupMenu("Change variable value");
edit = new JMenuItem("Edit variable value");
edit.setActionCommand("edit");
edit.addActionListener(this);
menu.add(edit);
return menu;
}
public void windowClosing(WindowEvent e) { public void windowClosing(WindowEvent e) {
TraceManager.addDev("Windows closed!"); TraceManager.addDev("Windows closed!");
close(); close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment