classchart.ps 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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. /Arial-BoldMT findfont
  16. 10 scalefont
  17. setfont
  18. } def
  19. % sets the default font for large written class names
  20. /SetLargeClassFont
  21. {
  22. /Arial-BoldMT findfont
  23. 18 scalefont
  24. setfont
  25. } def
  26. % RGB colors of the texts
  27. /StandardTextColor { 0 0 0 } def
  28. /MissedTextColor { 0.50 0.50 0.50 } def
  29. % RGB colors of the boxes
  30. /MissedColor { 0.92 0.92 0.92 } def
  31. /IncompleteColor { 1 0.5 0.5 } def
  32. /UntestedColor { 1 1 0.6} def
  33. /ReadyColor { 0.7 1 0.7 } def
  34. % Starting point of the class graph
  35. % (0,0) is the lower left corner of the paper
  36. /startx { 0 mm } def
  37. /starty { 290 mm } def
  38. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  39. % End of Configurable section
  40. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  41. % some setups
  42. /Missed {0} def
  43. /Incomplete {1} def
  44. /Untested {2} def
  45. /Ready {3} def
  46. /nextx startx def
  47. /nexty starty def
  48. /maxx 0 mm def
  49. %%%%%%%%%%%%%%%%%%%%%%%%
  50. % drawbox
  51. % takes two parameters:
  52. % classname........name of the class
  53. % status......status of development
  54. /drawbox
  55. {
  56. % save parameters
  57. /status exch def
  58. /classname exch def
  59. % save enviroment
  60. gsave
  61. newpath
  62. % determine the size of the class name
  63. SetClassFont
  64. classname
  65. stringwidth
  66. % and save it ...
  67. /widthy exch def
  68. /widthx exch def
  69. % moveto start point of the box
  70. nextx 8 mm add
  71. nexty
  72. moveto
  73. % calculate the place for the icons
  74. nextx 8 mm add
  75. widthx 4.5 mm add add
  76. /nexticonx exch def
  77. % max. ?
  78. nexticonx 1.5 mm sub maxx gt { /maxx nexticonx def } if
  79. % set box color
  80. status Missed eq { MissedColor setrgbcolor } if
  81. status Incomplete eq { IncompleteColor setrgbcolor } if
  82. status Untested eq { UntestedColor setrgbcolor } if
  83. status Ready eq { ReadyColor setrgbcolor } if
  84. % draw box
  85. 0 mm 2.1 mm rlineto
  86. widthx 3 mm add 0 mm rlineto
  87. 0 mm -4.2 mm rlineto
  88. 0 widthx 3 mm add sub 0 mm rlineto
  89. 0 mm 2.1 mm rlineto
  90. closepath
  91. fill
  92. % set text color
  93. status Missed eq { MissedTextColor setrgbcolor }
  94. { StandardTextColor setrgbcolor } ifelse
  95. % set text pos and write text
  96. nextx 9.5 mm add
  97. nexty 1.25 mm sub
  98. moveto
  99. classname
  100. show
  101. grestore
  102. } def
  103. %%%%%%%%%%%%%%%%%%%%%%%%
  104. % drawlargebox
  105. % takes two parameters:
  106. % classname........name of the class
  107. % status......status of development
  108. /drawlargebox
  109. {
  110. % save parameters
  111. /status exch def
  112. /classname exch def
  113. % save enviroment
  114. gsave
  115. newpath
  116. % determine the size of the class name
  117. SetLargeClassFont
  118. classname
  119. stringwidth
  120. % and save it ...
  121. /widthy exch def
  122. /widthx exch def
  123. % moveto start point of the box
  124. nextx 8 mm add
  125. nexty
  126. moveto
  127. % calculate the place for the icons
  128. nextx 8 mm add
  129. % add text with and additional space
  130. widthx 7.5 mm add add
  131. /nexticonx exch def
  132. % max. ? (remove icon offset using 1.5 mm sub)
  133. nexticonx 1.5 mm sub maxx gt { /maxx nexticonx def } if
  134. %save x-pos for the horizontal line (remove icon offset using 4.5 mm sub)
  135. /lastlargeobjectx nexticonx 1.5 mm sub def
  136. % set box color
  137. status Missed eq { MissedColor setrgbcolor } if
  138. status Incomplete eq { IncompleteColor setrgbcolor } if
  139. status Untested eq { UntestedColor setrgbcolor } if
  140. status Ready eq { ReadyColor setrgbcolor } if
  141. % draw box
  142. 0 mm 4.2 mm rlineto
  143. widthx 6 mm add 0 mm rlineto
  144. 0 mm -8.4 mm rlineto
  145. 0 widthx 6 mm add sub 0 mm rlineto
  146. 0 mm 4.2 mm rlineto
  147. closepath
  148. fill
  149. % set text color
  150. status Missed eq { MissedTextColor setrgbcolor }
  151. { StandardTextColor setrgbcolor } ifelse
  152. % set text pos and write text
  153. nextx 11 mm add
  154. nexty 2.5 mm sub
  155. moveto
  156. classname
  157. show
  158. nexty 2.1 mm sub
  159. /nexty exch def
  160. grestore
  161. } def
  162. %%%%%%%%%%%%%%%%%%%%%%%%
  163. % newchildclass
  164. % draws a new class
  165. % takes two parameters:
  166. % name of the class
  167. % status of development
  168. /newchildclass
  169. {
  170. % save parameters
  171. /status exch def
  172. /classname exch def
  173. % save enviroment
  174. % push this on the stack for onelevelback
  175. nexty
  176. newpath
  177. SetLineWidth
  178. SetLineColor
  179. nexty -2.1 mm add
  180. /nexty exch def
  181. nextx 11 mm add
  182. /nextx exch def
  183. nextx nexty moveto
  184. 0 mm -2.9 mm rlineto
  185. 8 mm 0 mm rlineto stroke
  186. nexty -2.9 mm add
  187. /nexty exch def
  188. classname
  189. status
  190. drawbox
  191. } def
  192. %%%%%%%%%%%%%%%%%%%%%%%%
  193. % newclass
  194. % draws a new class
  195. % takes two parameters:
  196. % name of the class
  197. % status of development
  198. /newclass
  199. {
  200. gsave
  201. newpath
  202. SetLineWidth
  203. SetLineColor
  204. nextx nexty moveto
  205. 0 mm -5 mm rlineto
  206. 8 mm 0 mm rlineto stroke
  207. nexty -5 mm add
  208. /nexty exch def
  209. drawbox
  210. grestore
  211. } def
  212. %%%%%%%%%%%%%%%%%%%%%%%%
  213. % newclassxmoved
  214. % draws a new class
  215. % takes three parameters:
  216. % name of the class
  217. % status of development
  218. % x offset in points
  219. %
  220. % Remark:
  221. % between newclassxmoved and restoreoldxy have to be a newchildclass,
  222. % else the output gets scrambled, but don't do a
  223. % onelevelback should be used, restoreoldxy removes one child level!
  224. /newclassxmoved
  225. {
  226. % save parameters
  227. /offsetx exch def
  228. /status exch def
  229. /classname exch def
  230. % save enviroment
  231. % push this on the stack for onemovelevelback
  232. nextx
  233. nexty
  234. newpath
  235. SetLineWidth
  236. SetLineColor
  237. nextx nexty moveto
  238. 0 mm -5 mm rlineto
  239. 8 mm offsetx add 0 mm rlineto stroke
  240. nexty -5 mm add
  241. /nexty exch def
  242. /nextx nextx offsetx add def
  243. classname status drawbox
  244. } def
  245. %%%%%%%%%%%%%%%%%%%%%%%%
  246. % restoreoldxy
  247. % restores old state of nextx and nexty
  248. /restoreoldxy
  249. {
  250. % remove old child y coordinate
  251. /dummy def
  252. 5 mm sub
  253. /nexty exch def
  254. /nextx exch def
  255. } def
  256. %%%%%%%%%%%%%%%%%%%%%%%%
  257. % newlargeheadclass
  258. % draws a new large class item to the head line (liek tobject)
  259. % takes two parameters:
  260. % name of the class
  261. % status of development
  262. /newlargeheadclass
  263. {
  264. gsave
  265. newpath
  266. SetLineWidth
  267. SetLineColor
  268. nextx nexty moveto
  269. 8 mm 0 mm rlineto stroke
  270. drawlargebox
  271. grestore
  272. } def
  273. %%%%%%%%%%%%%%%%%%%%%%%%
  274. % onelevelback
  275. % goes one level back in the class hierarchy
  276. /onelevelback
  277. {
  278. /oldy exch def
  279. newpath
  280. SetLineWidth
  281. SetLineColor
  282. nextx -11 mm add
  283. /nextx exch def
  284. nextx oldy moveto
  285. nextx nexty lineto stroke
  286. } def
  287. %%%%%%%%%%%%%%%%%%%%%%%%
  288. % Linuxonly
  289. % draws the linux icon
  290. /Linuxonly
  291. {
  292. gsave
  293. newpath
  294. nexticonx
  295. nexty 1.25 mm sub
  296. moveto
  297. SetClassFont
  298. StandardTextColor setrgbcolor
  299. % (Linux)
  300. % show
  301. %!!!!!! here we have to update maxx (max. len of the current column)
  302. grestore
  303. } def
  304. %%%%%%%%%%%%%%%%%%%%%%%%
  305. % Win32only
  306. % draws the win32 icon
  307. /Win32only
  308. {
  309. gsave
  310. newpath
  311. nexticonx
  312. nexty 1.25 mm sub
  313. moveto
  314. SetClassFont
  315. StandardTextColor setrgbcolor
  316. % (Win32)
  317. % show
  318. %!!!!!! here we have to update maxx (max. len of the current column)
  319. grestore
  320. } def
  321. %%%%%%%%%%%%%%%%%%%%%%%%
  322. % Both
  323. % dummy
  324. /Both
  325. {
  326. } def
  327. %%%%%%%%%%%%%%%%%%%%%%%%
  328. % goes to a new column
  329. % newcolumn
  330. /newcolumn
  331. {
  332. % add 3 mm space
  333. /nextx maxx 3 mm add def
  334. /nexty starty def
  335. SetLineWidth
  336. SetLineColor
  337. newpath
  338. lastlargeobjectx nexty moveto
  339. nextx nexty lineto stroke
  340. } def
  341. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  342. % here the class tree follows
  343. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  344. %%%%%%%%%%%%%%%%%%%%%%%
  345. % TObject
  346. %%%%%%%%%%%%%%%%%%%%%%%
  347. (TObject) Ready drawlargebox
  348. %%%%%%%%%%%%%%%%%%%%%%%
  349. % Exception classes
  350. %%%%%%%%%%%%%%%%%%%%%%%
  351. (Exception) Missed newchildclass
  352. (EAbort) Incomplete newchildclass
  353. (EAbstractError) Missed newclass Linuxonly
  354. (EDatabaseError) Missed newclass Linuxonly
  355. (EDBCLient) Missed newchildclass
  356. (EReconcileError) Missed newchildclass Linuxonly
  357. onelevelback
  358. (EDBEngineError) Missed newclass Win32only
  359. (ENoResultSet) Missed newclass
  360. (EUpdateError) Missed newclass
  361. onelevelback
  362. (EDBEditError) Missed newclass
  363. (EDSWriter) Missed newclass
  364. onelevelback
  365. (OutlineError) Missed newclass
  366. %%%%%%%%%%%%%%%%%%%%%%%
  367. % Some more base classes
  368. %%%%%%%%%%%%%%%%%%%%%%%
  369. newcolumn
  370. (TInterface) Missed 40 mm newclassxmoved
  371. (TIAddInNotifier) Missed newchildclass
  372. restoreoldxy
  373. (TInterfacedObject) Missed newclass
  374. (TList) Ready newclass
  375. (TLookupList) Missed newclass
  376. (TPropertyEditor) Missed 40 mm newclassxmoved
  377. (TClassProperty) Missed newchildclass
  378. (TFontProperty) Missed newchildclass
  379. onelevelback
  380. (TComponentProperty) Missed newclass
  381. % remove a childy coordinate
  382. restoreoldxy
  383. (TRegistry) Missed newclass
  384. (TRegIniFile) Missed newchildclass
  385. onelevelback
  386. (TSessionList) Missed newclass
  387. %%%%%%%%%%%%%%%%%%%%%%%
  388. % TPersistent classes
  389. %%%%%%%%%%%%%%%%%%%%%%%
  390. newcolumn
  391. (TPersistent) Untested newlargeheadclass
  392. (TCanvas) Missed newchildclass
  393. (TControlCanvas) Missed newchildclass
  394. (TMetafileCanvas) Missed newclass
  395. onelevelback
  396. (TClipboard) Missed newclass
  397. %%%%%%%%%%%%%%%%%%%%%%%
  398. % TComponent classes
  399. %%%%%%%%%%%%%%%%%%%%%%%
  400. newcolumn
  401. (TComponent) Untested newlargeheadclass
  402. showpage