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

Aditya Agrawal Aditya at isis.vanderbilt.edu
Thu Jul 8 12:57:40 CDT 2004


Kitty wrote:
> On Wednesday, 7 July 2004, Aditya Agrawal wrote:
> > 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.
> 
> When you say that the most common approach, do you imply that the
> functions
> in BON2/UDM already return children of a Model sorted by their
ordinates,
> or is this something that the interpreter should do, for example,
using
> the
> *_sorted functions in UDM?
>
[Adi] 
I believe there is a way in UDM to also provide a comparator but you
will have to cross check with either Endre or Attila. A post to the
UDM-users would yield a result. In my case I have written my own sort
functions. I can provide you with a simple insertion sort routine if you
need one.
 
> > This allows the user to control the order and not have to worry
about
> the
> > unique numbering.
> 
> OK. But this brings one more question. When I have huge models i.e
about
> 50
> to 60 Models in a single sheet each with atleast 8 ports with heavy
> connections between them, export them and then re-import them, GME
doesn't
> preserve the location information, and it is a big mess. It takes
about an
> hour or so to bring back the original layout by moving it again
manually
> (Will auto-layout help here?). Even then it seems that it wouldn't
take a
> lot of changes to store the co-ordinates in the XML export and use
them
> when re-importing back into GME. I wonder why this is not done. If I
rely
> on the ordinate to control the order, I would assume that just
exporting
> to
> XML and re-importing will break the order. No?

[Adi] 
The XML export/import does keep the x,y information. When the user
chooses an x,y position and GME is unable to draw it, GME moves it to a
different place on the screen. Here the visual placement and the x,y
values differ. When the file is exported the original x,y are stored.
When imported back the order may differ and that can change the way the
objects are seen. 

This is what I have observed but it may not be completely true. Peter
can tell us where I am wrong.

> > 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.
> 
> OK.
> 
> > > 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.
> 
> Judging from Peter's silence, I guess he agrees with you. If I
understand
> what you say correctly, this doesn't involve big architectural changes
to
> GME.
> 
> Akos, is there any way that support for this feature can be added in
the
> near future? Please let me know if I should file an enhancement
request in
> JIRA. There is a lot of interest for such a capability from some of
our
> sponsors.
> 
> Thanks,
> kitty.
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users


More information about the gme-users mailing list