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
682204a5
Commit
682204a5
authored
4 years ago
by
Le Van Truong
Browse files
Options
Downloads
Patches
Plain Diff
fix sequential diagram display
parent
231c62f1
No related branches found
No related tags found
1 merge request
!332
add run until read/write channel access
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ui/interactivesimulation/JSimulationTMLPanel.java
+25
-6
25 additions, 6 deletions
...in/java/ui/interactivesimulation/JSimulationTMLPanel.java
with
25 additions
and
6 deletions
src/main/java/ui/interactivesimulation/JSimulationTMLPanel.java
+
25
−
6
View file @
682204a5
...
@@ -69,8 +69,8 @@ import java.util.LinkedHashMap;
...
@@ -69,8 +69,8 @@ import java.util.LinkedHashMap;
*/
*/
public
class
JSimulationTMLPanel
extends
JPanel
implements
MouseMotionListener
,
Runnable
{
public
class
JSimulationTMLPanel
extends
JPanel
implements
MouseMotionListener
,
Runnable
{
private
static
int
MAX_X
=
8
00
;
private
static
int
MAX_X
=
16
00
;
private
static
int
MAX_Y
=
2
00
;
private
static
int
MAX_Y
=
4
00
;
private
static
long
stamp
=
0
;
private
static
long
stamp
=
0
;
private
int
maxX
=
MAX_X
;
private
int
maxX
=
MAX_X
;
...
@@ -78,9 +78,9 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
...
@@ -78,9 +78,9 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
private
final
static
int
limit
=
10
;
private
final
static
int
limit
=
10
;
// Drawing parameters
// Drawing parameters
private
final
static
int
minSpaceBetweenLifeLines
=
5
;
private
final
static
int
minSpaceBetweenLifeLines
=
5
0
;
private
final
static
int
verticalSpaceUnderBlocks
=
15
;
private
final
static
int
verticalSpaceUnderBlocks
=
15
0
;
private
int
spaceBetweenLifeLines
=
15
0
;
private
int
spaceBetweenLifeLines
=
30
0
;
private
boolean
spaceBetweenLifeLinesComputed
=
false
;
private
boolean
spaceBetweenLifeLinesComputed
=
false
;
private
int
spaceAtEnd
=
50
;
private
int
spaceAtEnd
=
50
;
private
int
spaceAtTop
=
50
;
private
int
spaceAtTop
=
50
;
...
@@ -105,6 +105,8 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
...
@@ -105,6 +105,8 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
private
Vector
<
Point
>
points
;
private
Vector
<
Point
>
points
;
private
Vector
<
GenericTransaction
>
transactionsOfPoints
;
private
Vector
<
GenericTransaction
>
transactionsOfPoints
;
private
Hashtable
<
String
,
Point
>
asyncMsgs
;
private
Hashtable
<
String
,
Point
>
asyncMsgs
;
private
Hashtable
<
String
,
Long
>
asyncStartTime
;
private
boolean
checkMessID
;
// List of entities ... List is discovered progressively
// List of entities ... List is discovered progressively
// Or the list is described in the trace (header information)
// Or the list is described in the trace (header information)
...
@@ -135,7 +137,8 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
...
@@ -135,7 +137,8 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
points
=
new
Vector
<>();
points
=
new
Vector
<>();
asyncMsgs
=
new
Hashtable
<>();
asyncMsgs
=
new
Hashtable
<>();
asyncStartTime
=
new
Hashtable
<>();
checkMessID
=
true
;
mode
=
NO_MODE
;
mode
=
NO_MODE
;
setBackground
(
Color
.
WHITE
);
setBackground
(
Color
.
WHITE
);
...
@@ -326,6 +329,22 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
...
@@ -326,6 +329,22 @@ public class JSimulationTMLPanel extends JPanel implements MouseMotionListener,
clockValueMouse
=
clockValue
;
clockValueMouse
=
clockValue
;
g
.
drawString
(
"@"
+
clockValue
/
clockDiviser
,
10
,
currentY
+
g
.
getFontMetrics
().
getHeight
()/
2
);
g
.
drawString
(
"@"
+
clockValue
/
clockDiviser
,
10
,
currentY
+
g
.
getFontMetrics
().
getHeight
()/
2
);
}
}
if
(
checkMessID
)
{
for
(
int
i
=
Math
.
max
(
transactions
.
size
()
-
drawnTransactions
,
0
);
i
<
transactions
.
size
();
i
++)
{
gt
=
transactions
.
get
(
i
);
if
(
gt
.
type
==
GenericTransaction
.
SEND_ASYNCHRO
)
{
asyncStartTime
.
put
(
gt
.
messageID
,
gt
.
startingTime
);
}
}
for
(
int
i
=
Math
.
max
(
transactions
.
size
()
-
drawnTransactions
,
0
);
i
<
transactions
.
size
();
i
++)
{
gt
=
transactions
.
get
(
i
);
if
(
gt
.
type
==
GenericTransaction
.
RECEIVE_ASYNCHRO
)
{
if
(
asyncStartTime
.
get
(
gt
.
messageID
)
==
null
||
gt
.
startingTime
<
asyncStartTime
.
get
(
gt
.
messageID
))
gt
.
messageID
=
String
.
valueOf
(
new
Integer
(
gt
.
messageID
)
-
1
);
}
}
}
checkMessID
=
false
;
for
(
int
i
=
Math
.
max
(
transactions
.
size
()-
drawnTransactions
,
0
);
i
<
transactions
.
size
();
i
++)
{
for
(
int
i
=
Math
.
max
(
transactions
.
size
()-
drawnTransactions
,
0
);
i
<
transactions
.
size
();
i
++)
{
gt
=
transactions
.
get
(
i
);
gt
=
transactions
.
get
(
i
);
...
...
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