Children hidden by parent [message #513301] |
Tue, 09 February 2010 12:08  |
Eclipse User |
|
|
|
Hi,
I have a weird behaviour. I have a single parent, whose figure consists of a large image (which I draw in the repaint() method of the view). The parent has several children, whose figure is a small ellipse. Somehow the parent now is in front of the children, thus they are hidden. The parent view has an XYLayout. I tried reducing the size of the rectangle of the parent's image (so that the image does not cover the entire editor). I can see how the children are drawn partially, if I place them on the border of the image. Outside of the image, they are drawn properly. Again, the image is part of the parent. Any idea how to solve this problem?
|
|
|
|
|
|
Re: Children hidden by parent [message #513498 is a reply to message #513484] |
Wed, 10 February 2010 07:08  |
Eclipse User |
|
|
|
Ok, before I had:
class MyView extends Figure
private ImageFigure figure;
public MyView(){
[...]
figure = new ImageFigure(image);
this.add(figure, new Rectangle(0,0,100,100));
}
[...]
@Override
public void repaint(){
image = new Image(Display.getCurrent(), new InputStream(new URL("someAddress").openStream()));
figure.setImage(image);
super.repaint();
}
and now I changed it to:
class MyView extends ImageFigure
public MyView(){
[...]
}
[...]
public void update(){
image = new Image(Display.getCurrent(), new InputStream(new URL("someAddress").openStream()));
this.setImage(image);
}
I hope, this helps
[Updated on: Wed, 10 February 2010 07:09] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.07591 seconds