Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Make owner a template parameter of Fig

Discussion topic

Back to topic list

Make owner a template parameter of Fig


Author bobtarling
Full name Bob Tarling
Date 2008-11-30 05:32:29 PST
Message At the moment the Fig "owner" is an Object to allow any application
using GEF to set the owner with any model element of its own.

The problem is that the application has to cast the return of getOwner()

MyElement element = (MyElement) myFig.getOwner();

Now that we're using generics we have the option to let the
application create their Fig classes with a specific owner type

public class Fig<E> {

    private transient E _owner;

    public Fig(int x, int y, int w, int h, Color lineColor, Color
fillColor, E own);

    public E getOwner();

    public void setOwner(E own);


Its a shame that applications such as ArgoUML won't get any immediate
benefit from this due to the fact that their elements are always
Object. However I hope that's something that may eventually be
resolved in ArgoUML and they can also take advantage of this.

Is this the right way to go?


« Previous message in topic | 1 of 2 | Next message in topic »


Show all messages in topic

Make owner a template parameter of Fig bobtarling Bob Tarling 2008-11-30 05:32:29 PST
     Re: [gef-dev] Make owner a template parameter of Fig penyaskito Christian López Espínola 2008-11-30 05:54:19 PST
Messages per page: