Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » NuB: Where do the Figures come from in the Mindmap-Example
NuB: Where do the Figures come from in the Mindmap-Example [message #20755] Wed, 16 August 2006 09:32 Go to next message
Eclipse UserFriend
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: Where do the Figures come from in the Mindmap-Example [message #20768 is a reply to message #20755] Wed, 16 August 2006 09:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Into *.gmfmap you must map the model, tool definition and shapes. I
haven't seen the Mindmap example but as far as I remember (and if it was
no changed) these files are missing in examples, just follow the
tutorial - in it is described how you can create and change these files.
Take a look at the tutorials in wiki
( http://wiki.eclipse.org/index.php/Graphical_Modeling_Framewo rk).

Regards,
Trifonov



Alexander Haag wrote:
> 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
>
>
NuB: Found Figures but still nothing is drawn!??? [message #21999 is a reply to message #20768] Thu, 17 August 2006 04:58 Go to previous messageGo to next message
Eclipse UserFriend
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 #22175 is a reply to message #21999] Thu, 17 August 2006 05:31 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Input and output ports in an element
Next Topic:generating diagram code from a headless build
Goto Forum:
  


Current Time: Wed Apr 23 22:57:35 EDT 2025

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

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

Back to the top