Home
.. Links
.. Search
.. Plugins
.. Help
.. Irc Faq

Projects
.. Platform/Faq
.. JDT/Faq/Plan
.. PDE/Faq
.. SWT/Faq
.. RCP/Faq

Tools Projects
.. CDT/Faq
.. GEF/Faq
.. EMF/Faq

Wiki Tutorials

Hosted Projects
.. MTJ
.. Google Summer Of Code 2007
.. Update Manager 2.0
.. EasyEclipse
.. Stylebase for Eclipse

Archives

GEFFaq


This is a non official FAQ for GEF. The official one can be found here.


Is GEF stable enough to start a project?

Question

I need a diagramming component for an editor plugin I'm developing. I
was planning to use a third party ActiveX component when GEF was
announced. Based on my initial evaluation of GEF, I would be inclined
to use it instead. However I'm concerned about the timing, since GEF is
still in the proposal phase. Do I need to wait until GEF is past the
proposal phase before it's safe to assume that it will become part of
Eclipse? Is there a schedule for it's inclusion in Eclpise? Are there
any issues with the stability of the code at this stage?
Thanks,
David

Answer

I believe that GEF is past the proposal stage since there is this newsgroup
and CVS home for GEF.
All projects under the "Tools" heading will not be included in the Eclipse
base.
The code is stable.
Randy

Where can I find documentation?

In the R2.0 of Eclipse, the help section contains from now documenattion about GEF and Draw2D.
There is also an IBM redbook on the subject. Go to www.redbooks.ibm.com and search for 'graphical editing framework'.

how do i create a non transparent figure?

figure.setOpaque(true)

how to draw a bendpoint connection?

You probably need to use the BendpointRouter as the Connection Layer's
router.
You can use RelativeBendpoint or AbsoluteBendpoint. The difference is that
if you move the source and target, Absolute bendpoints do not move together.
Logic example shows how to do this. See WireEditPart.

Example

PolylineConnection connector = new PolylineConnection();
connector.setSourceAnchor(new ChopboxAnchor(new RectangleFigure()));
connector.setTargetAnchor(new ChopboxAnchor(new RectangleFigure()));
connector.setTargetDecoration(new PolygonDecoration());
RelativeBendpoint rbp = new RelativeBendpoint(connector);
rbp.setRelativeDimensions( 150, 155);
ArrayList list = new ArrayList();
list.add(rbp);
connector.setRoutingConstraint(list);
connector.setConnectionRouter(new BendpointRouter());


What is GraphicalRootEditPart future?

FreeformGraphicalRootEditPart is used in Logic Example (build 20020821). Documentations don't really show a difference to GraphicalRootEditPart. It is therefore interesting to wonder if GraphicalRootEditPart will be dropped in the future...

(answer taken from the newsgroup)

Freeform is the preferred way, and yes, graphicalRootEditPart will be dropped. The difference is that Freeform allows you to extend the diagram surface in all 4 direction (as opposed to just right and down for the other root).
It also extends the diagram due to "nodes" being moved, or as a result of benpoints on connections. GraphicalRoot does not grow when you bend connections.

I have often heard SWT referred to as a "heavyweight" toolkit. What does "heavyweight" mean in this context?


It means that SWT controls map directly to operating system controls.
Controls acquire operating system resources within a top level shell. The
concepts and implementation of focus, clipping, mouse down, z-order etc. are
the same as the operating system. In a lightweight toolkit, controls are
drawn within a top level shell and focus, clipping, mouse events, z-order
etc. are implemented by the toolkit, not the operating system.

Very generally, heavyweight means that there is a one to one association
between the tookit's widgets and native widgets. For instance, for every
SWT widget wraps a native widget.

Lightweight, in general, means that widgets are 'emulated' and do not
necessary have any associated native widget. For instance, when you create
a JFrame in Swing there is a native window associated with the JFrame.
However, if you then add 100 text boxes to that frame no native text boxes
are created. All the text boxes are basically just 'drawn' onto the
containing frame's window.

The advantage of a heavyweight toolkit is it's tight coupling to the native
look and feel. This can be a major advantage when the native L&F is
advanced and optimized, like on Windows.
The advantage of a lightweight toolkit can be easier programming (you don't
have to keep careful track of widgets and make sure that they are disposed
of), and better performance in some cases (yes, better performance. Try
creating a editable grid by creating an array of text boxes. In SWT such a
grid would probably perform poorly but in Swing such a grid would probably
perform decently).

Actually, JFrame and JDialog are the only heavyweight components in
Swing. JFrame does have a native peer. Indirect though it may be.

 


How to add SWT widget (eg. Table) on to the GraphicalEditPart composite?

 

Question

I am trying to add a SWT widget (like a Table) on the GraphicalEditPart. When i add it on to the parent composite in createPartControl() it gets added in to a new column next to the GraphicalViewer and I am not able to control its width. Can anyone please guide me as to how to add a SWT widget on to a GraphicalEditPart? either to the left (width controllable) or below the graphical viewer.

FYI, when i try to create a new composite from the parent in createPartControl() the createGraphicalViewer() does not accept the modified composite on which new GridLayout is set.

Answer 

 


Comments:

From kittyscalgary - 6/9/05 2:32 PM

Can I add some editable components on a figure ? thank you

From tear - 3/11/05 8:58 AM

Hello There

The examples are very fine, but I cannot find an example for an standalone application. All the GEF examples are Eclipse plugin based. I'd like to use GEF in a standalone application. Can anybody help me or give me a hint or a snippet?

That would be very nice

Manu

From tear - 3/11/05 8:46 AM

Hello There

The examples are very fine, but I cannot find an example for an standalone application. All the GEF examples are Eclipse plugin based. I'd like to use GEF in a standalone application. Can anybody help me or give me a hint or a snippet?

That would be very nice

Manu

From Larry - 12/12/04 7:06 AM

To run this projet open the "Plugin.xml" file and in overview click on the link : "Launch a runtime workbench".

In the workbench make:  file->new->project and then choose "Simple Project".

Then make a new file in this project with the extension ".gef". (this is due to the fact that in the plugin.xml->plugin.xml you have the command : extensions="gef")

Open this file to test the bonevich's project !

From rgms - 11/10/04 9:25 AM

Hello, i have downloaded your example (simpleGefExample), but i'm having some problems shooting it! My eclipse version is 3.1M3 and my GEF version is 3.1M3 also... What i do is, open eclipse, then import existing projects and everything seems to be ok, no erros found! But what should i do next to run it? Everytime i try to run it, a new eclipse shell is shown but nothing is done... What steps do i have to do run it properly after import existing projects?

Thanks for your help, hope to hear some information as soon as possible!

Rui

From jbonevic - 9/30/04 9:32 PM

I have updated the simple GEF example I did a while back - now supports connections. Download the simpleGefExample_withConnections plugin here. 

From Jose [80.58.21.172] - 9/28/04 2:48 AM

Hello! I'm trying to run bonevich's simple gef example but I can't. What I am doing is Running it as Runtime Workbench, but it does nothing. What am I doing wrong? Please, I need help as soon as posible

Thank you very much

--Jose

From jbonevic - 6/21/04 5:49 PM

I have just created such a simple example app.  Sets up a model (divided between business model and view adapters that hold representation only) of a DIagram and component Parts.  The editor has a pallette with selection and Part creation tools.  I have dropped a zip file of the source files here.

From gabtn - 6/9/04 7:55 AM

From XavierMehaut - 6/8/04 1:06 PM

Have you seen the examples at [[GefExamples]] ?
regards
Xavier
ps : if the examples are modified by yourself, don't hesitate to put them back to the site

From phil [129.132.209.3] - 6/8/04 3:29 AM

I would be very interested in such an example as well!

From gabtn - 6/7/04 9:00 AM

Where Can I find out a simple example (very simple) about how to associate a button on a palette an the creation of a Rectangle on a Graphical view?

Thanks



Last Modified 2/7/07 8:15 AM

Hide Tools