source: trunk/Jgraph/complex-examples/timeline.jgr

Last change on this file was 419, checked in by Nicholas Riley, 16 years ago

Jgraph: Debian changes by pzn@…

File size: 2.3 KB
Line 
1(* This is a jgraph of the sending of messages in a multicomputer over
2 a period of time. It is a good mixture of picture drawing and graph-
3 drawing: Note that hash marks and a legend is employed, as is the drawing
4 of multiple arrowed lines, and some text.
5 *)
6newgraph
7
8(* Draw the three time lines with hash ticks. Only draw hash labels on
9 the bottom-most one *)
10
11yaxis size 1.6 min 0 max 2 nodraw
12xaxis size 4.5 min 0.5 max 10.5 nodraw
13 draw_hash_marks draw_hash_labels draw_axis_label
14 hash 1 mhash 0 shash 0 hash_scale -.4
15 label : Time
16copygraph xaxis draw_at 1 nodraw draw_hash_marks
17copygraph xaxis draw_at 2
18
19(* Reset the axes to draw the picture *)
20
21copygraph
22xaxis size 4.5 min 99.5 max 109.5 nodraw
23
24(* Define the legend entries *)
25
26newline linethickness .5 linetype dashed
27 rarrows asize 0.19 0.04 label font Times-Italic : mCL Marker
28copycurve linetype dotdash label : mNSmarker
29copycurve linetype dotted label : mS Message
30copycurve linetype solid label : Normal Message
31legend linelength 1
32
33(* Draw each process's time line arrow *)
34
35newline linethickness .5 rarrows
36 pts 99.5 0 109.5 0
37copycurve pts 99.5 1 109.5 1
38copycurve pts 99.5 2 109.5 2
39
40(* Draw the time line processor labels *)
41
42newstring fontsize 9 hjl vjc x 99 y 2 : Pc
43copystring y 1 : P1
44copystring y 0 : P2
45
46(* Draw the initial broadcast of mcl messages *)
47
48newline linethickness .5 linetype dashed
49 rarrows asize 0.19 0.04 pts 100 2 102 1
50copycurve pts 100 2 102 0
51
52(* Draw Message from p2 -> p1 *)
53
54copycurve linetype solid pts 101 0 103 1
55
56(* Draw mns messages to p1 *)
57
58copycurve linetype dotdash pts 100 2 104 1
59copycurve pts 102 0 104 1
60
61(* Draw Message from p2 -> pc *)
62
63copycurve linetype dashed pts 105 0 106 2
64copycurve linetype solid pts 105.1 0 106.1 2
65
66(* Draw mns messages from p1 *)
67
68copycurve linetype dotdash pts 104 1 107 0
69copycurve pts 104 1 107 2
70
71(* Draw mc's -> pc *)
72
73copycurve linetype dotted pts 104 1 108 2
74copycurve pts 107 0 108 2
75
76(* Draw mc from pc *)
77
78copycurve pts 108 2 109 1
79copycurve pts 108 2 109 0
80
81(* Draw labels for m and m' *)
82
83newstring fontsize 9 font Times-Italic x 102.05 y .5 hjl vjt : m
84copystring x 105.6 y .75 hjl vjc : m'
85
86copystring x 105.6 y 2.15 hjr vjc : Pc doesn't log m'
87copystring x 103.4 y 1.35 hjl vjb : P1 logs m
88
89copycurve linetype solid pts 105.7 2.15 106.1 2
90copycurve pts 103.38 1.32 103 1
Note: See TracBrowser for help on using the repository browser.