Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (108)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2 3
  ignore  |  Print  
  PureSwing  (Read 22971 times)
0 Members and 1 Guest are viewing this topic.
Offline jezek2
« Posted 2009-10-25 07:13:32 »

Hi,

I've just released PureSwing, more information on PureSwing homepage.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #1 - Posted 2009-10-25 08:22:53 »

Hi,

I've just released PureSwing, more information on PureSwing homepage.
That looks great. I won't be surprised if I end up using this.

See my work:
OTC Software
Offline CommanderKeith
« Reply #2 - Posted 2009-10-25 10:33:58 »

Wow, what a great idea. Particularly the threading not happening on the EDT.

I don't know how you manage all of these projects at once, amazing.


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DzzD
« Reply #3 - Posted 2009-10-25 10:43:34 »

Hi,

I've just released PureSwing, more information on PureSwing homepage.

great ! sounds awesome and may be very usefull

what is the minimal java version requiered ?

Offline jezek2
« Reply #4 - Posted 2009-10-25 11:39:22 »

what is the minimal java version requiered ?

I base all my projects on 1.5, if you need to use lower version, tools like Retranslator are a good way to achieve that. Though I think it doesn't use that much 1.5 features like generics... on the other hand it uses the "new" collections: List, Map, etc. that were introduced in Java 1.2 (if you're asking in relation to Java 1.1 support).
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 749
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2009-10-25 11:45:25 »

tools like Retranslator

Retroweaver?

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline jezek2
« Reply #6 - Posted 2009-10-25 12:03:01 »

Retroweaver?

Ah, I meant Retrotranslator, seems more powerful and maintained than Retroweaver, but both are fine Smiley
Offline DzzD
« Reply #7 - Posted 2009-10-25 12:38:50 »

I base all my projects on 1.5, if you need to use lower version, tools like Retranslator are a good way to achieve that. Though I think it doesn't use that much 1.5 features like generics... on the other hand it uses the "new" collections: List, Map, etc. that were introduced in Java 1.2 (if you're asking in relation to Java 1.1 support).

nop, no 1.1 not for this one Wink that was just to know the minimal version supported 1.5 sounds good for me, I always thougth that an external librarie is a better way fo GUI, AWT is pretty strong and fine but platform dependent and swing is just a bug factory.

just loked at the API, damn it is very big ! you wrote it alone ?

Offline jezek2
« Reply #8 - Posted 2009-10-25 13:06:51 »

just loked at the API, damn it is very big ! you wrote it alone ?

Well I used GNU Classpath's reimplementation of Swing classes which I found to be at very good level, kudos to GNU Classpath team Smiley Then with my knowledge of internals I did the biggest refactor ever, I did it in several phases and added and enhanced virtual desktop subsystem from earlier attempts that used ordinary Swing with some hacks to be able to work in OpenGL smoothly. In the meantime I've developed proper Java2D implementation in Modern3D so it can use it for drawing. Also I'm fixing from time to time some unfinished parts of the GNU Classpath reimplementation. So yes, I did plenty of work alone (based on work of several other people) to be short Wink

BTW, I must say that NetBeans has several performance problems, so I rather did some easier refactoring by hand (it was much faster than NB Tongue) or used Eclipse and find/sed for some tasks. I think it's not that big project to justify bringing IDE to it's knees...
Offline jezek2
« Reply #9 - Posted 2009-10-25 13:25:34 »

Wow, what a great idea. Particularly the threading not happening on the EDT.

Yeah, thread handling in Swing is simply weird. Also interesting property of PureSwing is that event handling always pass through your main loop (eg. can be easily integrated to existing game loop), even when modal dialogs are involved. It was achieved by using continuations (thanks to great MatthiasM's continuations library). I think it's ideal solution to modal dialogs problems and other things (like game code). I just wish that continuations are core part of JVM and available at any time without need to have special sections of code to be defined.

I don't know how you manage all of these projects at once, amazing.

Well, these projects (JBullet, Modern3D and PureSwing) are co-products of my main project which is a game on which I work from 2007 and I'm in preparation of fully playable public alpha release very soon. I've actually did JBullet in early 2008, Modern3D in late 2008 and PureSwing in early 2009. I've published it now because these project are by now mature enough to be used in real product (the game), though not everything is yet implemented (mostly what I don't need right now). Also it will ease a bit release of the game in case of PureSwing which is under GPL and I would have to release it anyway along the game.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mikael Grev

Junior Member




Appearance is everything!


« Reply #10 - Posted 2009-10-25 19:53:27 »

Hello there jezek2!

Very interesting!

There's a lot to improve on Swing. It would be my dream project for sure. Then, I don't have much time. Sad

Have you settled on a "standard" layout manager? Or will you reuse Swing's LMs?

Of course I'd love it if you used: http://miglayout.com/  You can read a few comments about it here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6530906
Note that it's currently #3 top most wanted RFE for Java.

If you want another license that can be arranged.

Cheers,
Mikael Grev (creator of MigLayout)

Mikael Grev.
www.migcalendar.com - Advanced Calendar Component
Offline zeyous

Junior Member


Projects: 1



« Reply #11 - Posted 2009-10-25 21:20:08 »

Great job man, I like your approach and I'm curious what we could do using PureSwing and JOGL.
Offline jezek2
« Reply #12 - Posted 2009-10-25 21:22:33 »

Have you settled on a "standard" layout manager? Or will you reuse Swing's LMs?

I'll use any layout manager or custom component that is good Smiley Either by incorporating into core package or as an additional library. This reminds me I've totally forgot to release GroupLayout port which I already have.

Of course I'd love it if you used: http://miglayout.com/  You can read a few comments about it here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6530906
Note that it's currently #3 top most wanted RFE for Java.

MiGLayout is nice Smiley I would happily make it core part of PureSwing.

If you want another license that can be arranged.

Not sure about this, but I think that for sources integrated directly into core package it would be better to have the GPL2+ with Classpath exception, so it would be the same so end-user would have less number of licenses to cover in his license file.
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #13 - Posted 2009-10-25 21:41:45 »

I like this simple, flexible layout manager:
http://n4te.com/temp/TableLayout.java
It was ported from Swing (here) to work with TWL, then improved, so it'll need to be ported back to Swing. Very simple, similar to HTML tables.

Another layout manager I think is very cool:
https://designgridlayout.dev.java.net/

Offline Mikael Grev

Junior Member




Appearance is everything!


« Reply #14 - Posted 2009-10-25 23:49:02 »

Jezek2,

You hereby have the permission to take the MigLayout sources and include them in your project as GPL2+ with classpath exception (or similar). If you need further confirmation contact med on grev at miginfocom dot com.

Cheers,
Mikael

Mikael Grev.
www.migcalendar.com - Advanced Calendar Component
Offline Mikael Grev

Junior Member




Appearance is everything!


« Reply #15 - Posted 2009-10-25 23:53:53 »

Nate,

Have you tried MiGLayout?

Cheers,
Mikael

Mikael Grev.
www.migcalendar.com - Advanced Calendar Component
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #16 - Posted 2009-10-26 01:50:55 »

Have you tried MiGLayout?

I have. MigLayout does a lot, but maybe too much for my tastes. I liked that PnutsLayout was lightweight, with a simple API similar to an HTML table. This made it easy to port to TWL as TableLayout. The simplicity does give up some functionality, but PnutsLayout/TableLayout is flexible enough to handle probably 90% of layouts.

Offline Mikael Grev

Junior Member




Appearance is everything!


« Reply #17 - Posted 2009-10-26 07:13:29 »

Thanks for your feedback Nate

Cheers,
Mikael

Mikael Grev.
www.migcalendar.com - Advanced Calendar Component
Offline trevorscroft

Innocent Bystander





« Reply #18 - Posted 2009-10-26 19:09:37 »

I downloaded the zip and took a look.  It seems that PureSwing depends on jdk 1.6 as several API calls and class references are java 6 specific.  Is this intentional ?  I only ask because above you say that you base the libraries on jdk 5 ...
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #19 - Posted 2009-10-26 21:45:26 »

I am really interested in this, becase there are many swing things that would be nice to have in opengl stuff. is there any chance of you making a simple example of how to intigrate with say... slick.

cause I know that you said it was possible on the slick forums. But  I was wondering how you would go about this....
Offline jezek2
« Reply #20 - Posted 2009-10-27 10:06:27 »

I downloaded the zip and took a look.  It seems that PureSwing depends on jdk 1.6 as several API calls and class references are java 6 specific.  Is this intentional ?  I only ask because above you say that you base the libraries on jdk 5 ...

No, though I forgot to replace usage of RadialGradientPaint with own implementation on JDK older than 6. I'll check with JDK 5 all other usages of newer classes/methods and replace them.
Offline dinosaurus

Junior Newbie





« Reply #21 - Posted 2009-10-28 23:27:38 »

Hi,

I've just released PureSwing, more information on PureSwing homepage.

My congrats Jazek!

I like your concepts regarding EDT, modal dialogs and AWT.

I've looked through the code a bit. I suppose that some other changes could be done like:
 - Use Graphics2D instead of Graphics
 - Action class could support better methods like e.g. setSmallIcon instead of putValue


Regards,
Maxim
Offline jezek2
« Reply #22 - Posted 2009-10-29 01:01:29 »

My congrats Jazek!

I like your concepts regarding EDT, modal dialogs and AWT.

Thanks Smiley

I've looked through the code a bit. I suppose that some other changes could be done like:
 - Use Graphics2D instead of Graphics

Yeah, that's good idea. The worst case is that some backend implementation won't implement some drawing methods, such as shapes. In that case, the user will probably create own LAF or use some which looks OK on his implementaton. Even the ModernLookAndFeel which is image-based (generated at runtime) needs some methods from Graphics2D (composite stuff).

- Action class could support better methods like e.g. setSmallIcon instead of putValue

Good idea, I'm looking forward to change the API to be more friendly like this or use enums instead of int keys where applicable.
Offline dinosaurus

Junior Newbie





« Reply #23 - Posted 2009-10-30 21:42:51 »

Yeah, that's good idea. The worst case is that some backend implementation won't implement some drawing methods, such as shapes. In that case, the user will probably create own LAF or use some which looks OK on his implementaton. Even the ModernLookAndFeel which is image-based (generated at runtime) needs some methods from Graphics2D (composite stuff).

Don't accept compromises. We have already one toolkit with very long history of backward compatibility  Tongue
Offline cowwoc

Senior Newbie




Java games rock!


« Reply #24 - Posted 2009-11-12 02:17:25 »

Looks nice, except for the use continuations. I suspect most of you probably disagree, but I am uncomfortable with the concept. I love the readability advantages of of continuations but the resulting implementation is a no-no in my books. Anyway, just my 2 cents.
Offline jezek2
« Reply #25 - Posted 2009-11-12 09:50:21 »

Looks nice, except for the use continuations. I suspect most of you probably disagree, but I am uncomfortable with the concept. I love the readability advantages of of continuations but the resulting implementation is a no-no in my books. Anyway, just my 2 cents.

Thanks for feedback, can you elaborate more on why the resulting implementation is a no-no for you?

I would like more to not have introduce such non-standard concept to Java library, but it really solves a lot (the multiple threads for EDT is just mess in original AWT/Swing), in an ideal way IMHO. Well almost, you have to use bytecode modification library... if continuations would be part of JVM it would be just ideal and fully transparent.

The other way would be to have modal dialogs non-blocking and you would have to register to some event (which happens under the hood with continations usage). This would make the handlers using modal dialogs very fragmented IMHO.
Offline i30817

Junior Member





« Reply #26 - Posted 2009-11-12 18:41:24 »

I agree that it's a good idea, but you keep the event queue right?

Various operations sometimes have to be sure they will  be invoked only after the current ones, or need to wait and continue. I think modal dialogs replace the event queue for their effect of blocking, so your implementation doesn't right?
Offline i30817

Junior Member





« Reply #27 - Posted 2009-11-13 01:29:25 »

Also i have a suggestion. For goods sake make the default abstract listeners and abstract actions (AbstractAction how i hate thee), not serializable by default.

Expecially AbstractAction.
Offline jezek2
« Reply #28 - Posted 2009-11-13 01:39:25 »

I agree that it's a good idea, but you keep the event queue right?

Various operations sometimes have to be sure they will  be invoked only after the current ones, or need to wait and continue. I think modal dialogs replace the event queue for their effect of blocking, so your implementation doesn't right?

I have explicit showModal() method which when called will simply show the modal dialog and suspend caller's continuation. When the dialog is destroyed/hidden it will resume the continuation. So code contained in the continuation has nice linear structure, where you just show the dialog and then you can process the results. The event queue is the same and the processing of events always go through the main loop (good for single threadeness and especially for game loops).

AWT/Swing creates new EventQueue and pushes it on the stack of EventQueues (the queue on the top is doing the stuff), to stop the execution of code until dialog is destroyed/hidden it just created a new EDT thread and continues dispatching events there. It basically emulates continuations with threads... but that's ugly and ineffecient and you have to care about EDT threads in your application.

There is another solution: just don't have ability to wait for modal dialogs and use pure event mechanism. It's true that other things in Swing are done this way, like doing async stuff. Though SwingWorker nicely wraps it. So the question is more like, should we use more continuation stuff to have nice linear code... or ditch them completely and use purely event based mechanism with fragmented event handlers within the same logical task?
Offline jezek2
« Reply #29 - Posted 2009-11-13 01:42:16 »

Also i have a suggestion. For goods sake make the default abstract listeners and abstract actions (AbstractAction how i hate thee), not serializable by default.

Expecially AbstractAction.

Yeah, serialization ability of most AWT/Swing classes was huge mistake, I'll recheck all the classes that are currently serializable in PureSwing and remove serialization from them when appropriate.
Pages: [1] 2 3
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (16 views)
2014-07-30 21:08:39

Riven (22 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!