[kepler-dev] kepler preference manager

Edward A. Lee eal at eecs.berkeley.edu
Mon Aug 8 23:37:12 PDT 2005


Apologies... My change didn't actually completely work...
I've checked in a new version of ptolemy.vergil.VergilPreferences
that tolerates no preferences in the configuration...

The reason I put the property in the "actor library" is that I
want a global default set of preferences values, but I also want you
to be able to locally override them in any model.  The way to locally
override them is to drag in an instance of VergilPreferences from the
Utilities library and then edit its values.

The key issue is that the instance you drag in should initially have
exactly the global default values.  Thus, to avoid having to specify
these global defaults in two places (which would be error prone),
I grab the global defaults from the library object that you would
drag in...

This also makes it easy to override the global defaults in Kepler
(or any other derivative of Ptolemy II).  All you have to do is
replace the VergilDefaults object in the "actor library" with
a subclass of VergilDefaults to add Kepler-specific defaults.

I'm sure there is a better design, but it just doesn't come to
me right now...

Edward

At 12:47 PM 8/8/2005 -0700, Chad Berkley wrote:
>Cool.  It looks like your change works.  Is there a reason why you put the 
>property in the 'actor library' entity?  This may cause problems for us 
>later, since we are building the 'actor library' entity dynamically from 
>KSW files.
>
>thanks for looking into this.
>
>chad
>
>Edward A. Lee wrote:
>>I've just checked in a change that should fix the null pointer
>>exception... You should now get a warning that there is no preferences
>>in the configuration.  The VergilPreferences class currently looks
>>for the preferences attribute at the following specific location
>>in the configuration:
>>"actor library.Utilities.LocalPreferences"
>>So, unless Kepler uses a different name for the actor library,
>>putting the following in the Kepler configuration should work:
>>   <entity name="actor library">
>>     <entity name="Utilities">
>>       <property name="LocalPreferences" 
>> class="ptolemy.vergil.VergilPreferences"/>
>>     </entity>
>>   </entity>
>>If Kepler doesn't have "actor library" or "Utilities" in the configuration,
>>then you could instantiate these by providing 
>>class="ptolemy.kernel.CompositeEntity".
>>Let me know if this helps...
>>I'm open to suggestions for better ways to find the default preferences
>>in the configuration...
>>Edward
>>
>>At 11:33 AM 8/8/2005 -0700, Chad Berkley wrote:
>>
>>>Hey Edward,
>>>
>>>Since I know your checking your mail right now, I thought I'd throw a 
>>>question at you.  I'm trying to get your new preferences changes to work 
>>>in kepler.  After updating to your changes, kepler now refuses to load 
>>>giving a NullPointerException at line 221 of VergilPreferences.
>>>I think the reason is that the preferences object is not being 
>>>intialized properly.  I added a <property name="LocalPreferences" 
>>>class="ptolemy.vergil.VergilPreferences"/> line to the kepler 
>>>configuration.xml file but that doesn't seem to fix the problem.  Is 
>>>there another file that I'm missing?
>>>
>>>thanks,
>>>chad
>>>
>>>Edward A. Lee wrote:
>>>
>>>>We have a silly-looking hat labeled "I broke the build" that we
>>>>make people wear at the group lunch if they break the build (I've
>>>>worn it a few times).  Perhaps Kepler needs something like this? :-)
>>>>Edward
>>>>At 10:32 AM 8/8/2005 -0700, Chad Berkley wrote:
>>>>
>>>>>Hi Everyone,
>>>>>
>>>>>This is just a friendly reminder.  If you are checking code into kepler,
>>>>>PLEASE, make sure it compiles.  Checking code into the repository that
>>>>>does not compile is extremely inconvenient to other developers on the
>>>>>project.  It been wasting a lot of time lately.  Before you check code
>>>>>in, please run an 'ant clean run-dev'.  If you have added new files it's
>>>>>also good to test your checkin in a 2nd module to make sure you didn't
>>>>>forget any required classes.
>>>>>
>>>>>thanks,
>>>>>chad
>>>>>_______________________________________________
>>>>>Kepler-dev mailing list
>>>>>Kepler-dev at ecoinformatics.org
>>>>>http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>>>>
>>>>
>>>>------------
>>>>Edward A. Lee
>>>>Professor, Chair of the EE Division, Associate Chair of EECS
>>>>231 Cory Hall, UC Berkeley, Berkeley, CA 94720
>>>>phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
>>>>eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
>>
>>------------
>>Edward A. Lee
>>Professor, Chair of the EE Division, Associate Chair of EECS
>>231 Cory Hall, UC Berkeley, Berkeley, CA 94720
>>phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
>>eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal

------------
Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal  



More information about the Kepler-dev mailing list