How to make connections go under the diagram? [message #226241] |
Wed, 08 November 2006 07:14  |
Eclipse User |
|
|
|
Originally posted by: shruthi.cn.in.bosch.com
Hello everybody,
In GEF, Normally, the connections are drawn on top of the diagrams.
Therefore, diagrams can get overlapped with connections. But i want the
connections to go under the diagrams. How can I put them into the
background?
I tried overriding the createPrintableLayers in a class that inherits from
ScalableFreeformRootEditPart.
protected LayeredPane createPrintableLayers() {
FreeformLayeredPane layeredPane = new FreeformLayeredPane();
layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
return layeredPane;
}
And i also set the viewer's root edit part to an instance of the class
that extends ScalableFreeformRootEditPart.
Diagrams are made up of some polygon and inside the polygon, at the centre
there is image. With the approach described above, the portion of the
connection that gets overlapped with the image goes under the image and is
not seen. But remaining portion of the connection is still on top of the
polygon.
Therefore, Partly, the connections are on top of diagram.
Please help me in this problem. Any links, source examples would also be
of great help to me
Thanks,
Best Regards
Shruthi
|
|
|
Re: How to make connections go under the diagram? [message #226288 is a reply to message #226241] |
Wed, 08 November 2006 19:08   |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Are you sure your polygon is not just transparent? Let's see a screenshot.
"shruthi" <shruthi.cn@in.bosch.com> wrote in message
news:2400de63a3bcb53f0bfc6341b6255d69$1@www.eclipse.org...
> Hello everybody,
>
> In GEF, Normally, the connections are drawn on top of the diagrams.
> Therefore, diagrams can get overlapped with connections. But i want the
> connections to go under the diagrams. How can I put them into the
> background?
> I tried overriding the createPrintableLayers in a class that inherits from
> ScalableFreeformRootEditPart.
>
> protected LayeredPane createPrintableLayers() {
> FreeformLayeredPane layeredPane = new FreeformLayeredPane();
> layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
> layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
> return layeredPane;
> }
> And i also set the viewer's root edit part to an instance of the class
> that extends ScalableFreeformRootEditPart.
>
> Diagrams are made up of some polygon and inside the polygon, at the centre
> there is image. With the approach described above, the portion of the
> connection that gets overlapped with the image goes under the image and is
> not seen. But remaining portion of the connection is still on top of the
> polygon.
> Therefore, Partly, the connections are on top of diagram.
> Please help me in this problem. Any links, source examples would also be
> of great help to me
>
> Thanks,
> Best Regards
> Shruthi
>
>
>
>
>
|
|
|
|
Re: How to make connections go under the diagram? [message #226559 is a reply to message #226455] |
Thu, 16 November 2006 17:53  |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
As I suspected, your figures are transparent. So, of course, you'd see
whatever's underneath them. IFigure#setOpaque(true) should do the trick.
Ensure that any custom figures you might have invoke super.paintFigure().
For Shapes (such as RectangleFigure), setFill(true) should be sufficient.
"shruthi" <shruthi.cn@in.bosch.com> wrote in message
news:17606608.1163396786305.JavaMail.root@cp1.javalobby.org...
> Hello,
>
> I have attached a file. In the snapshot, you can see that, for element
> log_1, there is no image and hence the entire connection passing under it
> is visible.
>
> For element "matrix" below, since there is an image at the center, only a
> portion of the connection is seen entering the square box of "matrix"
> element.
>
> I tried out some code to solve the problem. I filled the square box with a
> white background color.
>
> graphics.setBackgroundColor(ColorConstants.White);
> graphics.fillPolygon(pointList);
>
> Then the connection was not seen. Is this approach right?
>
> Please let me know.
> Thanks,
> Best Regards
> Shruthi
|
|
|
Powered by
FUDForum. Page generated in 0.04354 seconds