Author Topic: JAPI 2.0  (Read 36515 times)

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #75 on: June 06, 2013, 05:00:42 PM »
I downloaded the source from the JAPI site.

I posted to this thread the updated .java source files that had deprecation issues.


ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #76 on: June 06, 2013, 05:04:45 PM »
Quote
Were the issues present before you begun fixing the deprecations?

The same theme related issues remained after making the deprecation changes. The upgrade did not introduce any new issues.

Mopz

  • Guest
Re: JAPI 2.0
« Reply #77 on: June 06, 2013, 05:08:12 PM »
I downloaded the source from there yesterday. But as I remember it from the java files, it was all awt based, not swing. But being drunk and all I might have missed a folder or two. I'll have another look.

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #78 on: June 06, 2013, 05:52:44 PM »
There are two Java source directories. The binaries from the site were built using the java files. I built from and updated the swing Java source files.

Observation:

If I use the extended theme settings, I lose the ability to set background colors. (see list.bas) If I put the function that sets background color in a message loop, it works as intended. (like a clear screen with a defined color) This is why I think its something simple missing. Current theming and it's direction wasn't known back in 2003.


ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #79 on: June 06, 2013, 07:20:49 PM »
Marcus,

Since this is a multi-language effort, I think it would be best to build a generic VC10 JAPI 2.0 DLL. (and post the modified .java files so variations can be built) That way others (CM) can help test. You can always use DLLC with ScriptBasic to test the generic DLL rather than the SB extension module version of JAPI 2.0.

John

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #80 on: June 08, 2013, 03:47:40 AM »
Back to the future ...

I went back to the AWT (Java directory) version on my Ubuntu 64 laptop and all the demos are working again. No theming to speak of but that's okay. Here is the Chaos Butterfly under Linux.



Code: [Select]
import japi.bas

j_start
win = j_frame("Lorenz 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()
  j_sleep(50)
wend                         
j_quit
 
« Last Edit: June 08, 2013, 03:52:01 AM by ScriptBasic »

DJLinux

  • Guest
Re: JAPI 2.0
« Reply #81 on: June 08, 2013, 06:29:40 AM »
... I think it would be best to build a generic VC10 JAPI 2.0 DLL ...
Hello John
i won't teach you in any direction
but I'm a old coder and can give you a tip
in scope of C/C++ for Windows and Linux systems.

Normally I use an gcc environment for all my library projects
and this are a lot in the past for FreeBASIC, thinBasic, Basic4GL, PureBasic etc.

Only for my business I must used VisualStudio from time to time.

You can install code::blocks with mingw on windows
now for example OpenB3D create a static and a dynamic lib
add all *.c and *.cpp files to your new fresh project and rebuild the lib.

Now comes the tip install code::blocks on your Linux box also.
Open the windows OpenB3D project (may be mounted as folder or via copy in your home folder)
Select or add Linux as new target in your project and rebuild.

That's all and so easy.

There are many points why an gcc environment on Windows makes sense.

If you will share your VS lib's and dll's you can research your lib with an dependency walker
and you will see your VS libs needs some more VC 8/9/10/11 run time library's  as you would except.

The same lib or dll build with gcc on windows used the RTL libs from OS (not VC).

This is why i never need an run time installer if I share my projects.

If you rebuild really large lib's IUP, ODE, True Axis, IrrLicht etc.
you will see the result of an GCC environment is often much smaller as from VS.

There are one point where VS is the first choice I mean ActiveX/Com project's
but this has nothing to do with cross compiling for Windows and Linux.

bla bla bla  ;)

Happy coding.

DJ
« Last Edit: June 08, 2013, 06:42:20 AM by DJLinux »

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #82 on: June 08, 2013, 07:08:38 AM »
Joshy,

I couldn't agree with you more. I have MinGWTDM32 install as well and how I compile most of the JAPI build utilities. I only use VC10 for the SB extension modules as that is how all the others are built. My end goal with SB is to be gcc across the board.

You have my vote to go the MinGW route.

John

DJLinux

  • Guest
Re: JAPI 2.0
« Reply #83 on: June 08, 2013, 09:35:26 AM »
I only use VC10 for the SB extension modules as that is how all the others are built. My end goal with SB is to be gcc across the board.
I was thinking you build JAPI2.dll with VC and JAPI2.so with GCC.

How ever i won't teach you
it was only a tip no stress with make files any more :lol:

DJ

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #84 on: June 08, 2013, 04:58:04 PM »
I use MinGW gcc to build the makefiles for the Java compile and build the japiserver.h file which is the JAPI.jar in a byte array. I then use VC10 to compile the ScriptBasic JAPI extension module. If I build a generic JAPI.dll, I use gcc through the complete process.


ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #85 on: June 09, 2013, 01:16:13 AM »
JAPI 2.0 News

I was able to get JAPI (AWT version) working with BaCon as a static library interface.

More ...


Mopz

  • Guest
Re: JAPI 2.0
« Reply #86 on: June 09, 2013, 10:01:48 AM »
I've got a fat book here, written in 2001 about AWT and Swing. I'll see if I can figure out why the different LaF:s don't work. But I'm not sure I'll get anywhere with it (time ...). For my own sake, as I wrote earlier, I'm pleased enogugh with the AWT version. I'd rather spend my time on writing an AWT JAPI extension for naalaa ;)

But right now I'm making "sheperd's pie" for my oldest daughter. It's her favourit food, and she turned seven yesterday ;)
« Last Edit: June 09, 2013, 10:04:26 AM by Mopz »

Mopz

  • Guest
Re: JAPI 2.0
« Reply #87 on: June 09, 2013, 10:13:51 AM »
Quote
but I'm a old coder and can give you a tip

I think John's an even older coder :) I feel like an honoured li'l' kid among you guys.

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #88 on: June 09, 2013, 05:58:50 PM »
61 in Nov. I've been around when BASIC was the OS.

ScriptBasic

  • Guest
Re: JAPI 2.0
« Reply #89 on: June 09, 2013, 06:57:50 PM »
Quote
I'm pleased enogugh with the AWT version. I'd rather spend my time on writing an AWT JAPI extension for naalaa

Maybe it would be worth doing the deprecation upgrades to the AWT version also.