UML export/printing problems
Just installed latest Studio version and did reverse engineering UML.
UML look fine but there are problems exporting or printing it:
1. If I try to export it to image - exported file is empty;
2. If I try to print it - only small size diagram is printed.
3. If I create a WebReport - to tree or diagram are created (main.htm has no links).
4. I did not find a way to export diagram to Rational Rose format (there is import but no export?)
Is there a way to solve these problems.
Are there other viewers for *.etd, etc files to display UML and print...
any help is greatly appreciated.
Thank you.
leo
[667 byte] By [
leoasina] at [2007-11-26 13:37:28]

# 1
> 1. If I try to export it to image - exported file is empty;
> 2. If I try to print it - only small size diagram is printed.
Ref: http://forum.java.sun.com/thread.jspa?forumID=747&threadID=5061305
... While printing, in the print setup dialog ( click the print preview icon on the uml toolbar, select the printsetup button to get the print setup dialog) you have options to scale by pages, zoom level or actual size. You also can set the position of the graph....
Also: http://forum.java.sun.com/thread.jspa?forumID=747&threadID=5060886
...There's a toolbar on the diagram panel, one button is 'Export as Image', we support JPG, PNG and SVG as output format, you can also specify the image size....
Does the above help?
> If I create a WebReport - to tree or diagram are created (main.htm has no links).
Which browser are you using? If the diagram is large, sometimes the main.html is not displayed correctly on firefox. Can u check if the files are actually created but only browser display is having problems?
# 2
Thank you for your comments. Unfortunately they did not solve the problem.
It look like there is some fundamental bugs here...
BTW. I am using Windows XP, dual Processor (3GHz), 2GB RAM
Please see comments below.
I would appreciate any suggestions to solve this problem.
> Ref:
> http://forum.java.sun.com/thread.jspa?forumID=747&thre
> adID=5061305
> ... While printing, in the print setup dialog ( click
> the print preview icon on the uml toolbar, select the
> printsetup button to get the print setup dialog) you
> have options to scale by pages, zoom level or actual
> size. You also can set the position of the graph....
>
******************************************************************
This does not seems to work properly. I am trying to print on HP DesignJet to have a big diagram (e.g. 40x40 in). When I select the page size and set "Actual size" in Print Preview and use Print - "Error occur during this operation".
Here is the stacktrace in the log file:
ERROR: 'unknown protocol: c'
FATAL ERROR: 'Could not compile stylesheet'
Exception in thread "Thread-14" java.awt.print.PrinterException: Invalid name of PrintService.
at sun.awt.windows.WPrinterJob.setNativePrintService(Native Method)
at sun.awt.windows.WPrinterJob.getPrintService(WPrinterJob.java:573)
at sun.print.RasterPrinterJob.setPrintable(RasterPrinterJob.java:965)
at com.tomsawyer.editor.export.TSEPrint.execute(DashoA9*..)
at com.embarcadero.uml.ui.swing.drawingarea.ADDrawingAreaPrinter$1$1.run(ADDrawing AreaPrinter.java:95)
at java.lang.Thread.run(Thread.java:619)
*******************************************************************************
> Also:
> http://forum.java.sun.com/thread.jspa?forumID=747&thre
> adID=5060886
>
> ...There's a toolbar on the diagram panel, one button
> is 'Export as Image', we support JPG, PNG and SVG as
> output format, you can also specify the image
> size....
>
>
> Does the above help?
*********************************************************
The image is created but the file is empty (size=0)
*********************************************************
> > If I create a WebReport - to tree or diagram are
> created (main.htm has no links).
> Which browser are you using? If the diagram is large,
> sometimes the main.html is not displayed correctly on
> firefox. Can u check if the files are actually
> created but only browser display is having problems?
The file structure corresponding to packages is created but no actual files: only one file at the top hierarchy is created - all the other directories are empty.
Thanks,
Leo
# 3
> Exception in thread "Thread-14" java.awt.print.PrinterException: Invalid name of PrintService.
> at sun.awt.windows.WPrinterJob.setNativePrintService(Native Method)
> at sun.awt.windows.WPrinterJob.getPrintService(WPrinterJob.java:573)
Which jdk are you using? If you are using jdk1.6, is it possible for you to try with jdk1.5?
# 4
Yes, I am using 1.6 ; I will try jdk 1.5 tonight now and report the resultsThanks,Leo
# 5
> Which jdk are you using? If you are using jdk1.6, is
> it possible for you to try with jdk1.5?
I have tried with jdk 1.5, basically no much difference...
1. Printing does not work on a large diagram i.e. print preview (set Actual size, select D size paper on printer; Print - "error message"). If select "Pages" i print preview - prints, no problem but small size (~11" on 42" roll) so it is pretty blind.
2. Image export: creates *.jpg file but size =0 . Tried *.svg export - the output file is created ~ 92MB but no data just XML, etc.
3. WebReport. The tree structure and HTMl file are created and displayed but diagram file "New_diagram....jpg" is empty (size=0) - so the report is pretty useless.
Is there some size limitation, etc.
At this point I just want to somehow export the diagram to image, to print, export to rational Rose... anything...
I can see very nice diagram on the screen - just cannot believe there is such a trouble to export, etc.
I am using now Client VM 1.5.0_09-b03 on Windows XP
Following is the jstudio.conf file:
******************************************************
# ${HOME} will be replaced by JVM user.home system property
netbeans_default_userdir="${HOME}/.jstudio/Ent8"
# options used by netbeans launcher by default, can be overridden by explicit command line switches
netbeans_default_options="-J-Xms256m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=96m -J-Dnetbeans.logger.console=true -J-ea -J-Dsun.java2d.pmoffscreen=false -J-Dcom.sun.im.service.xmpp.session.keepaliveinterval=30 -J-Dcom.sun.aas.installRoot=\"C:\Program Files\Sun\jstudio_ent8\AppServ8.1UR2\""
-J-Xmx1024m
# default location of J2SE JDK, can be overridden by using --jdkhome <dir> switch
#netbeans_jdkhome="/path/to/jdk"
# clusters' paths separated by path.separator (semicolon on Windows, colon on Unices)
#netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"
netbeans_jdkhome="C:\jdk\jdk5"
netbeans_extraclusters="C:\Program Files\Sun\jstudio_ent8\ide\jesprofiler1;C:\Program Files\Sun\jstudio_ent8\ide\infra1"
***************************************************
Any comment, suggestions?
Thank you for your help.
Leo
# 6
Leo,
Just FYI, the Studio product you are using is not the latest version, the newer 8.1 can be downloaded here http://developers.sun.com/prodtech/javatools/jsenterprise/downloads/index.jsp in case you would like to try, but there's no change around diagram exporting mechanism, web report has been completely re-designed though.
A diagram with svg output size at ~92M is *huge*. SVG file is nothing but xml, what do you mean by "no data"? Can you view your svg file in latest Firefox that supports svg, or any svg browsers?
Do you have problems with exporting small size diagram to jpg? When you export your diagram using toolbar "Export as Image" did you try to lower image quality (70% is web standard, and can drastically reduce jpg file size), and also scale down image size?
Did you encounter "Out Of Memory" exception when you export image? Any error messages in the log file when you get 0 size jpg file? We have a known issue on linux, http://www.netbeans.org/issues/show_bug.cgi?id=82394 but that's not your case.
# 7
> A diagram with svg output size at ~92M is *huge*. SVG
> file is nothing but xml, what do you mean by "no
> data"? Can you view your svg file in latest Firefox
> that supports svg, or any svg browsers?
There are XML tags but no content i.e. firefox show empty screen, Adobe SVGViewer - empty screen, batik view - the same thing. It is empty...
>
> Do you have problems with exporting small size
> diagram to jpg? When you export your diagram using
> toolbar "Export as Image" did you try to lower image
> quality (70% is web standard, and can drastically
> reduce jpg file size), and also scale down image
> size?
I did not try small size diagram. Image qaulity does not make any difference - tried 50% and 20% - the same difference.
The problem occurs only when one selects "actual size" or "current zoom 100%)". If I select "fit in the window" option - no problem exporting image or printing, etc. The problem is with diagram on large format.
> Did you encounter "Out Of Memory" exception when you
> export image? Any error messages in the log file when
> you get 0 size jpg file? We have a known issue on
> linux,
> http://www.netbeans.org/issues/show_bug.cgi?id=82394
> but that's not your case.
No, no exceptions, no messages, no waiting cursor. It does not seems to be a memory problem (only ~250MB is used out of 1024MB).
I wonder if somebody tested printing or exporting large class diagram at actual size...
Thanks,
Leo
# 8
OK, thank you for all the information, now it's clearly an image size issue.
Just curious, how many classes do you have on the diagram? I'm afraid we don't have a definitive specification for image size limit. My personal experience is that a diagram around 20M in resulting jpg file is almost the upper limit for my 2G RAM machine. Your svg has 90M, it must have lots of data there, perhaps browser cannot even handle that.
Anyway, we are considering an enhancement to allow users to specify what to display on the class diagram, e.g hiding all attribute and operation compartments, so that diagram will be much smaller for manipulation and printing, assuming that users would be more interested in class relationship than attribute details when looking at such a huge diagram.
At this moment, I see no way around it, try to dissect this diagram into several smaller ones. "Create Diagram from Selected Elements" menu item on class element can help.
We'll continue to research on this issue, thank you for your feedback, and sorry for the trouble.
# 9
Thanks for your comments.
Project has, perhaps, ~500 classes. I was hoping to have a big picture of inter-relation - it is difficult to see on the screen.
I guess I will try to do this piecemeal, perhaps, limit to 40 classes.
I would expect that most of enterprise application would have significant number of classes - there was no much problem in Rational Rose (just very inconvenient).
Thanks,
leo
# 10
With 500 classes on a class diagram on printout might be a bit too big to print with legibility even on a super size paper. We have tested on at least 50 classes on a diagram and exporting to either of the supported image formats work properly. I just tried to reproduce this problem by reverse engineering the UML core sources, then created a class diagram with around 100+ classes (combination of classes, interfaces, derivation classifiers, packages) and exporting the diagram in actual size to jpg did result in zero size file. However, exporting to svg file resulted in around 130MB in file size that FireFox can not handle to open.
Like sherylsu said, I'm afraid that breaking up the big diagram into smaller ones is the way to go for now. Sorry for the inconvenience. I'll file a bug on exporting big diagram to jpg doesn't work.
# 11
Looks like the problem with exporting to jpg file might be related to the size of the uml project or the complex relationships between elements. I did another experiment which a class diagram contains 110 elements (classes, interfaces, data types, etc.) can be exported to jpg, svg, png format fine. This info can be referenced in issue http://uml.netbeans.org/issues/show_bug.cgi?id=91942
# 12
Hi petersl,
Thanks for your comments.
> Looks like the problem with exporting to jpg file
> might be related to the size of the uml project or
> the complex relationships between elements. I did
> another experiment which a class diagram contains 110
> elements (classes, interfaces, data types, etc.) can
> be exported to jpg, svg, png format fine.
It sounds odd that there is any dependance on UML project or complexity of relationship. Since the UML diagram is already displayed on the screen, one would expect that it a simple matter of converting the JComponent (panel) to an image.
Also it would be nice if it were done in a separate thread with some "progress monitor" since exporting of a big image is taking time...
I will try to experiment with smaller diagrams, hopefully will find something workable.
Thanks,
Leo
# 13
I'm not saying it's directly related since I don't know the logic of how exporting works, but just based on my experiment on what worked and not worked. Another thing I tried in my experiment was that I exported the diagram to the png file format when there was no relationships (or links) vs when there were relationships on all elements. Without relationships, exporting to png just took a few more seconds longer than exporting to jpg or svg. However, with relationships to every elements (as in the snapshot in the issue), it took maybe an hour to export to png format.
Hope smaller diagrams work fine for your project.