[gme-users] Controlling the order in which children are returned, decorators

Aditya Agrawal Aditya at isis.vanderbilt.edu
Wed Jul 7 14:05:00 CDT 2004


Kitty wrote:
> I would like to know if there is a way in GME to control the order in
> which
> children of a Model are returned. Specifically, I have a Model which
> represents a IDL interface's method. I would like to preserve the
order in
> which the children of this model, i.e., the parameters of the method,
are
> stored and retrieved. I need this so that the parameters in the
generated
> IDL always appear in the same order. Is this possible?
> 
> Assume that the above is not possible, and I add an attribute to every
> child that governs the order of the children. Is there a way that I
can
> automatically assign a value to this attribute everytime a child is
> created
> in the model? I would like to keep track of the count and
> increment/decrement the count on child creation/deletion. Is this
achieved
> with a decorator?
 
[Adi] 
Usually the visual information is used to give a deterministic order to
the object. The most common approach is to sort the children based on
the y co-ordinate. This allows the user to control the order and not
have to worry about the unique numbering. 

If you still want to add an attribute and provide automatic numbering
you will have to do so with the help of an add-on that will be triggered
on the object created/deleted event and then manage the numbers.

> One more decorator related question. I would like to add support for
> hierarchical views in my models. By hierarchical, I mean that I want a
> Model's view to show the contents of the Model i.e, it's children and
the
> connections between these children. Note that I don't want the
children to
> appear as ports. I want the same view that GME will display when I
> double-click the Model's icon and open it, shown as a snapshot when
viewed
> one level up in the hierarchy i.e, a miniature snapshot of the
contents.
> Is
> there some guide/manual that will help me acheive this? This is a very
> critical feature that seems to be missing from our tool and there is a
> *lot* of interest in providing this capability.
> 
> Essentially we have a Component Assembly (a Model) which shows the
> components in the assembly and the connections between them. But
currently
> there is no support for composition, i.e, one cannot create an
assembly of
> Component assemblies. But experience with using the tool to make
models
> which have many instances of the same grouping of components i.e, an
> assembly, shows that the current view where one has to scroll the
sheet to
> view the bigger assembly is not very intuitive. Hence my queries.
> 
> Any suggestions/pointers/ideas are very welcome.

[Adi] 
I spoke to Peter about this a long time ago and it seems that this
project would require a lot of effort and would probably have to be a
part of GME. This is because the decorator should be able to call GME's
internal draw method, scale it and the return the image. 

Thanks,
Adi


More information about the gme-users mailing list