Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF figures don't show in editor
GEF figures don't show in editor [message #190075] Mon, 01 August 2005 23:53 Go to next message
Keith McQueen is currently offline Keith McQueenFriend
Messages: 73
Registered: July 2009
Member
I'm really *very* new to GEF, but I've been following along with some of
the documentation. I've also been looking hard at the Shapes Diagram
Editor example. Here is my problem: the figures created in the
createFigure() method of my edit part are not displayed in the editor.
I can tell that the figures (just simple RectangleFigures for now) are
being created, but I see nothing in the editor's view. Does anyone have
any idea of what I missed?

Thanks for your patience with the GEF newbie,
Keith
Re: GEF figures don't show in editor [message #190091 is a reply to message #190075] Tue, 02 August 2005 00:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Are you setting the layout constraint in the refreshVisuals() method of your
EditPart? Just set the figure's bounds to some hard-coded value for now to
see if it shows up.

"Keith McQueen" <kmcqueen@tsccos.com> wrote in message
news:dcmcv0$4jp$1@news.eclipse.org...
> I'm really *very* new to GEF, but I've been following along with some of
> the documentation. I've also been looking hard at the Shapes Diagram
> Editor example. Here is my problem: the figures created in the
> createFigure() method of my edit part are not displayed in the editor.
> I can tell that the figures (just simple RectangleFigures for now) are
> being created, but I see nothing in the editor's view. Does anyone have
> any idea of what I missed?
>
> Thanks for your patience with the GEF newbie,
> Keith
Re: GEF figures don't show in editor [message #190139 is a reply to message #190091] Tue, 02 August 2005 16:31 Go to previous messageGo to next message
Keith McQueen is currently offline Keith McQueenFriend
Messages: 73
Registered: July 2009
Member
I am. The code for my EditPart class is very simple:

public class VstrpElementEditPart extends AbstractGraphicalEditPart
{
protected IFigure createFigure()
{
RectangleFigure rectangleFigure = new RectangleFigure();
rectangleFigure.setBackgroundColor(ColorConstants.red);
rectangleFigure.setPreferredSize(20, 20);
rectangleFigure.setOpaque(true);
rectangleFigure.setVisible(true);

return rectangleFigure;
}

protected void createEditPolicies()
{
// TODO Auto-generated method stub
}

protected List getModelChildren()
{
Object model = this.getModel();
if (model != null && model instanceof IVstrpElement)
return Arrays.asList(((IVstrpElement) model).getChildren());

return super.getModelChildren();
}

protected void refreshVisuals()
{
((GraphicalEditPart) this.getParent()).setLayoutConstraint(this,
this.getFigure(), new Rectangle(30, 30, 50, 50));
}
}


Pratik Shah wrote:
> Are you setting the layout constraint in the refreshVisuals() method of your
> EditPart? Just set the figure's bounds to some hard-coded value for now to
> see if it shows up.
>
> "Keith McQueen" <kmcqueen@tsccos.com> wrote in message
> news:dcmcv0$4jp$1@news.eclipse.org...
>
>>I'm really *very* new to GEF, but I've been following along with some of
>>the documentation. I've also been looking hard at the Shapes Diagram
>>Editor example. Here is my problem: the figures created in the
>>createFigure() method of my edit part are not displayed in the editor.
>>I can tell that the figures (just simple RectangleFigures for now) are
>>being created, but I see nothing in the editor's view. Does anyone have
>>any idea of what I missed?
>>
>>Thanks for your patience with the GEF newbie,
>>Keith
>
>
>
Re: GEF figures don't show in editor [message #190147 is a reply to message #190091] Tue, 02 August 2005 17:16 Go to previous messageGo to next message
Keith McQueen is currently offline Keith McQueenFriend
Messages: 73
Registered: July 2009
Member
Okay, I found my silly mistake. I have another EditPart and I forgot to
override the getModelChildren() method. It seems weird, however, that I
was creating figures for children that I hadn't got. Anyway, now I get
something to show up, but the figures are not moveable in the editor. I
am using the same FreeformLayer as in the shapes example, but I can't
get anything to be selectable or moveable. What is it now?

Thanks for your patience and your help,
Keith

Pratik Shah wrote:
> Are you setting the layout constraint in the refreshVisuals() method of your
> EditPart? Just set the figure's bounds to some hard-coded value for now to
> see if it shows up.
>
> "Keith McQueen" <kmcqueen@tsccos.com> wrote in message
> news:dcmcv0$4jp$1@news.eclipse.org...
>
>>I'm really *very* new to GEF, but I've been following along with some of
>>the documentation. I've also been looking hard at the Shapes Diagram
>>Editor example. Here is my problem: the figures created in the
>>createFigure() method of my edit part are not displayed in the editor.
>>I can tell that the figures (just simple RectangleFigures for now) are
>>being created, but I see nothing in the editor's view. Does anyone have
>>any idea of what I missed?
>>
>>Thanks for your patience with the GEF newbie,
>>Keith
>
>
>
Re: GEF figures don't show in editor [message #190155 is a reply to message #190147] Tue, 02 August 2005 17:23 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

You didn't install any EditPolicies in createEditPolicies().

"Keith McQueen" <kmcqueen@tsccos.com> wrote in message
news:dcoa2l$8k8$1@news.eclipse.org...
> Okay, I found my silly mistake. I have another EditPart and I forgot to
> override the getModelChildren() method. It seems weird, however, that I
> was creating figures for children that I hadn't got. Anyway, now I get
> something to show up, but the figures are not moveable in the editor. I
> am using the same FreeformLayer as in the shapes example, but I can't
> get anything to be selectable or moveable. What is it now?
>
> Thanks for your patience and your help,
> Keith
>
> Pratik Shah wrote:
> > Are you setting the layout constraint in the refreshVisuals() method of
your
> > EditPart? Just set the figure's bounds to some hard-coded value for now
to
> > see if it shows up.
> >
> > "Keith McQueen" <kmcqueen@tsccos.com> wrote in message
> > news:dcmcv0$4jp$1@news.eclipse.org...
> >
> >>I'm really *very* new to GEF, but I've been following along with some of
> >>the documentation. I've also been looking hard at the Shapes Diagram
> >>Editor example. Here is my problem: the figures created in the
> >>createFigure() method of my edit part are not displayed in the editor.
> >>I can tell that the figures (just simple RectangleFigures for now) are
> >>being created, but I see nothing in the editor's view. Does anyone have
> >>any idea of what I missed?
> >>
> >>Thanks for your patience with the GEF newbie,
> >>Keith
> >
> >
> >
Previous Topic:How to expand all the tree node in GEF TreeViewer
Next Topic:how to use zoom
Goto Forum:
  


Current Time: Thu Dec 26 22:59:17 GMT 2024

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

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

Back to the top