IFigure z-order [message #148925] |
Mon, 30 August 2004 11:00 |
Eclipse User |
|
|
|
Originally posted by: tiagoneves.hotmail.com
I have the following code where panel is an IFigure as well as figure.
I implement the mousemotionlistener on each figure that i add to the panel.
I add several figures in different locations of the panel.
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(panel);
panel.add(figure);
My problem is that when i dragg the figures to another point of the panel
the figure gets behind the figures added after this one has been added.
I want to get the figure i am dragging on top of all the figures.
How can i do that?
Any suggestion?
Thanks in advance.
Tiago Neves
|
|
|
Re: IFigure z-order [message #148965 is a reply to message #148925] |
Mon, 30 August 2004 14:51 |
Eclipse User |
|
|
|
Originally posted by: tiagoneves.hotmail.com
Dear Tiago Neves please do not ask any more questions that already been
answered.
For those who donŽt know how to solve this problem here is a solution.
z-order of Figures is based on their order in Figure.getChildren().
so in this particular case the figure in front is the last figure to be
added to panel.
to bring the selected figure to front tou just need to do:
panel.remove(figure);
panel.add(figure);
Thank you.
p.s:
is there any other way
Tiago Neves wrote:
> I have the following code where panel is an IFigure as well as figure.
> I implement the mousemotionlistener on each figure that i add to the panel.
> I add several figures in different locations of the panel.
> LightweightSystem lws = new LightweightSystem(canvas);
> lws.setContents(panel);
> panel.add(figure);
> My problem is that when i dragg the figures to another point of the panel
> the figure gets behind the figures added after this one has been added.
> I want to get the figure i am dragging on top of all the figures.
> How can i do that?
> Any suggestion?
> Thanks in advance.
> Tiago Neves
|
|
|
Powered by
FUDForum. Page generated in 0.03048 seconds