Skip to main content



      Home
Home » Eclipse Projects » GEF » Adding header/footer when printing
Adding header/footer when printing [message #212650] Tue, 28 March 2006 07:21 Go to next message
Eclipse UserFriend
Originally posted by: chrislott.spamcop.net

Hi,

I'm trying to figure out how to add header/footer information, like page
numbers, when printing a Draw2d figure. I did not see anything about
printing in the GEF FAQ, and searching the web didn't yield much either.
I'm hoping someone will please point me to some examples that might show
possibilities for this.

Right now I'm working with the database schema editor example
("com.realpersist.gef.schemaeditor"). It uses the GEF class
PrintGraphicalViewerOperation, which is a subclass of Draw2d's
PrintFigureOperation class. Basic printing works just fine. For my first
extension I'd like to add page numbers. It seems to me that I probably
have to add graphical (text) elements to the figure so that they print.
It looks like I might be able to use the drawText() methods on the
Graphics object that is created in PrintFigureOperation's printPages()
method. I'm new to this, tho, so would very much welcome any guidance and
cautions about gotchas.

Thanks in advance.

chris...
Re: Adding header/footer when printing [message #212700 is a reply to message #212650] Tue, 28 March 2006 09:36 Go to previous messageGo to next message
Eclipse UserFriend
GMF does something similar to this. Take a look at
org.eclipse.gmf.runtime.diagram.ui.printing.internal.util.Di agramPrinter#dra
wHeaderAndFooter. Or better yet, integrate as a first class client of GMF
and get the functionality "for free".

http://www.eclipse.org/gmf

-Steve

"Chris Lott" <chrislott@spamcop.net> wrote in message
news:6e47f944c7f9fa6a3f7924873437ab48$1@www.eclipse.org...
> Hi,
>
> I'm trying to figure out how to add header/footer information, like page
> numbers, when printing a Draw2d figure. I did not see anything about
> printing in the GEF FAQ, and searching the web didn't yield much either.
> I'm hoping someone will please point me to some examples that might show
> possibilities for this.
>
> Right now I'm working with the database schema editor example
> ("com.realpersist.gef.schemaeditor"). It uses the GEF class
> PrintGraphicalViewerOperation, which is a subclass of Draw2d's
> PrintFigureOperation class. Basic printing works just fine. For my first
> extension I'd like to add page numbers. It seems to me that I probably
> have to add graphical (text) elements to the figure so that they print.
> It looks like I might be able to use the drawText() methods on the
> Graphics object that is created in PrintFigureOperation's printPages()
> method. I'm new to this, tho, so would very much welcome any guidance and
> cautions about gotchas.
>
> Thanks in advance.
>
> chris...
>
>
Re: Adding header/footer when printing [message #212708 is a reply to message #212700] Tue, 28 March 2006 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chrislott.spamcop.net

Thanks for the pointer to GMF, especialy their implementation of page
headers and footers. Their reusable objects, like page setup and print
preview, look fantastically useful. But that project appears to be in
active development and has no official release right now. It feels risky
to start depending on GMF this early in their cycle.

chris...
Re: Adding header/footer when printing [message #212888 is a reply to message #212708] Thu, 30 March 2006 10:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Chris, if you see interesting function in GMF that should instead be in GEF,
please open a bugzilla with details on the classes and your usage.

"Chris Lott" <chrislott@spamcop.net> wrote in message
news:939b9003e111a3f9c04aaf83dfe28645$1@www.eclipse.org...
> Thanks for the pointer to GMF, especialy their implementation of page
> headers and footers. Their reusable objects, like page setup and print
> preview, look fantastically useful. But that project appears to be in
> active development and has no official release right now. It feels risky
> to start depending on GMF this early in their cycle.
>
> chris...
Re: Adding header/footer when printing [message #212966 is a reply to message #212888] Fri, 31 March 2006 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Should not all printing features be part of GEF instead of GMF?
I'm a layman to GMF, but in my opinion printing of Draw2D figures is close
to GEF.
And yes, I'd really like to have enhanced printing support in my GEF
editor. ;-)

Regards,

Andreas

--
A. Schosser
Mind8 GmbH

Randy Hudson wrote:

> Chris, if you see interesting function in GMF that should instead be in
> GEF,
> please open a bugzilla with details on the classes and your usage.
>
> "Chris Lott" <chrislott@spamcop.net> wrote in message
> news:939b9003e111a3f9c04aaf83dfe28645$1@www.eclipse.org...
>> Thanks for the pointer to GMF, especialy their implementation of page
>> headers and footers. Their reusable objects, like page setup and print
>> preview, look fantastically useful. But that project appears to be in
>> active development and has no official release right now. It feels
>> risky
>> to start depending on GMF this early in their cycle.
>>
>> chris...
>
Re: Adding header/footer when printing [message #213420 is a reply to message #212966] Wed, 05 April 2006 16:44 Go to previous message
Eclipse UserFriend
A. Schosser wrote:
> Should not all printing features be part of GEF instead of GMF?
> I'm a layman to GMF, but in my opinion printing of Draw2D figures is
> close to GEF.
> And yes, I'd really like to have enhanced printing support in my GEF
> editor. ;-)
>

I agree and I 'need' the enhamced printing support!!!


Andreas
Previous Topic:CommandStack deprecated method nottifyListeners().
Next Topic:DirectedGraphLayout and self cycles
Goto Forum:
  


Current Time: Sun Jul 06 09:42:20 EDT 2025

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

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

Back to the top