Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
f22998dc
Commit
f22998dc
authored
6 years ago
by
apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Update on variable modif avatar simu
parent
fea27dc6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java
+21
-4
21 additions, 4 deletions
...eractivesimulation/JFrameAvatarInteractiveSimulation.java
with
21 additions
and
4 deletions
src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java
+
21
−
4
View file @
f22998dc
...
@@ -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 = create
Your
Pop
U
p();
JPopupMenu
popup
=
create
Variable
Pop
u
p
();
//
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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment