viernes, 8 de febrero de 2013

Eugenia - epsilon - GMF: howto use images instead shapes figures easily

[This post and the blog have been moved to:]

I did not find any easy way to do it on Internet, so I hope it helps you!

I'll go straight to the point. This is an extract of the code:


@gmf.node(figure="figures.In", label.icon="false", label.placement="none", tool.small.bundle="Eugenia_ArcadeTongame", tool.small.path="icons/In32.ico")
class In extends Element {
   attr boolean isStart;

package figures;
import org.eclipse.swt.widgets.Display;
import org.eclipse.draw2d.ImageFigure;
public class In extends ImageFigure {
  public In()  {
 InputStream in = getClass().getResourceAsStream("images/In48.png");
 Image image = new Image(Display.getDefault(), in);


This is the project structure:

Note: the full project is located at GitHub: (click at View Arcadetongame on GitHub to see the project in GitHub)

This is the RCP Application result:

No hay comentarios:

Publicar un comentario