Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Printing Gantt Chart - best approach?(How to best print the nebula gantt chart widget)
icon5.gif  Printing Gantt Chart - best approach? [message #870480] Tue, 08 May 2012 11:47
Mike Evans is currently offline Mike EvansFriend
Messages: 237
Registered: July 2009
Senior Member
Hi All,

I have just discovered Emil Crumhorn's excellent Gantt chart widget (yes - I do not visit the Nebula home page all that often).

I am looking to embed it in my app and offer a print option.
Enbedding is easy enough - Emil's API's are straightforward.
However I am not very familiar with SWT printing so I am seeking advice on the best approach.
I can think of three:

1) 'Conventional' SWT - use Control.print(...)
Pseudo-code:
Printer p = new Printer(..);
p.startJob()
p.startPage()
GC gc = new GC( p );
ganttChart.print( gc ); // as it extends Control
// tidy up

2) Create and print a screenshot image:
Pseudo-code:
// get screenshot
Image i = new Image( Display.getCurrent(), ganttChart.getSize().x, ...y );
GC gc = new GC( ganttChart );
gc.copyArea( i, 0, 0 );
// copy to print image
Printer p = new Printer(..);
Image pi = new Image( p, i.getImageData() );
GC pgc = new GC( p );
pgc.drawImage( pi, .. );
// tidy up

3) Use PaperClips
Pseudo-code: ?

The first two will only print what is displayed on screen and I am not sure how to ensure all the hidden (ie scrollable) content is included. Moreover I am sure I will also have scaling and pagination issues.

The PaperClips library offers help with such issues but how complex is it to develop the necessary 'Print' interface implementation for such a complex GUI widget?

Any advices, ideas, alternatives?
Many thanks,

Mike E.


-
Previous Topic:GridTreeViewer footer - how to determine if mouse is hovering?
Next Topic: PercentComplete invisible?
Goto Forum:
  


Current Time: Fri Nov 21 17:45:59 GMT 2014

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

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