Author Topic: JAPI 2.0  (Read 32584 times)

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #60 on: May 29, 2013, 07:51:35 PM »
No problem. I'm preoccupied with the new JIT compiling feature Charles added to DLLC at the moment. I'll be happy to jump back on board once the Java (JAPI.jar) is sound. I see adding the TAB/Notebook control as a must have to make this really useful as a GUI alternative.


ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #61 on: May 30, 2013, 08:13:49 AM »
Update

My non-LaF setting returned to normal and I was able to test the upgraded DLL. Everything seems to work fine. Getting theme support to work has to be the next thing we need to get going. IMHO


ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #62 on: May 31, 2013, 03:01:59 AM »
I made 272 deprecation upgrades to the original JAPI 1.06 code. There is still 58 warnings remaining. The library only partially works if theming (LaF) is enabled. My brief testing of the upgraded JAPI 2.0 DLL seemed to work and not introducing any additional problems.

That's where things are and handing the wheel over to Marcus.

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #63 on: June 04, 2013, 05:58:40 PM »
Just sitting here in the back of the bus and the scenery doesn't seem to be changing. Are we broke down? Is there anyone else beside overwhelmed Marcus out there with a Java background that can help move this along?


Mopz

  • Guest
Re: JAPI 2.0
« Reply #64 on: June 05, 2013, 07:28:57 PM »
Just sitting here in the back of the bus and the scenery doesn't seem to be changing. Are we broke down? Is there anyone else beside overwhelmed Marcus out there with a Java background that can help move this along?

Just sitting here in the sofa, after a day of writing marmalade extensions for Samsung's Plasma and Adhub android SDK:s. The point being, that I've got a fulltime job as lead programmer at a game company, three kids, a fiancee with a great career ... I have less than little sparetime  :) Most evenings I give into beer rather than programming. I'm sure I could solve these issues in half an hour, but half hours are so rare ...

Edit: And the other night I was watching Eyes Wide Shut and thought: "Hm ... that'd be nice ..." Yes, I'm drunk and feeling sorry for myself.
« Last Edit: June 05, 2013, 07:42:44 PM by Mopz »

Mopz

  • Guest
Re: JAPI 2.0
« Reply #65 on: June 05, 2013, 07:39:48 PM »
But my Java background IS weak. I know the language and could solve the issues by using the docs from Oracle and anything found on the internet. But if someone here's got some REAL java knowledge, please give this a shot :)

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #66 on: June 05, 2013, 09:51:34 PM »
JAPI isn't my main focus either. I like the library and have this gut feeling it would only take you an hour or less to solve the few issues that persist.


ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #67 on: June 06, 2013, 04:10:43 AM »
I thought I would mention that if I use the following LaF (lookAndFeel) setting for Windows, all the test programs work. Any other LaF setting breaks things. With that tidbit, what do you think is causing the breakdown with more enhanced themes? (using latest deprecation updated DLL)

swing.properties
Code: [Select]
swing.defaultlaf=com.sun.java.swing.plaf.basic
« Last Edit: June 06, 2013, 05:06:26 AM by ScriptBasic »

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #68 on: June 06, 2013, 05:46:58 AM »
As incentive, here is a ScriptBasic/JAPI example of the Chaos Theory. (butterfly effect)



Code: [Select]
import japi.bas

j_start
win = j_frame("Peter's Butterfly")
can = j_canvas(win, 640, 480)
j_pack(win)
j_show(win)

x =  0.0
y = 20.0
z = 20.0

j_setnamedcolorbg(can, J_BLACK)

while obj <> win
  xx = x + 0.01 * ( -10.0 * x + 10.0 * y)
  yy = y + 0.01 * (  28.0 * x - y - x * z )
  zz = z + 0.01 * ( -8.0  * z / 3.0  + x * y )
  j_setcolor(can, Rnd(), Rnd(), Rnd())
  j_drawline(can, x*10+320, -z*10+500, xx*10+320, -zz*10+500)
  x = xX
  y = yY
  z = zZ
  obj = j_getaction()
wend                         
j_quit
« Last Edit: June 06, 2013, 05:51:21 AM by ScriptBasic »

Mopz

  • Guest
Re: JAPI 2.0
« Reply #69 on: June 06, 2013, 07:52:03 AM »
Can you zip and post (or e-mail to marcus@naalaa.com) everything you've got (including the script basic examples)? It's also possible to change the L&F programmatically, but unless that is actually done somewhere in the swing version of JAPI (which could cause errors and conflicts) I have no idea why changing the props file shouldn't work. But I think I need to see it in action :)

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #70 on: June 06, 2013, 08:16:48 AM »
Everything you should need to run the JAPI examples is included in the zip. Just point your system path to include the ScriptBasic bin directory.

Example:

scriba graphic.bas

Mopz

  • Guest
Re: JAPI 2.0
« Reply #71 on: June 06, 2013, 09:16:48 AM »
Thanks!

Mopz

  • Guest
Re: JAPI 2.0
« Reply #72 on: June 06, 2013, 12:02:15 PM »
I thought I would mention that if I use the following LaF (lookAndFeel) setting for Windows, all the test programs work. Any other LaF setting breaks things. With that tidbit, what do you think is causing the breakdown with more enhanced themes? (using latest deprecation updated DLL)

swing.properties
Code: [Select]
swing.defaultlaf=com.sun.java.swing.plaf.basic

If I try that one, nothing at all shows here (the scriba process runs, but no window pops up). I've tried with
  • com.sun.java.swing.plaf.motif.MotifLookAndFeel
  • com.sun.java.swing.plaf.windows.WindowsLookAndFeel
, and not specifying any laf at all (resulting in the metal look, I think). The examples behave the exact same way with these three settings. That is, many of them don't run at all, some (like the colorpicker) get hung when you try the actions, some of them show empty windows with some content flickering if I resize the windows. And some of them work as I assume they should.

Doesn't the java console work with java apps? I can have it popup every time I run an applet to see what's going on under the hood, but I can't get it running with this.

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #73 on: June 06, 2013, 04:41:53 PM »
swing.properties
Code: [Select]
swing.defaultlaf=com.sun.java.swing.plaf.basic
This is the only LaF that allows all the examples to work. This swing.properties file must be in the lib directory of the JRE you are using. You must reboot or at least log out to have the new LaF take effect. I normally start with button.bas to indicate what theme is being used. I then try graphic.bas. With the above LaF all the primitive types display. Any other LaF only the line (upper left corner) shows. (vumeter & digits examples just hang with extended themes)

I assume scriba (ScriptBasic) and the JAPI extension module at least seem to be working.


Mopz

  • Guest
Re: JAPI 2.0
« Reply #74 on: June 06, 2013, 04:55:30 PM »
ScriptBasic has always been working here :) I already realized I had to reboot between changes. Where can I find the latest japi java and c source. I haven't been paying enough attention. Were the issues present before you begun fixing the deprecations?