[kepler-dev] Could not get alternate top pack, how do I save something as a KAR

Christopher Brooks cxh at eecs.berkeley.edu
Thu Jan 14 16:07:45 PST 2010


Hi Derik,
Thanks!
The issue is that Edward and I are working on optionally adding Export to PDF
to the File menu.  I hacked in some code as a start on this, the problem is
that the BasicGraphFrame._createFileMenuItems() is probably adding a null menu
item or a null text string.

My workaround was to fix org.kepler.gui.MenuMapper:

storePTIIMenuItems(): If the nextMenuItem is null, or the text of the nextMenuItem is null, then avoid a NPE.

I also modified TableauFrame:

pack(): If there are problems with reading the _alternateTopPackClass attribute,
then throw an exception.  Previously, we just printed some not very helpful text to stdout.

So, if this were to happen again, then Kepler would not start and there would be a nice
stack trace.

We could revert to printing the stack trace instead of throwing an exception, but I found
it very deceptive that Kepler "seemed" to work but had the Ptolemy menus.  So, throwing
an exception seems right to me.

I'll take a look at the root cause in BasicGraphFrame.

Many thanks for looking at this.  I think I was just hoisted by my own petard in
having me be the cause of the bug :-)

_Christopher


On 1/14/10 3:31 PM, Derik Barseghian wrote:
> Hey Christopher,
>
> I think the problem is related to the last change of BasicGraphFrame --
> reverting BGF to 56900 gets rid of the error message on mac (I haven't
> verified that the menus work on linux those).
>
> The message is coming out of TableauFrame line 321. Putting
> e.printStackTrace() in there gives me:
>
> at org.kepler.gui.MenuMapper.storePTIIMenuItems(MenuMapper.java:316)
> at org.kepler.gui.MenuMapper.storePTIITopLevelMenus(MenuMapper.java:493)
> at org.kepler.gui.MenuMapper.getPTIIMenuActionsMap(MenuMapper.java:476)
> at org.kepler.gui.MenuMapper.run(MenuMapper.java:160)
> at ptolemy.gui.Top.deferIfNecessary(Top.java:229)
> at org.kepler.gui.KeplerMenuHandler.pack(KeplerMenuHandler.java:63)
> at ptolemy.actor.gui.TableauFrame.pack(TableauFrame.java:318)
> at ptolemy.actor.gui.Tableau.show(Tableau.java:355)
> at
> ptolemy.actor.gui.Configuration.createPrimaryTableau(Configuration.java:580)
>
> at
> ptolemy.vergil.VergilApplication._createEmptyConfiguration(VergilApplication.java:399)
>
> at
> ptolemy.actor.gui.ConfigurationApplication._parseArgs(ConfigurationApplication.java:1120)
>
> at ptolemy.vergil.VergilApplication._parseArgs(VergilApplication.java:475)
> at
> ptolemy.actor.gui.ConfigurationApplication.<init>(ConfigurationApplication.java:226)
>
> at ptolemy.actor.gui.MoMLApplication.<init>(MoMLApplication.java:81)
> at ptolemy.vergil.VergilApplication.<init>(VergilApplication.java:110)
> at ptolemy.vergil.VergilApplication$1.run(VergilApplication.java:217)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
> at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
>
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
>
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
>
> I'll keep poking around...
> Derik
>
>
> On Jan 14, 2010, at 2:10 PM, Christopher Brooks wrote:
>
>> Hi Derik,
>> Thanks for the quick response and explanation about KeplerData.
>>
>> I get the "Could not get alternate top pack" message under
>> Windows Server 2003 with a clean checkout and build.
>>
>> _Christopher
>>
>>
>> On 1/14/10 1:45 PM, Derik Barseghian wrote:
>>> Hi Christopher,
>>>
>>> I just noticed the "Could not get alternate top pack" message as well.
>>> Linux throws errors when you click on the menu items, but the mac
>>> doesn't, so I'm not sure for how long this been a problem.
>>>
>>> ant clean-all doesn't remove ~/KeplerData. The idea is that KeperData
>>> stores persistant data, and .kepler is now just for temporary files.
>>>
>>> Derik
>>>
>>>
>>> On Jan 14, 2010, at 1:40 PM, Christopher Brooks wrote:
>>>
>>>> I'm trying to work on
>>>> Bug 4194 - Kepler should have the Continous and Modal domains
>>>> and I want to create some KAR files for the Continuous Director
>>>> and the Continuous actors.
>>>>
>>>> For example, the Continuous Director is
>>>> ptolemy.domains.continuous.kernel.ContinuousDirector
>>>> I can instantiate that Director using "Graph -> Instantiate Actor"
>>>> However, I don't have any menus that deal with KARs, such
>>>> as "Save As Kar"
>>>>
>>>> I just did a clean build and I see that I'm getting the following
>>>> log message:
>>>> [run] Could not get the alternate top pack class
>>>> "org.kepler.gui.KeplerMenuHandler" named in the configuration by the
>>>> _alternateTopPackClass attribute: null
>>>> [run] Please check your configuration and try again. Using the default
>>>> Top pack().
>>>>
>>>> Why can't I get the alternate top pack class? What's the exception?
>>>> How do I check my configuration? I have a configuration, I just did
>>>> a clean build.
>>>> A better error message would help here.
>>>>
>>>> Also, is "ant clean-all" removing ~/KeplerData? Perhaps it should?
>>>> ant clean-all removes ~/.kepler
>>>>
>>>>
>>>> _Christopher
>>>>
>>>> --
>>>> Christopher Brooks, PMP University of California
>>>> CHESS Executive Director US Mail: 337 Cory Hall
>>>> Programmer/Analyst CHESS/Ptolemy/Trust Berkeley, CA 94720-1774
>>>> ph: 510.643.9841 fax:510.642.2718 (Office: 545Q Cory)
>>>> home: (F-Tu) 707.665.0131 cell: 707.332.0670
>>>> _______________________________________________
>>>> Kepler-dev mailing list
>>>> Kepler-dev at kepler-project.org
>>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>>
>>
>> --
>> Christopher Brooks, PMP University of California
>> CHESS Executive Director US Mail: 337 Cory Hall
>> Programmer/Analyst CHESS/Ptolemy/Trust Berkeley, CA 94720-1774
>> ph: 510.643.9841 fax:510.642.2718 (Office: 545Q Cory)
>> home: (F-Tu) 707.665.0131 cell: 707.332.0670
>

-- 
Christopher Brooks, PMP                       University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718	      (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670


More information about the Kepler-dev mailing list