Yes, I am re-reading Douglas Adams' works...

I am back!

Well, I suppose nobody remembers me, as I haven't done anything remarkable for Pivot and my presence on this list hasn't be very long.

Time of a hacker is alas limited, particularly with a work and a family...
I deepened my knowledge of JavaFX (in vain... but well, I learned some things about animation and such, and had fun); also had some activity on Processing forum; I learned to use Gradle, to compile the small Scala programs I am making as I learn also the language.

All this is deeply uninteresting, I guess. Except, that I wanted to make some GUIs with Scala, and the announcement of the version 2.0 (congratulations!) reminded me of Pivot (well, I never really forgot it, just put it aside). So as a warm up, I started to rewrite the tutorial code in Scala (I think I saw this suggested some time ago in the list).

Progress is a bit slow, but some initial success show I am on the right way. The curious can take a look at my repository, work in progress:

http://bazaar.launchpad.net/~philho/+junk/Scala/files/head:/PivotTutorials/

Note: I have put neither the Apache license nor mine (a simple zlib/libpng one) as header of the files, not sure what is appropriate. I made my own package, to make clear this is not done by Apache.
If you have any remark on this, I have no problem to change that.

So, with Gradle, I can easily compile the Scala code and run it. At least run the HelloJava code (renamed HelloScala, of course) and the HelloBXML.
I can compile the code I made in the Text folder, but I failed to run it.
Basically, I run the org.apache.pivot.wtk.ScriptApplication class with the parameter -src=path/to/text/text_inputs.bxml with the classpath set to the runtime classpath (the same used to run the pure class files) and the resource files (BXML and others) copied at the same place.

But the ScriptApplication fails to find the BXML file.
Note: I am on Windows, tried on XP and on 7.
The issue probably comes from the fact the class uses a classloader to find the resource, I am not too sure how it handles Windows paths. Of course, I changed the backslashes to slashes. I also tried to prepend a slash to the absolute path of the file (I am intrigued by the substring(1) in the getResource() call), I tried various relative paths, no success.

With an absolute path, I get an error like:

java.lang.IllegalArgumentException: Cannot find source file "H:/PhiLhoSoft/Scala/PivotTutorials/bin/classes/main/org/philhosoft/pivot/tutorials/text/text_inputs.bxml". at org.apache.pivot.wtk.ScriptApplication.startup(ScriptApplication.java:47) at org.apache.pivot.wtk.DesktopApplicationContext$2.run(DesktopApplicationContext.java:594) at org.apache.pivot.wtk.ApplicationContext$QueuedCallback.run(ApplicationContext.java:1474) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

and a Pivot window opens, showing the same message in a dialog box.

So, basically, my question is: what path to use as argument here, on Windows? (I found that a Linux user used an absolute path, so it seems mostly OK, no?)


Oh, on an unrelated note: in the past, I had no problems to run Pivot demos (on XP), it loaded fast and was displayed nicely. I wanted to follow the tutorial online, and the Sample Application demo shown the Java wait logo for quite some time (several minutes, I would say), then a black area where the applet should be. Nothing in the Java Console, and actually it closed as if the applet crashed.

On next pages, I had the same black area. Then on the Text Areas page, I got a correct applet! (Windows XP Pro SP3, Java 1.6.0_23, Firefox 3.6) At home, on my Win7 box, I tried again, and got the same problem. I refreshed the page a couple of times and got the Sample Application/Kitchen Sink running.

Mmm, tried again while writing this mail. First got a black applet, then the app. Again, got a black applet only. Again, works fine! Trying Color Scheme Builder, it works OK after accepting the security warning (mmm, I can't type values in the spinners? Annoying, it is slow to go to a value).

I haven't find something about this issue in the recent (January) archive, so I thought I should mention it.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

Reply via email to