Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Zest custom figures
Zest custom figures [message #243252] Thu, 29 May 2008 14:44 Go to next message
Stefan Tucker is currently offline Stefan TuckerFriend
Messages: 4
Registered: July 2009
Junior Member
I'm working on, essentially, displaying a flowchart using Zest. I would,
of course, like to create custom figures for some of the nodes. Nothing
fancy, just diamonds and ovals to start. Unfortunately Bug 201960
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=201960> removed support
for custom figures and says "... the client is expected to subclass the
node if they wish to add a figure. The UML Example shows how this can be
done."

There's a Draw2d UML example, but it says nothing about Zest. The Zest
Snippets have nothing about UML or custom figures. There's an
org.eclipse.zest.examples.uml directory in the CVS repository, but it's
empty (as are all the other examples.* folders).

http://www.eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2 d.html
http://www.eclipse.org/mylyn/sandbox/zest/zest_snippets.php

My solution is to subclass GraphNode and override createFigureForModel()
to use a new class. I noted that GraphNode#updateFigureForModel() skips
a lot of good stuff if the figure doesn't subclass GraphLabel. Since I'd
like to use as much of the existing work in Zest as possible, the new
class derives from GraphLabel; I overrode paint() and
adjustBoundsToFit() to draw the new shape and return its new size. Since
GraphLabel is an internal class, I had to modify the Zest core JAR's
MANIFEST.MF to export internal.*. (Yes, ew.)

I doubt this is the most elegant solution. Please let me know if I'm
missing something. I'm quite new to Eclipse and Zest, so that's totally
(hopefully?) possible.

I'm using Zest/Draw2d 3.4.0 RC2, but there doesn't seem to be anything
new since the Jan 15 release. I checked out the source from CVS, in
hopes of getting any updates. I don't see any difference between the
HEAD and the Jan 15 source. Is that correct or am I doing something wrong?
Re: Zest custom figures [message #245311 is a reply to message #243252] Wed, 03 September 2008 00:40 Go to previous messageGo to next message
Tully Yates is currently offline Tully YatesFriend
Messages: 7
Registered: July 2009
Junior Member
Hi Stefan,

I case you didn't have any more luck with this in the past 3 months or
so...

I did a lot of digging with google and stumbled across UMLExample.java
which I guess is what Ian was referring to. I pulled all the necessary
classes and gifs from the following URL

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gef/tes t/org.eclipse.zest.tests/src/org/eclipse/zest/tests/uml/UMLE xample.java?root=Tools_Project&view=co

Maybe this of some help to you, or others?
Re: Zest custom figures [message #245681 is a reply to message #245311] Wed, 24 September 2008 20:21 Go to previous message
Stefan Tucker is currently offline Stefan TuckerFriend
Messages: 4
Registered: July 2009
Junior Member
Nice find. Thank you.
Previous Topic:Connection in FreeFormLayout
Next Topic:Problem creating RCP Editor with GEF
Goto Forum:
  


Current Time: Tue Apr 16 18:50:33 GMT 2024

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

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

Back to the top