|
Re: Moving Shapes Problem [message #244251 is a reply to message #244246] |
Sat, 12 July 2008 06:26 |
Eclipse User |
|
|
|
Originally posted by: annamalai.ancitconsulting.com
Hey Michael
I suppose you have a figure placed on another figure if i am not wrong ..
and when you move the parent figure the child figure doesnt move with it ...
Now in this case ... the problem is with the figure that is placed inside
.... you need to override paintGraphics and implement the bound update for
the figure inside the parent figure ...
Will send you a example soon ... i just logged on and saw your mesg .. thot
will leave a note so that until then you can try your hands on paintGraphics
....
Regards
Malai
"Michael S." <michael.swearingen@gmail.com> wrote in message
news:2fd16b98b6539fb89c354a44c3f5ea48$1@www.eclipse.org...
> Hi Everybody,
>
> I am working on my first GEF project and I've been basing mine off the
> Shapes Editor example. I've got it up and running and I ran into this
> problem. When I move my figure it either disappears or part of it moves
> out of the bounds rectangle.
>
> Some art work to help
>
> Before After
> ________ ________
> | | | |
> | /\ | | /\|
> | / \ | | / |
> |/____\| | /___|
> | | | |
>
|
|
|
Re: Moving Shapes Problem [message #244290 is a reply to message #244246] |
Tue, 15 July 2008 06:49 |
Eclipse User |
|
|
|
Originally posted by: lifesting.gmail.com
Michael S. wrote:
> Hi Everybody,
>
> I am working on my first GEF project and I've been basing mine off the
> Shapes Editor example. I've got it up and running and I ran into this
> problem. When I move my figure it either disappears or part of it moves
> out of the bounds rectangle.
>
> Some art work to help
>
> Before After
> ________ ________
> | | | |
> | /\ | | /\|
> | / \ | | / |
> |/____\| | /___|
> | | | |
> ¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯
>
> It only happens when I change the location, and I've tried changing the
> location every way I can think of. All my figures are drawn using the
> draw 2d built in figures.
>
> Anyone have any ideas / suggestions?
>
hi, Michael, you can simple override the *primTranslate* method in your
inner figure definition, it may like this below:
PointList myPoints = ...
@override
protected void primTranslate(int dx, int dy) {
super.primTranslate(dx,dy);
myPoints.translate(dx,dy);
....//more complex operation against to vertexes or edges.
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.02255 seconds