swing module status

14 messages Options
Embed this post
Permalink
mbedward

swing module status

Reply Threaded More More options
Print post
Permalink
Hi all,

I've been thinking a little more about the swing module's status.  The
two problems discussed previously were:

1. poor test coverage
2. concern that Swing is poorly implemented on some platforms

There are parts of the module where unit tests can and should be added
(e.g. component models), but for most of the module's contents there's
the hoary question of how to test graphical output. Andrea pointed out
the difficulties of comparing, for example, JMapPane display with a
reference image across different platforms. I recently ran into this
problem myself with unit tests in the jai-tools project where very
basic image comparisons were passing on some platforms and failing on
others.

On a practical level, the graphical bits of the swing module are being
quite thoroughly tested by users. In addition to the posts on the user
list I also get quite a few off-list emails about it.  People complain
very quickly when something as basic as displaying a map on screen or
using a custom file chooser isn't working properly !

In a former lifetime I was a contributor to the wxWidgets C++ GUI
library where not all parts of the library were available on all
platforms (e.g. Windoze vs Motif vs GDK). In a similar vein, I'm
wondering about the idea of treating the swing module as a special
case and putting it into a new module category, perhaps called
'optional' or 'gui'... This would take it out of the unsupported
category (I had the conundrum of explaining to someone in Jody's
FOSS4G tutorial that it is a supported unsupported module) but make it
clear that it is separate to the core modules that we expect to run on
all platforms.  The category could be covered by a maven profile to
easily exclude it (e.g. if, as Christian mentioned, Swing is not
reliable on IBM).

The requirement for adequate unit testing of non-graphical parts of
the module would still apply.

What do people think ?

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Jody Garnett-2

Re: swing module status

Reply Threaded More More options
Print post
Permalink
Hi Michael:

I tried recommending the swing module for graduation with the same  
line of reasoning previously (so I encourage this idea!). Test cases  
perform two things for us; sanity check to catch regressions and  
warning when api changes.

With that in mind I would like to ask that the swing api be held in  
place by working examples. This should have the same effect; user list  
acts as a sanity check to catch regressions; and demo/example breaks  
when api changes.

My own concern for the swing module is that it stay focused and not  
grow randomly as with previous attempts; I hope we can be very clear  
on the mandate this time around. I noticed during our tutorials that  
It is easy to add "Actions" to a JMapFrame menu in order to illustrate  
examples; I have been watching you create some cool examples for  
people on the user list and would like to see if we could smash the  
code into shape to make that easier for you?

Regards,
Jody

On 01/11/2009, at 12:35 PM, Michael Bedward wrote:

> Hi all,
>
> I've been thinking a little more about the swing module's status.  The
> two problems discussed previously were:
>
> 1. poor test coverage
> 2. concern that Swing is poorly implemented on some platforms
>
> There are parts of the module where unit tests can and should be added
> (e.g. component models), but for most of the module's contents there's
> the hoary question of how to test graphical output. Andrea pointed out
> the difficulties of comparing, for example, JMapPane display with a
> reference image across different platforms. I recently ran into this
> problem myself with unit tests in the jai-tools project where very
> basic image comparisons were passing on some platforms and failing on
> others.
>
> On a practical level, the graphical bits of the swing module are being
> quite thoroughly tested by users. In addition to the posts on the user
> list I also get quite a few off-list emails about it.  People complain
> very quickly when something as basic as displaying a map on screen or
> using a custom file chooser isn't working properly !
>
> In a former lifetime I was a contributor to the wxWidgets C++ GUI
> library where not all parts of the library were available on all
> platforms (e.g. Windoze vs Motif vs GDK). In a similar vein, I'm
> wondering about the idea of treating the swing module as a special
> case and putting it into a new module category, perhaps called
> 'optional' or 'gui'... This would take it out of the unsupported
> category (I had the conundrum of explaining to someone in Jody's
> FOSS4G tutorial that it is a supported unsupported module) but make it
> clear that it is separate to the core modules that we expect to run on
> all platforms.  The category could be covered by a maven profile to
> easily exclude it (e.g. if, as Christian mentioned, Swing is not
> reliable on IBM).
>
> The requirement for adequate unit testing of non-graphical parts of
> the module would still apply.
>
> What do people think ?
>
> Michael


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: swing module status

Reply Threaded More More options
Print post
Permalink
Hi Jody,

> With that in mind I would like to ask that the swing api be held in place by
> working examples. This should have the same effect; user list acts as a
> sanity check to catch regressions; and demo/example breaks when api changes.
>

Yep - that sums up what I said much more verbosely :)

> My own concern for the swing module is that it stay focused and not grow
> randomly as with previous attempts; I hope we can be very clear on the
> mandate this time around.

Agreed. I also know that I'm probably the most likely to forget that
when I get enthusiastic about this or that extra feature. I'll have a
got at a wiki page on the "mandate" and ask you and other to review
it.


> I noticed during our tutorials that It is easy to
> add "Actions" to a JMapFrame menu in order to illustrate examples; I have
> been watching you create some cool examples for people on the user list and
> would like to see if we could smash the code into shape to make that easier
> for you?

Absolutely !  I'd really appreciate that.

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Sunburned Surveyor

Re: swing module status

Reply Threaded More More options
Print post
Permalink
I've taken a look at the Swing code in Geotools, and some of it seems
quite useful. I'd like to start using more of it when I can,
especially since OpenJUMP is built with Swing.

I'm reading a book on unit testing in Java that has some really great
information on testing Swing API's. I think I can send a couple pages
to Michael without violating any copyright laws. :]

Landon

On Sun, Nov 8, 2009 at 6:36 PM, Michael Bedward
<[hidden email]> wrote:

> Hi Jody,
>
>> With that in mind I would like to ask that the swing api be held in place by
>> working examples. This should have the same effect; user list acts as a
>> sanity check to catch regressions; and demo/example breaks when api changes.
>>
>
> Yep - that sums up what I said much more verbosely :)
>
>> My own concern for the swing module is that it stay focused and not grow
>> randomly as with previous attempts; I hope we can be very clear on the
>> mandate this time around.
>
> Agreed. I also know that I'm probably the most likely to forget that
> when I get enthusiastic about this or that extra feature. I'll have a
> got at a wiki page on the "mandate" and ask you and other to review
> it.
>
>
>> I noticed during our tutorials that It is easy to
>> add "Actions" to a JMapFrame menu in order to illustrate examples; I have
>> been watching you create some cool examples for people on the user list and
>> would like to see if we could smash the code into shape to make that easier
>> for you?
>
> Absolutely !  I'd really appreciate that.
>
> Michael
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Geotools-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: swing module status

Reply Threaded More More options
Print post
Permalink
Thanks Landon - that would be great.

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Sunburned Surveyor

Re: swing module status

Reply Threaded More More options
Print post
Permalink
I'll try and get you the information tomorrow.

Landon

On Mon, Nov 16, 2009 at 2:53 PM, Michael Bedward
<[hidden email]> wrote:
> Thanks Landon - that would be great.
>
> Michael
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Sunburned Surveyor

Re: swing module status

Reply Threaded More More options
Print post
Permalink
The scans of the book didn't turn out to well. But I did find a lot of
the same information online. I put it on my blog for you:

http://justenufjava.blogspot.com/2009/11/testing-swing-code-with-humbe-dialog.html

Landon

On Mon, Nov 16, 2009 at 3:14 PM, Sunburned Surveyor
<[hidden email]> wrote:

> I'll try and get you the information tomorrow.
>
> Landon
>
> On Mon, Nov 16, 2009 at 2:53 PM, Michael Bedward
> <[hidden email]> wrote:
>> Thanks Landon - that would be great.
>>
>> Michael
>>
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: swing module status

Reply Threaded More More options
Print post
Permalink
Many thanks for that Landon - much appreciated.

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: swing module status

Reply Threaded More More options
Print post
Permalink
Those articles that you linked to were very interesting Landon, and
the articles that they linked to in turn, and... etc.

After an hour of reading I decided I should really buy the book so I
just got it as a pdf.

So, subject to Jody agreeing, plan B (C, D ?) for the swing module is
now to put some time into refactoring the code to make the 'presenter'
portion as thin as possible and improve the unit test coverage. From
what i've read so far, it seems like this will make for a much better
module overall.

Thanks again,

Michael

PS. Is your blog title "Testing Swing Code With The Humbe Dialog Box
Pattern" test-driven humour ?

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Sunburned Surveyor

Fwd: swing module status

Reply Threaded More More options
Print post
Permalink
Michael,

I'm glad you enjoyed the articles. I found the book's discussion of
the traditional MVC architecture and of the ways it can be modified to
support unit testing to be one of the most enlightening things I've
read about programming (and Java programming in particular) for a good
long while.

I think it is awesome you bought the book. I hope you will enjoy it as
much as I am!

It's funny how there is so much to learn about a single programming
language, even after you've worked with it for years. (Of course, I
have no formal programming education, so that may explain all the
things I've needed to learn about Java to become reasonably useful.)

I was a little skeptical about "test driven development", or
development in which you write a failing test first, and then write
the code that passes the test, but the books content on "acceptance
testing" may be the thing that get's me to switch to this form of
coding.

I wasn't trying to be funnny with the blog post title. I guess it just
turned out that way by accident.

Landon

On Tue, Nov 17, 2009 at 4:30 PM, Michael Bedward
<[hidden email]> wrote:

> Those articles that you linked to were very interesting Landon, and
> the articles that they linked to in turn, and... etc.
>
> After an hour of reading I decided I should really buy the book so I
> just got it as a pdf.
>
> So, subject to Jody agreeing, plan B (C, D ?) for the swing module is
> now to put some time into refactoring the code to make the 'presenter'
> portion as thin as possible and improve the unit test coverage. From
> what i've read so far, it seems like this will make for a much better
> module overall.
>
> Thanks again,
>
> Michael
>
> PS. Is your blog title "Testing Swing Code With The Humbe Dialog Box
> Pattern" test-driven humour ?
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Jody Garnett-2

Re: swing module status

Reply Threaded More More options
Print post
Permalink
In reply to this post by mbedward
+1 :-)

Jody
On 17/11/2009, at 10:30 PM, Michael Bedward wrote:

> Those articles that you linked to were very interesting Landon, and
> the articles that they linked to in turn, and... etc.
>
> After an hour of reading I decided I should really buy the book so I
> just got it as a pdf.
>
> So, subject to Jody agreeing, plan B (C, D ?) for the swing module is
> now to put some time into refactoring the code to make the 'presenter'
> portion as thin as possible and improve the unit test coverage. From
> what i've read so far, it seems like this will make for a much better
> module overall.
>
> Thanks again,
>
> Michael
>
> PS. Is your blog title "Testing Swing Code With The Humbe Dialog Box
> Pattern" test-driven humour ?


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: swing module status

Reply Threaded More More options
Print post
Permalink
Excellent !

2009/11/18 Jody Garnett <[hidden email]>:
> +1 :-)
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: swing module status

Reply Threaded More More options
Print post
Permalink
I've begun the refactoring (and personal learning process) for the
swing module in branches/swing_thin_view.

I've started with  one of the simplest bits: JTextReporter (in
org.geotools.swing.dialog) a frame with a text area that displays text
and can save it to file. It's gone from zero test coverage to quite
respectable.  The 'cost' of this has been converting a single class
file into eight files !  But only three of these are specific to the
text reporter, the other five being (I hope) foundations for dialogs
generally.

Landon, that book is super !  Thanks for recommending it.

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Sunburned Surveyor

Re: swing module status

Reply Threaded More More options
Print post
Permalink
No problem Michael. I look forward to applying some of the same design
principles to my pwn Swing dialogs.

Landon

On Thu, Nov 19, 2009 at 9:24 PM, Michael Bedward
<[hidden email]> wrote:

> I've begun the refactoring (and personal learning process) for the
> swing module in branches/swing_thin_view.
>
> I've started with  one of the simplest bits: JTextReporter (in
> org.geotools.swing.dialog) a frame with a text area that displays text
> and can save it to file. It's gone from zero test coverage to quite
> respectable.  The 'cost' of this has been converting a single class
> file into eight files !  But only three of these are specific to the
> text reporter, the other five being (I hope) foundations for dialogs
> generally.
>
> Landon, that book is super !  Thanks for recommending it.
>
> Michael
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel