Problem with repaint() [message #231036] |
Mon, 26 February 2007 13:20 |
Eclipse User |
|
|
|
Originally posted by: news.madlener.online.de
Hello everyone,
I got a problem refreshing the visuals for my editor view. After
deleting objects, that are represented as single figures drawn on a
freeform-layer, the figure stays on the layer.
In the refreshVisuals() I do call getFigure.repaint().
I can use the delete() Action in the context-menue, . The figure gets
removed only if I click it again, or the Figure gets out of bounds (on
the screen)- I am quite sure that this is a really silly bug, but I just
can not get a finger on the spot.
Help is very appreciated!
Cheers
Oliver
|
|
|
Re: Problem with repaint() [message #231044 is a reply to message #231036] |
Mon, 26 February 2007 13:48 |
Eclipse User |
|
|
|
Originally posted by: jakub.jurkiewicz.gmail.com
I cannot say what might be wrong if I don't see your code.
In my simple editor I've got:
protected void refreshVisuals() {
Rectangle bounds = new Rectangle(getCastedModel().getLocation(),
getCastedModel().getSize());
((GraphicalEditPart) getParent()).setLayoutConstraint(this,
getFigure(), bounds);
super.refreshVisuals();
}
So as you see I don't invoke the repaint method anywhere.
Hope this helps :)
Jakub Jurkiewicz
Oliver Madlener wrote:
> Hello everyone,
>
> I got a problem refreshing the visuals for my editor view. After
> deleting objects, that are represented as single figures drawn on a
> freeform-layer, the figure stays on the layer.
> In the refreshVisuals() I do call getFigure.repaint().
> I can use the delete() Action in the context-menue, . The figure gets
> removed only if I click it again, or the Figure gets out of bounds (on
> the screen)- I am quite sure that this is a really silly bug, but I just
> can not get a finger on the spot.
> Help is very appreciated!
>
> Cheers
>
> Oliver
|
|
|
Re: Problem with repaint() [message #231136 is a reply to message #231044] |
Tue, 27 February 2007 13:53 |
Eclipse User |
|
|
|
Originally posted by: news.madlener.online.de
Hi Jakub,
thanks for your quick answer. I checked it, but it doesn't work this
way. I am using a freeformlayer, I did not implement the getLocation()
for the objects, because I am using a NodeLayouter. No XYLayout. The
Objects are positioned according their position in the tree.
Somehow I have to mark the part were the figure is painted as dirty, but
I do not know how.
Thanks again.
Cheers
Oliver
|
|
|
Re: Problem with repaint() [message #231403 is a reply to message #231036] |
Thu, 08 March 2007 14:31 |
Eclipse User |
|
|
|
Originally posted by: news.madlener.online.de
Hello Everyone,
I still haven't worked out the problem. At least now I am able to update
the window, but only after I click a second time (after deleting the
object)- Does anyone know why the window is not updated after I gave the
command, but after the second mouse-click?
cheers
Oliver
|
|
|
Solved [message #231483 is a reply to message #231403] |
Fri, 09 March 2007 07:54 |
Eclipse User |
|
|
|
Originally posted by: news.madlener.online.de
Hi everyone,
for those who wondered what the problem was. The layout manager
"DirectedGraphLayout" did not finish his work, and therefor the window
was not updated instantly. Well I do not really know why it worked after
I clicked the mouse again, but there you go.
Cheers
Oliver
|
|
|
Powered by
FUDForum. Page generated in 0.04052 seconds