Question

I made an swt.graphics.Image object of a draw2d Layer containing draw2d polylines and few other figures like circles ellipses etc. I made a jpeg file from this Image object, all I can see are the ellipses, circles etc but no figures drawn using draw2d polylines(connection arrows, PolygonShapes etc) are present in the final jpeg file. I want the polylines also to be plotted and visible in the final jpeg file. Any ideas how i can do this? I have tried putting the Layer in a shell. But I have to display(which i should not do) the shell to the user using shell.open() only then the polyline shapes are visible in the final jpeg file. I guess the shell.open() forces the drawing of the shell and its children ( the Layer, the polylines etc). Is there are any workaround for not showing the shell but force the drawing on Layer for polylines?

Thanks and Regards Bharath

Was it helpful?

Solution

I got the solution for this. I called the validate() on the Layer. previously I was calling redraw(),Layout() etc on the FigureCanvas on which the Layer is present and there was no change. Now after calling the validate() on the Layer it seems to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top