| [Zest] Drawing grahics on a graph [message #902796] |
Mon, 20 August 2012 09:32  |
Magnus Sjöstrand Messages: 16 Registered: June 2012 |
Junior Member |
|
|
I think I have seen this question being mentioned somewhere else but there was no good solution to it.
The issue is that when drawing something (rectangle, drawline) on a graph and thereafter adding nodes the old drawings will disappear from being overpainted. The drawing for these shapes is done in a paintEvent. It possibly have something to do with the redrawing of figureCanvas (?)
I saw a 'dirty' solution to this in where one would make the drawings in a composite parent and place a transparent graph over that so that the drawings would be placed under the nodes.
Also, as suggested as a solution, making the graph's background transparant only gives me a empty background (this is not black)
Color c1 = new Color(Display.getDefault(), 50, 50, 200);
graph = new Graph(parent, SWT.NONE);
parent.setBackground(c1);
graph.getLightweightSystem().getRootFigure().setOpaque(false);
[Updated on: Mon, 20 August 2012 09:38] Report message to a moderator
|
|
|