@namespace(uri="friends", prefix="") package friends; @gmf.diagram class World { val Person[*] people; } @gmf.node(figure="figures.PersonFigure", label.icon="false", label="name", label.placement="external") class Person { attr String name; @gmf.link(width="2", color="0,255,0", source.decoration="arrow", target.decoration="arrow", style="dash") ref Person[*] friendOf; @gmf.link(width="2", color="255,0,0", source.decoration="arrow", target.decoration="arrow", style="dash") ref Person[*] enemyOf; }
/******************************************************************************* * Copyright (c) 2009 The University of York. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Dimitrios Kolovos - initial API and implementation ******************************************************************************/ package figures; import org.eclipse.draw2d.ImageFigure; import org.eclipse.epsilon.eugenia.examples.friends.figures.activator.PluginActivator; /** * @generated */ public class PersonFigure extends ImageFigure { public PersonFigure() { super(PluginActivator.imageDescriptorFromPlugin(PluginActivator.ID, "images/Person.png").createImage(), 0); } }
There are two ways to get the code of this example:
In this example we use EuGENia to implement a GMF editor with images instead of shapes for nodes.
.emf files are Ecore metamodels expressed using the Emfatic textual syntax.
More examples are available in the examples folder of the SVN repository.