CLIM mail archive

[Next][Index][Thread]

Scale problems with-output-to-postscript-stream



Some time ago I tried a with-scaling call in the middle of generating postscript
output from the clim grapher, but could not find any way to coordinate the 
text label positions with the scaled node positions, in fact I couldn't even
get the multi-page output to coordinate the graph lines very well. Using the
following code fragment usually does a fair job (in this case of printing a
tree-based view of class hierarchies) but is not accurate for more connected,
(eg., non-tree) hierarchies.


(defmethod print-subclass-tree ((name symbol) &optional (size :tiny))
  (let* ((class (find-class name))
	 (filename (concatenate 'string (string (class-name class))
				"-subclass-tree.ps")))
    (with-open-file (file filename :direction :output :if-exists :supersede)
      (clim:with-output-to-postscript-stream (stream file :multi-page t)
        (clim:with-text-size (size stream)
	  (clim:format-graph-from-root class
	    #'(lambda (object s)
		(write-string (string (class-name object)) s))
	    #'clos:class-direct-subclasses :stream stream))))
    (excl:run-shell-command (concatenate 'string "lpr " filename))))

I understand that CLIM 2.0 will provide true graph formatting, not just trees, but
will CLIM 2.0 work properly with the with-scaling macro and format-graph-from-root
combined? 

 --------
Cordially,
 Gregory M. Whittaker,		 The MITRE Corporation
				 Center for Advanced Aviation 
				    System Development
Internet: greg@mitre.org	 7525 Colshire Drive 
   Phone: (703) 883-5549	 McLean Virginia 22102-3481
     FAX: (703) 883-1226	 Mail Stop: W215      


0,,


Main Index | Thread Index