Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Newbie Question: Model not being painted
Newbie Question: Model not being painted [message #129905] Thu, 29 April 2004 22:05 Go to next message
Eclipse UserFriend
Originally posted by: etrexuser.hotmail.com

Hi,

I am a newbie to GEF and I've been trying to display an element on the
screen for quite some time now.

My EditPartFactory creates an instance of a ChildEditPart.
The ChildEditPart defines a XYLayoutEditPolicy for the Layout_Role
The Policy Creates a ChildFigure
==>(Problem 1. The ChildFigure is painted immediately)

The Policy does a getCreateCommand.
The Palette points to the Child class on selection of the Child tool.
When I select the Child Tool and click on the workspace I am able to create
an instance of the model via the execute method of the command.
==>(Problem 2. getContraintsFor(request) returns a NullPointerException)

request.getLocation() works and I am able to store the location of the Child
as part of the child.
The command sends a fireStructureChange() method.
I am able to get the event in the ChildEditPart.
==>(Problem 3. Refresh, RefreshChildren and RefreshVisuals don't seem to do
anything. Nothing appears on the screen).
==>(Problem 4. If I override paintFigure in my Figure class I can see the
control going there, but I don't get the location correctly. It is always 0,
0).

Can you please help. I am desperate.

Thanks.
Re: Newbie Question: Model not being painted [message #130592 is a reply to message #129905] Tue, 04 May 2004 20:55 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
"Etrex User" <etrexuser@hotmail.com> wrote in message
news:c6rtko$80j$1@eclipse.org...
> Hi,
>
> I am a newbie to GEF and I've been trying to display an element on the
> screen for quite some time now.
>
> My EditPartFactory creates an instance of a ChildEditPart.
> The ChildEditPart defines a XYLayoutEditPolicy for the Layout_Role
> The Policy Creates a ChildFigure
> ==>(Problem 1. The ChildFigure is painted immediately)

Is the ChildEditPart a container? The figure representing ChildEditPart is
created in ChildEditPart's createFigure() method, right? Did you mean that
the XYLayoutEditPolicy provides commands to add/create/orphan/delete
children of this ChildEditPart? What do you mean the child figure is shown
immediately?

>
> The Policy does a getCreateCommand.
> The Palette points to the Child class on selection of the Child tool.
> When I select the Child Tool and click on the workspace I am able to
create
> an instance of the model via the execute method of the command.
> ==>(Problem 2. getContraintsFor(request) returns a NullPointerException)

Stack trace? With problems like this you should look at how the logic
example is doing things. It's doing exactly what you want to do here. So,
you just need to find out what you're doing differently.

>
> request.getLocation() works and I am able to store the location of the
Child
> as part of the child.
> The command sends a fireStructureChange() method.
> I am able to get the event in the ChildEditPart.
> ==>(Problem 3. Refresh, RefreshChildren and RefreshVisuals don't seem to
do
> anything. Nothing appears on the screen).
> ==>(Problem 4. If I override paintFigure in my Figure class I can see the
> control going there, but I don't get the location correctly. It is always
0,
> 0).

Are you updating the figure's location in refreshVisuals()?

>
> Can you please help. I am desperate.
>
> Thanks.
>
>
>
>
>
>
Re: Newbie Question: Model not being painted [message #131837 is a reply to message #130592] Tue, 11 May 2004 17:53 Go to previous message
Eclipse UserFriend
Originally posted by: etrexuser.hotmail.com

Hi Pratik,

Thanks for your comments. I have managed to solve the issue by now.

My basics of GEF were not clear. I was not overriding the getModelChildren()
to return the child models and so the editparts/figures were not being
created.

Regards.


"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:c78s39$1ju$1@eclipse.org...
>
> "Etrex User" <etrexuser@hotmail.com> wrote in message
> news:c6rtko$80j$1@eclipse.org...
> > Hi,
> >
> > I am a newbie to GEF and I've been trying to display an element on the
> > screen for quite some time now.
> >
> > My EditPartFactory creates an instance of a ChildEditPart.
> > The ChildEditPart defines a XYLayoutEditPolicy for the Layout_Role
> > The Policy Creates a ChildFigure
> > ==>(Problem 1. The ChildFigure is painted immediately)
>
> Is the ChildEditPart a container? The figure representing ChildEditPart
is
> created in ChildEditPart's createFigure() method, right? Did you mean
that
> the XYLayoutEditPolicy provides commands to add/create/orphan/delete
> children of this ChildEditPart? What do you mean the child figure is
shown
> immediately?
>
> >
> > The Policy does a getCreateCommand.
> > The Palette points to the Child class on selection of the Child tool.
> > When I select the Child Tool and click on the workspace I am able to
> create
> > an instance of the model via the execute method of the command.
> > ==>(Problem 2. getContraintsFor(request) returns a NullPointerException)
>
> Stack trace? With problems like this you should look at how the logic
> example is doing things. It's doing exactly what you want to do here.
So,
> you just need to find out what you're doing differently.
>
> >
> > request.getLocation() works and I am able to store the location of the
> Child
> > as part of the child.
> > The command sends a fireStructureChange() method.
> > I am able to get the event in the ChildEditPart.
> > ==>(Problem 3. Refresh, RefreshChildren and RefreshVisuals don't seem to
> do
> > anything. Nothing appears on the screen).
> > ==>(Problem 4. If I override paintFigure in my Figure class I can see
the
> > control going there, but I don't get the location correctly. It is
always
> 0,
> > 0).
>
> Are you updating the figure's location in refreshVisuals()?
>
> >
> > Can you please help. I am desperate.
> >
> > Thanks.
> >
> >
> >
> >
> >
> >
>
>
Previous Topic:[solved ....]
Next Topic:pixel , measurment units -again
Goto Forum:
  


Current Time: Tue Sep 24 05:56:31 GMT 2024

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

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

Back to the top