classchart.ps 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. %!
  2. % we need to define metric units
  3. /mm {2.834 mul} def
  4. /cm {28.34 mul } def
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. % Configurable section
  7. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  8. % sets the line width of the class graph to 0.5 points
  9. /SetLineWidth { 0.5 setlinewidth} def
  10. % sets the line color of the class graph to black
  11. /SetLineColor { 0 0 0 setrgbcolor } def
  12. % sets the default font for class names
  13. /SetClassFont
  14. {
  15. /ArialMT findfont
  16. 10 scalefont
  17. setfont
  18. } def
  19. % RGB colors of the texts
  20. /StandardTextColor { 0 0 0 } def
  21. /MissedTextColor { 0.50 0.50 0.50 } def
  22. % RGB colors of the boxes
  23. /MissedColor { 0.92 0.92 0.92 } def
  24. /IncompleteColor { 1 0.5 0.5 } def
  25. /UntestedColor { 1 1 0.6} def
  26. /ReadyColor { 0.7 1 0.7 } def
  27. % Starting point of the class graph
  28. % (0,0) is the lower left corner of the paper
  29. /nextx { 0 mm } def
  30. /nexty { 300 mm } def
  31. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  32. % End of Configurable section
  33. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  34. /Missed {0} def
  35. /Incomplete {1} def
  36. /Untested {2} def
  37. /Ready {3} def
  38. %%%%%%%%%%%%%%%%%%%%%%%%
  39. %%%%%%%%%%%%%%%%%%%%%%%%
  40. % drawbox
  41. % takes two parameters:
  42. % classname........name of the class
  43. % status......status of development
  44. /drawbox
  45. {
  46. % save parameters
  47. /status exch def
  48. /classname exch def
  49. % save enviroment
  50. gsave
  51. newpath
  52. % determine the size of the class name
  53. SetClassFont
  54. classname
  55. stringwidth
  56. % and save it ...
  57. /widthy exch def
  58. /widthx exch def
  59. % moveto start point of the box
  60. nextx 8 mm add
  61. nexty
  62. moveto
  63. % calculate the place for the icons
  64. nextx 8 mm add
  65. widthx 4.5 mm add add
  66. /nexticonx exch def
  67. % set box color
  68. status Missed eq { MissedColor setrgbcolor } if
  69. status Incomplete eq { IncompleteColor setrgbcolor } if
  70. status Untested eq { UntestedColor setrgbcolor } if
  71. status Ready eq { ReadyColor setrgbcolor } if
  72. % draw box
  73. 0 mm 2.1 mm rlineto
  74. widthx 3 mm add 0 mm rlineto
  75. 0 mm -4.2 mm rlineto
  76. 0 widthx 3 mm add sub 0 mm rlineto
  77. 0 mm 2.1 mm rlineto
  78. closepath
  79. fill
  80. % set text color
  81. status Missed eq { MissedTextColor setrgbcolor }
  82. { StandardTextColor setrgbcolor } ifelse
  83. % set text pos and write text
  84. nextx 9.5 mm add
  85. nexty 1.25 mm sub
  86. moveto
  87. classname
  88. show
  89. grestore
  90. } def
  91. %%%%%%%%%%%%%%%%%%%%%%%%
  92. % newchildclass
  93. % draws a new class
  94. % takes two parameters:
  95. % name of the class
  96. % status of development
  97. /newchildclass
  98. {
  99. % save parameters
  100. /status exch def
  101. /classname exch def
  102. % save enviroment
  103. % push this on the stack for onelevelback
  104. nexty
  105. newpath
  106. SetLineWidth
  107. SetLineColor
  108. nexty -2.1 mm add
  109. /nexty exch def
  110. nextx 11 mm add
  111. /nextx exch def
  112. nextx nexty moveto
  113. 0 mm -2.9 mm rlineto
  114. 8 mm 0 mm rlineto stroke
  115. nexty -2.9 mm add
  116. /nexty exch def
  117. classname
  118. status
  119. drawbox
  120. } def
  121. %%%%%%%%%%%%%%%%%%%%%%%%
  122. % newclass
  123. % draws a new class
  124. % takes two parameters:
  125. % name of the class
  126. % status of development
  127. /newclass
  128. {
  129. gsave
  130. newpath
  131. SetLineWidth
  132. SetLineColor
  133. nextx nexty moveto
  134. 0 mm -5 mm rlineto
  135. 8 mm 0 mm rlineto stroke
  136. nexty -5 mm add
  137. /nexty exch def
  138. drawbox
  139. grestore
  140. } def
  141. /onelevelback
  142. {
  143. /oldy exch def
  144. newpath
  145. SetLineWidth
  146. SetLineColor
  147. % nexty -5 mm add
  148. % /nexty exch def
  149. nextx -11 mm add
  150. /nextx exch def
  151. nextx oldy moveto
  152. nextx nexty lineto stroke
  153. } def
  154. %%%%%%%%%%%%%%%%%%%%%%%%
  155. % Linuxonly
  156. % draws the linux icon
  157. /Linuxonly
  158. {
  159. gsave
  160. newpath
  161. nexticonx
  162. nexty 1.25 mm sub
  163. moveto
  164. SetClassFont
  165. StandardTextColor setrgbcolor
  166. (Linux)
  167. show
  168. grestore
  169. } def
  170. %%%%%%%%%%%%%%%%%%%%%%%%
  171. % Win32only
  172. % draws the win32 icon
  173. /Win32only
  174. {
  175. gsave
  176. newpath
  177. nexticonx
  178. nexty 1.25 mm sub
  179. moveto
  180. SetClassFont
  181. StandardTextColor setrgbcolor
  182. (Win32)
  183. show
  184. grestore
  185. } def
  186. %%%%%%%%%%%%%%%%%%%%%%%%
  187. % Both
  188. % dummy
  189. /Both
  190. {
  191. } def
  192. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  193. % here the class tree follows
  194. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  195. %%%%%%%%%%%%%%%%%%%%%%%
  196. % TObject
  197. %%%%%%%%%%%%%%%%%%%%%%%
  198. (TObject) Ready drawbox
  199. %%%%%%%%%%%%%%%%%%%%%%%
  200. % Exception classes
  201. %%%%%%%%%%%%%%%%%%%%%%%
  202. (Exception) Missed newchildclass
  203. (EAbort) Incomplete newchildclass
  204. (ENewAbort) Untested newchildclass
  205. (ECustomAbort) Ready newclass
  206. onelevelback
  207. (EAbstractError) Missed newclass Linuxonly
  208. (EDatabaseError) Missed newclass Linuxonly
  209. (EDBCLient) Missed newchildclass
  210. (EReconcileError) Missed newchildclass Linuxonly
  211. onelevelback
  212. (EDBEngineError) Missed newclass Win32only
  213. (ENoResultSet) Missed newclass
  214. (EUpdateError) Missed newclass
  215. onelevelback
  216. (EDBEditError) Missed newclass
  217. (EDSWriter) Missed newclass
  218. showpage