|
Re: GEF figures don't show in editor [message #190091 is a reply to message #190075] |
Tue, 02 August 2005 00:38 |
Eclipse User |
|
|
|
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 |
Keith McQueen 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 |
Keith McQueen 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 |
Eclipse User |
|
|
|
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
> >
> >
> >
|
|
|
Powered by
FUDForum. Page generated in 0.04024 seconds