Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Children hidden by parent
Children hidden by parent [message #513301] Tue, 09 February 2010 17:08 Go to next message
Ben Wecker is currently offline Ben WeckerFriend
Messages: 6
Registered: February 2010
Junior Member
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 #513481 is a reply to message #513301] Wed, 10 February 2010 11:15 Go to previous messageGo to next message
Ben Wecker is currently offline Ben WeckerFriend
Messages: 6
Registered: February 2010
Junior Member
I have reduced the size of the ImageFigure within my figure, so that I can now place children at the border of the image. This is the result:

http://img689.imageshack.us/img689/4308/56020472.png

The green ellipse is a child element of the element with the red rectangle. The green ellipse should be displayed in front of the red rectangle. Any idea what I am doing wrong?
Re: Children hidden by parent [message #513483 is a reply to message #513481] Wed, 10 February 2010 11:19 Go to previous messageGo to next message
Ben Wecker is currently offline Ben WeckerFriend
Messages: 6
Registered: February 2010
Junior Member
Ok, I could fix it. Interesting enough. Before my view extended Figure and itself contained an ImageFigure. Now my view directly extends ImageFigure (thus opening a new range of problems Razz )
Re: Children hidden by parent [message #513484 is a reply to message #513481] Wed, 10 February 2010 11:20 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Quote:
(which I draw in the repaint() method of the view)


What do you mean??

can you please show the code...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Children hidden by parent [message #513498 is a reply to message #513484] Wed, 10 February 2010 12:08 Go to previous message
Ben Wecker is currently offline Ben WeckerFriend
Messages: 6
Registered: February 2010
Junior Member
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 12:09]

Report message to a moderator

Previous Topic:attach source of gef_3.4.1.v20080806 and draw2d_3.4.2.v20090114-1330
Next Topic:[Announce] GEF 3.5.2RC3 is available
Goto Forum:
  


Current Time: Thu Mar 28 08:43:45 GMT 2024

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

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

Back to the top