[kepler-dev] Reordering actor attributes and dynamically added parameters

Edward A Lee eal at eecs.berkeley.edu
Sun Jul 25 07:06:52 PDT 2004


I've been looking for a mechanism for doing this also because it
is needed for editing icons... Turns out an icon's visual components
are represented by attributes and are rendered in attribute order.
If you want to move an object to the foreground or background, you
need to be able to affect this order.

I will do this... But again, it will require better synchronizing
the cvs trees for kepler and Ptolemy II...

Edward


At 03:43 PM 7/23/2004 -0700, Efrat Jaeger wrote:
>Hi all,
>
>I have an actor that extends another actor thus its inherited parameters 
>appear first. I was wondering if it was possible to reorder an actors' 
>parameters, e.g. by accessing the attributeList (but at what stage?). I 
>tried to override these parameters in the constructor, but I get a name 
>duplication exception, as the parent class' constructor must be called 
>first. I could write the actor from scratch, but it's not object 
>oriented.. Anybody has any suggestions?
>
>Another thing I was messing with is I created an actor which dynamically 
>adds/removes its output port according to a parameter value. I declare 
>this port within the constructor and set it's type to be a 'string' (as 
>shown below). When I drag this actor from the library its output type is 
>initially set to unknown. I have to change the dependent parameter back 
>and forth to get the correct output type. The same happens after saving 
>and reloading the workflow (thus I get a type mismatch when executing and 
>have to update it first). Please let me know what I should do in this case 
>to get the desired port type as a default.
>
>//constructor
>output = new TypedIOPort(this, "output", false, true);
>output.setTypeEquals(BaseType.STRING);
>output.setContainer(this);
>xPar.setExpression(true);
>
>//attributeChanged
>if (x) {
>     try {
>         output.setContainer(this);
>         output.setTypeEquals(BaseType.STRING);
>        ...
>} else {
>....
>     if (p.getName().equals("output")) {
>         p.setContainer(null);
>     }
>...
>}
>
>Thanks,
>
>Efrat

------------
Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal




More information about the Kepler-dev mailing list