Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » PrintAction with graphicalEditor: Can I manually add page breaks?
PrintAction with graphicalEditor: Can I manually add page breaks? [message #237681] Tue, 07 August 2007 08:04 Go to next message
Alexander Haag is currently offline Alexander HaagFriend
Messages: 119
Registered: July 2009
Senior Member
Hi there,

I've got a graphical editor showing some nodes and connections using
Polygon figures and I have put my own layout to the editor for the nodes
and connections.
I use the retargetable print-Action provided by eclipse
(org.eclipse.ui.actions.ActionFactory.PRINT) to print my diagram.

By now all works fine, except that the page breaks are set as soon as
the page is full without respect to my layout or the nodes themselfs
(they are sometimes cut in half; upper half on page 1, lower half on
page 2).

What I need is that the page beaks are set WITH respect to my layout or
at least that the nodes are not devided into pieces.

1) Is there a way for me to tell the print-process where to set a page
break?

2) Or is ot possible for the print-process to look out for good page
break sites?
I would not mind if the printed diagram would be zoomed a little bit to
fit the pages (as zooming does allready work with my graphical editor)
or to achieve a good layout for page breaks.

3) Or should the layout itself define some possible page breaks so that
the printer can use them?

I'm really stuck here, please help me!

Any help, code snippets or hints on this matter are highly appreciated

Many Thanks in advance,
Alex Haag
Re: PrintAction with graphicalEditor: Can I manually add page breaks? [message #237687 is a reply to message #237681] Tue, 07 August 2007 10:47 Go to previous message
Eclipse UserFriend
Originally posted by: prasenjit.d.tcs.com

The simplest thing will definitly be applying a zoom to the page. For that
you can create your own print action or extends
org.eclipse.gef.ui.actions.PrintAction. Then extend
org.eclipse.gef.print.PrintGraphicalViewerOperation and overload
getFreshPrinterGraphics() method. You need to calculate the correct zoom
beforehand and inside this method apply this zoom using setScale method of
PrinterGraphics. If you just go through these classes you may find out
other ways to meet your goal.

Thanks
Previous Topic:Selection handles can not appear
Next Topic:Palette title
Goto Forum:
  


Current Time: Fri Mar 29 11:19:00 GMT 2024

Powered by FUDForum. Page generated in 0.01929 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top