NuB: Where do the Figures come from in the Mindmap-Example [message #20755] |
Wed, 16 August 2006 09:32  |
Eclipse User |
|
|
|
Hi @all,
I'm new in GMF and i worked my way through the tutorials of GMF (Mindmap).
Then I started to create my own graphical Editor with my own xsd-model. It
all worked fine by now.
I got the editor-plugin with a palette and the graphical editor-window.
My problem now is, how do I get some figures into my Model to draw them in
the graphical editor-window?
I tried to search the sourcecode of the shapes-example and the
mindmap-example. But I didn't find any hints how to bring those figures to
display.
Can anyone please help me with this? I just need a hint how to combine a
simple rectangle-figure with my Modelcode so that it is drawn after a
DnD-action.
Thanks in Advance for all your input!!!
Greets Alex
|
|
|
|
|
Re: NuB: Found Figures but still nothing is drawn!??? [message #22175 is a reply to message #21999] |
Thu, 17 August 2006 05:31   |
Eclipse User |
|
|
|
Hi Alexander,
if you want to display some text in your figures you can do that set the
properties for required component into
<your_model>.gmfmap/Mapping/TopNodeReference/Node Mapping/Label Mapping
for example if you want to display static text and value of attribute,
named 'value":
Edit Pattern = {0}
Features = EAttribute value
View Pattern = Static Text: {0}
If you need something else, please give me more details
Regards,
Trifonov
Alexander Haag wrote:
> Hi Trifonov,
>
> thanks for your kind answer. I worked my way through the tutorials on
> the wiki. I now know that the figures I was looking for are allways
> generated as an inner class of the EditParts. So far so good.
> As I discovered the inner classes, I tried to display those figures my
> own text (like the '<...>' from the mindmap-example). Therefore I copied
> the mindmap-figurecode.
> I started the Plugin, the Palette looks fine, but after the DnD-action
> nothing was drawn. Please tell me what I am doing wrong!! I'll paste the
> figure-code at the end of this message.
> Thanks in Advance
>
> Alex Haag
>
>>> Inner class >>
> /**
> * @generated
> */
> public class NodeTYPEIdFigure extends
> org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel {
> /**
> * @generated
> */
> public NodeTYPEIdFigure() {
> createContents();
> }
>
> /**
> * @generated
> */
> private void createContents() {
> org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig_0 = new
> org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel();
> fig_0.setText("Action");
>
> setFigureTopicNameFigure(fig_0);
>
> Object layData0 = null;
>
> this.add(fig_0, layData0);
> }
>
> /**
> * @generated
> */
> private boolean myUseLocalCoordinates = false;
>
> /**
> * @generated
> */
> protected boolean useLocalCoordinates() {
> return myUseLocalCoordinates;
> }
>
> /**
> * @generated
> */
> protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
> myUseLocalCoordinates = useLocalCoordinates;
> }
>
> /**
> * @generated
> */
> private org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel
> fTopicNameFigure;
>
> /**
> * @generated
> */
> public org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel
> getFigureTopicNameFigure() {
> return fTopicNameFigure;
> }
>
> /**
> * @generated
> */
> private void setFigureTopicNameFigure(
> org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel fig) {
> fTopicNameFigure = fig;
> }
> }
>
|
|
|
Re: NuB: Found Figures but still nothing is drawn!??? [message #22350 is a reply to message #22175] |
Thu, 17 August 2006 07:59  |
Eclipse User |
|
|
|
Hi Trifonov,
thanks for all your help! I finally got my figures drawn.
My failure was, that I had (wrong) entries in the 'Containment
Feature'-Property of the Top Node References in my *.gmfmap-file. I
deleted those entries and tata it worked.
Now everything is just fine and I can go on with my work.
Again thanks alot for your answers and time. You helped me save hours of
my time!!
Bye Alex
|
|
|
Powered by
FUDForum. Page generated in 0.03125 seconds