Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Moving Shapes Problem
Moving Shapes Problem [message #244246] Fri, 11 July 2008 17:13 Go to next message
Michael Swearingen is currently offline Michael SwearingenFriend
Messages: 26
Registered: July 2009
Junior Member
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?
Re: Moving Shapes Problem [message #244251 is a reply to message #244246] Sat, 12 July 2008 06:26 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
}
Re: Moving Shapes Problem [message #244348 is a reply to message #244246] Wed, 16 July 2008 15:54 Go to previous message
Michael Swearingen is currently offline Michael SwearingenFriend
Messages: 26
Registered: July 2009
Junior Member
Thanks for the tips guys
Previous Topic:Rotation and Transparency
Next Topic:Border Color
Goto Forum:
  


Current Time: Thu Apr 25 22:02:27 GMT 2024

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

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

Back to the top