Author Topic: AWT/Swing/SWT Console for Java  (Read 13323 times)

ido

  • Rogueliker
  • ***
  • Posts: 618
  • Karma: +0/-0
    • View Profile
    • Tame Tick
AWT/Swing/SWT Console for Java
« on: July 12, 2008, 03:57:56 PM »
Hi,
    I know a lot of you program in java and have some sort of GUI console implementation (I'm looking for something similar to Legerdemain's solution - unfortunatly it seems it is not open source so I can't just use his implementation).  Any tips/links?
« Last Edit: July 12, 2008, 04:10:39 PM by ido »

ido

  • Rogueliker
  • ***
  • Posts: 618
  • Karma: +0/-0
    • View Profile
    • Tame Tick
Re: AWT/Swing/SWT Console for Java
« Reply #1 on: July 12, 2008, 04:13:46 PM »
Nevermind, I just found this:

http://roguebasin.roguelikedevelopment.org/index.php?title=Java_Curses_Implementation

Which seems like what I needed.

njerpe

  • Newcomer
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: AWT/Swing/SWT Console for Java
« Reply #2 on: July 14, 2008, 12:45:35 PM »
Sure thing Ido, I can send you some code snippets.

FWIW I'm not using Java curses, its actually a pure Swing approach using the graphics device context and the paint loop.

Each of the two approaches has its own advantages and disadvantages.

I really only scratched the surface of the Swing approach. You could do a lot more with it than I did: zooming, color gradients, alpha blending, different size text in different windows, etc...

Legerdemain - A Tale Fraught with Peril and Wonder

http://roguelikefiction.com

ido

  • Rogueliker
  • ***
  • Posts: 618
  • Karma: +0/-0
    • View Profile
    • Tame Tick
Re: AWT/Swing/SWT Console for Java
« Reply #3 on: July 17, 2008, 07:27:18 PM »
Actually what I liked about your implementation is that it looked like a real curses program :)

I'm swamped with work but I will take a look at the code you sent me, thanks a bunch.  Slash also sent me his code and I will also take a look at that once I get some free time.

Thank both of you for the swift reply.
« Last Edit: July 17, 2008, 07:31:28 PM by ido »

Slash

  • Creator of Roguetemple
  • Administrator
  • Rogueliker
  • *****
  • Posts: 1197
  • Karma: +4/-1
    • View Profile
    • Slashie.net
    • Email
Re: AWT/Swing/SWT Console for Java
« Reply #4 on: July 17, 2008, 10:25:00 PM »
Actually, I just checked and all I sent you was an executable package, sorry about that! I will correct it once I get home

Also, the sourceforge project is approved already, I will commit the source there, then announce

I know we can enhance it a lot, perhaps with help from the Phenomedomaniac :P

Kannon

  • Newcomer
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: AWT/Swing/SWT Console for Java
« Reply #5 on: November 11, 2008, 08:13:25 AM »
I'd like to see the example for the swing console. It'd give me a good starting point. I'll also likely end up porting it to Android, and if you want, I'd be happy to post it.

Slash

  • Creator of Roguetemple
  • Administrator
  • Rogueliker
  • *****
  • Posts: 1197
  • Karma: +4/-1
    • View Profile
    • Slashie.net
    • Email
Re: AWT/Swing/SWT Console for Java
« Reply #6 on: November 11, 2008, 04:24:00 PM »
Hi!

We have just released libjcsi 0.0.2, the new version contains some bugfixes and features.

You can find it at http://code.google.com/p/libjcsi/ . I have included some examples and you can browse the source code.

You are also welcome to join the project for the Android port.

ido

  • Rogueliker
  • ***
  • Posts: 618
  • Karma: +0/-0
    • View Profile
    • Tame Tick
Re: AWT/Swing/SWT Console for Java
« Reply #7 on: November 11, 2008, 09:09:31 PM »
Still no love for people who use anything but windows? 

How do I run this?  How do I compile this?  There is no ant file or anything else to replace it as far as I can see. 

I tried to decipher how you meant this to be run from the bat file but to no avail:

~/tmp/libjcsi$ java -cp libjcsi.jar:lib\jcurses-x.jar net.slashie.libjcsi.examples.luck.toybox.CustomColorImageTestJC
Exception in thread "main" java.lang.NoClassDefFoundError: jcurses/system/InputChar
   at net.slashie.libjcsi.jcurses.JCursesConsoleInterface.<clinit>(JCursesConsoleInterface.java:251)
   at net.slashie.libjcsi.examples.luck.toybox.CustomColorImageTestJC.<init>(CustomColorImageTestJC.java:21)
   at net.slashie.libjcsi.examples.luck.toybox.CustomColorImageTestJC.main(CustomColorImageTestJC.java:71)
Caused by: java.lang.ClassNotFoundException: jcurses.system.InputChar
   at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
   ... 3 more


I appreciate the effort you are putting into this, but *please* try to make this less windows centric, you are using java it is not difficult.
« Last Edit: November 11, 2008, 09:12:02 PM by ido »

Slash

  • Creator of Roguetemple
  • Administrator
  • Rogueliker
  • *****
  • Posts: 1197
  • Karma: +4/-1
    • View Profile
    • Slashie.net
    • Email
Re: AWT/Swing/SWT Console for Java
« Reply #8 on: November 11, 2008, 09:32:39 PM »
Having some issues trying to connect to my test linux server, in the mean time, try deleting jcurses.dll (that's a bug on JCurses mind you, I will have to correct it :))

Will have in mind your advise for a more neutral approach to releases (source building linux lovers :P)

ido

  • Rogueliker
  • ***
  • Posts: 618
  • Karma: +0/-0
    • View Profile
    • Tame Tick
Re: AWT/Swing/SWT Console for Java
« Reply #9 on: November 11, 2008, 09:38:00 PM »
Thanks.  The SCBExample seems to be working fine, the CustomColorImageTestJC
still doesn't work after deleting libjcurses.dll.

Looking forward for the next release.
« Last Edit: November 11, 2008, 09:43:49 PM by ido »