classchart.ps 9.3 KB

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