RPTools.net

Discussion and Support

Skip to content

It is currently Fri Nov 24, 2017 8:06 am 






Reply to topic  [ 12 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Cave Troll
 
Joined: Thu Jan 10, 2008 11:55 am
Posts: 37
 Post subject: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Thu Oct 21, 2010 2:18 pm 
I downloaded the latest version of the Character tool and the text is all weird.

How do I fix this?

Attachment:
File comment: This is a screen capture of the messed up fonts.
Chartool.JPG
Chartool.JPG [ 149.4 KiB | Viewed 2437 times ]



Thanks

Doctor Thantos


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Thu Oct 21, 2010 2:48 pm 
Hmmmmm, how weird. I'm not sure how to fix it right now, it might have something to do with the I/O stuff that Azhrei has been adding. I'll talk to him and see if we can figure it out.


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Jan 10, 2008 11:55 am
Posts: 37
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Thu Oct 21, 2010 4:03 pm 
Maybe I need to install a font?

Perhaps Klingon? :D

Thanks for looking into it.

Doctor Thantos


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Thu Oct 21, 2010 4:24 pm 
FYI, it shows up fine for me, so my assumption is that it is a font issue.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Thu Oct 21, 2010 8:32 pm 
Yeah, looks fine for me as well. But I didn't load the GURPS configuration. Let me try that, too...

I tried to use Game > Select Game... and got a NPE:

Code:
java.lang.NullPointerException
   at com.jeta.forms.components.panel.FormPanel.getFormContainer(Unknown Source)
   at net.rptools.chartool.ui.component.AbstractDialog.setTitle(AbstractDialog.java:210)
   at net.rptools.chartool.ui.component.AbstractDialog.construct(AbstractDialog.java:174)
   at net.rptools.chartool.ui.component.AbstractDialog.<init>(AbstractDialog.java:107)
   at net.rptools.chartool.ui.component.GameSelectionDialog.<init>(GameSelectionDialog.java:204)
   at net.rptools.chartool.ui.component.GameMenuController$1.actionPerformed(GameMenuController.java:111)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
   at javax.swing.AbstractButton.doClick(AbstractButton.java:389)


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Fri Oct 22, 2010 7:41 am 
Azhrei, Did you run it from WebStart? That is usually the cause of that exception.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Fri Oct 22, 2010 11:54 am 
Yes, I did. So I guess you know about this, huh? Hm.

Ah, I see the problem. You're trying to set the Title before the window has been realized. In other words, the setTitle() public method tries to retrieve the current window by calling the JIDE methods and those methods must be accessing the peer component -- which doesn't exist yet. It's probably getFormContainer() that's returning null.

In general, public methods shouldn't be called by constructors because of exactly this problem. The constructor's job is to initialize the object and by definition public methods expect the object to already be initialized. Catch-22.

In general, the constructor should call a private method that initializes the object and the public method should do a sanity check and make the same call. This is particularly important for methods that are not final! Otherwise, the setTitle() method could be overridden by a subclass and when the constructor calls it the subclass' method is actually invoked and that object hasn't been instantiated yet! (I believe Java tracks this and throws an exception, but languages like C++ don't do these runtime checks.)


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Thu Jan 10, 2008 11:55 am
Posts: 37
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Fri Oct 22, 2010 1:49 pm 
I downloaded the file in zip and I run it from the local Launch CharTool.bat and I get the screen above.

I tried reloading the current game and I get the following errors.

java.lang.NullPointerException
at net.rptools.parser.function.impl.Addition.checkParameters(Addition.java:63)
at net.rptools.parser.function.AbstractFunction.evaluate(AbstractFunction.java:48)
at net.rptools.parser.EvaluationTreeParser.evaluate(EvaluationTreeParser.java:115)
at net.rptools.parser.Expression.evaluate(Expression.java:55)
at net.rptools.chartool.model.property.RPScript.execute(RPScript.java:195)
at net.rptools.chartool.model.property.DefaultScriptPropertyValue.execute(DefaultScriptPropertyValue.java:167)
at net.rptools.chartool.model.property.PropertyNode.getValue(PropertyNode.java:779)
at net.rptools.chartool.model.property.PropertyNode.get(PropertyNode.java:658)
at net.rptools.chartool.model.property.PropertyNode.get(PropertyNode.java:601)
at net.rptools.chartool.model.property.PropertyMap.get(PropertyMap.java:321)
at net.rptools.chartool.ui.charsheet.CharSheetController.setFields(CharSheetController.java:434)
at net.rptools.chartool.ui.charsheet.CharSheetController.setData(CharSheetController.java:393)
at net.rptools.chartool.ui.CharacterTab.setCharacter(CharacterTab.java:241)
at net.rptools.chartool.model.CharToolPreferences$2.run(CharToolPreferences.java:348)
at net.rptools.chartool.ui.component.Utilities$ProgressWorker.done(Utilities.java:1203)
at javax.swing.SwingWorker$5.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at sun.swing.AccumulativeRunnable.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.chartool.ui.LoggingEventQueue.dispatchEvent(LoggingEventQueue.java:74)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Sorry but I am not a programmer so I have no clue what the above means...

Thanks.

Doctor Thantos


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Fri Oct 22, 2010 2:12 pm 
Azhrei wrote:
Ah, I see the problem. You're trying to set the Title before the window has been realized. In other words, the setTitle() public method tries to retrieve the current window by calling the JIDE methods and those methods must be accessing the peer component -- which doesn't exist yet. It's probably getFormContainer() that's returning null.

In general, public methods shouldn't be called by constructors because of exactly this problem. The constructor's job is to initialize the object and by definition public methods expect the object to already be initialized. Catch-22.
I understand what you're saying, but I don't think that is the problem. While setTitle() is being called on an object that hasn't been fully initialized, the method that is throwing the exception is called on a fully initialized object.

Besides, the peer component doesn't get created until the setVisible() method is called. If that was the problem it would happen each and every time the code was executed, not just when loading from WebStart on some computers. Judging by the exception all of this code is executing on the AWT Event Thread, so it isn't something like an invokeLater() problem either. That doesn't mean that the Abeille doesn't load stuff in another thread...


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Fri Oct 22, 2010 2:19 pm 
Doctor Thantos wrote:
I downloaded the file in zip and I run it from the local Launch CharTool.bat and I get the screen above.

I tried reloading the current game and I get the following errors.

java.lang.NullPointerException
at net.rptools.parser.function.impl.Addition.checkParameters(Addition.java:63)
at net.rptools.parser.function.AbstractFunction.evaluate(AbstractFunction.java:48)
snip

This is an exception from the RPScript parser. If the strings on the form are getting messed up, it might be messing up the scripts that are contained in the forms.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Fri Oct 22, 2010 3:05 pm 
jay wrote:
This is an exception from the RPScript parser. If the strings on the form are getting messed up, it might be messing up the scripts that are contained in the forms.

Ah. Then this problem could be related to the UTF-8 changes for XML written to a zip file. Are these the "rpgame" files, Jay? I can take a look...

Also, the docs for JETAPanel indicate that instead of calling getFormContainer() it may be better to call getFormAccessor() and retrieve the top-level form element, then tell that component to change the layout.

Tracing the code for getFormContainer() there is a reference to bean.getDelegate(). I'm not familiar with Bean internals but I'm guessing that's a peer component...?


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Chartool 1.0b15 error with Gurps character sheet
PostPosted: Fri Oct 22, 2010 3:30 pm 
Azhrei wrote:
jay wrote:
This is an exception from the RPScript parser. If the strings on the form are getting messed up, it might be messing up the scripts that are contained in the forms.

Ah. Then this problem could be related to the UTF-8 changes for XML written to a zip file. Are these the "rpgame" files, Jay? I can take a look...
That is what I was wondering about. Just can't figure out why it would be broke for just one person. Feel free to take a look.

Azhrei wrote:
Also, the docs for JETAPanel indicate that instead of calling getFormContainer() it may be better to call getFormAccessor() and retrieve the top-level form element, then tell that component to change the layout.
I had seen that as well, but I don't remember why I didn't follow it. This could be old code or I couldn't get it to work with the accessor.

Azhrei wrote:
Tracing the code for getFormContainer() there is a reference to bean.getDelegate(). I'm not familiar with Bean internals but I'm guessing that's a peer component...?

I'll take a look when I get a chance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 12 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman