File: timeline.jgr

package info (click to toggle)
jgraph 83-25
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,008 kB
  • sloc: ansic: 4,596; makefile: 145; sh: 106; awk: 104
file content (90 lines) | stat: -rw-r--r-- 2,376 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(* This is a jgraph of the sending of messages in a multicomputer over
   a period of time.  It is a good mixture of picture drawing and graph-
   drawing:  Note that hash marks and a legend is employed, as is the drawing
   of multiple arrowed lines, and some text.
 *)
newgraph

(* Draw the three time lines with hash ticks.  Only draw hash labels on
   the bottom-most one *)

yaxis size 1.6 min 0 max 2 nodraw
xaxis size 4.5 min 0.5 max 10.5 nodraw 
   draw_hash_marks draw_hash_labels draw_axis_label
   hash 1 mhash 0 shash 0 hash_scale -.4
   label : Time
copygraph xaxis draw_at 1 nodraw draw_hash_marks
copygraph xaxis draw_at 2

(* Reset the axes to draw the picture *)

copygraph
xaxis size 4.5 min 99.5 max 109.5 nodraw

(* Define the legend entries *)

newline linethickness .5 linetype dashed 
         rarrows asize 0.19 0.04 label font Times-Italic : mCL Marker
copycurve linetype dotdash label : mNSmarker
copycurve linetype dotted label : mS Message
copycurve linetype solid label : Normal Message
legend linelength 1

(* Draw each process's time line arrow *)

newline linethickness .5 rarrows 
  pts 99.5 0 109.5 0
copycurve pts 99.5 1 109.5 1
copycurve pts 99.5 2 109.5 2

(* Draw the time line processor labels *)

newstring fontsize 9 hjl vjc x 99 y 2 : Pc
copystring y 1 : P1
copystring y 0 : P2

(* Draw the initial broadcast of mcl messages *)

newline linethickness .5 linetype dashed 
         rarrows asize 0.19 0.04 pts 100 2 102 1
copycurve pts 100 2 102 0

(* Draw Message from p2 -> p1 *)

copycurve linetype solid pts 101 0 103 1

(* Draw mns messages to p1 *)

copycurve linetype dotdash pts 100 2 104 1
copycurve pts 102 0 104 1

(* Draw Message from p2 -> pc *)

copycurve linetype dashed pts 105 0 106 2
copycurve linetype solid pts 105.1 0 106.1 2

(* Draw mns messages from p1 *)

copycurve linetype dotdash pts 104 1 107 0
copycurve pts 104 1 107 2

(* Draw mc's -> pc *)

copycurve linetype dotted pts 104 1 108 2
copycurve pts 107 0 108 2

(* Draw mc from pc *)

copycurve pts 108 2 109 1
copycurve pts 108 2 109 0

(* Draw labels for m and m' *)

newstring fontsize 9 font Times-Italic x 102.05 y .5 hjl vjt : m
copystring x 105.6 y .75 hjl vjc : m'

copystring x 105.6 y 2.15 hjr vjc : Pc doesn't log m'
copystring x 103.4 y 1.35 hjl vjb : P1 logs m

copycurve linetype solid pts 105.7 2.15 106.1 2
copycurve pts 103.38 1.32 103 1