classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: javax/swing/JScrollPane.java


From: Mark Wielaard
Subject: Re: [cp-patches] FYI: javax/swing/JScrollPane.java
Date: Wed, 22 Jun 2005 15:36:22 +0200

Hi,

On Mon, 2005-06-20 at 17:20 +0200, Roman Kennke wrote:
> Lillian Angel wrote:
> 
> >JScrollPane was not initializing the view when the view is null. 
> >
> >2005-06-20  Lillian Angel  <address@hidden>
> >
> >       * javax/swing/JScrollPane.java
> >        (JScrollPane): Viewport was not being set when
> >        the view was null. Whenever a view would be added to container
> >        it would not appear. This was changed to use setViewportView.
>
> BTW: This effectivly reverts Marks patch from 2005-06-14:
> http://lists.gnu.org/archive/html/classpath-patches/2005-06/msg00162.html
> 
> Mark, if you have a specific problem here, we should discuss this. 
> AFAICS the method setViewportView should do the same as what you meant 
> to do here. So why not rely on this method?

Because it fires state changed events which trigger getViewSize() and
getPreferredSize() and ODB didn't expect that to happen during the
creation of its TTYPanel. It makes sense not to fire state changed
events during the constructor since those are probably triggered while
the (sub)class isn't completely initialized yet and so might not be
setup completely.

In particular with ODB (http://www.lambdacs.com/debugger/debugger.html)
we now get:
Exception during event dispatch:
java.lang.NullPointerException
   at com.lambda.Debugger.TTYPane.getSize (TTYPane.java:83)
   at javax.swing.plaf.basic.BasicListUI.getPreferredSize (BasicListUI.java:710)
   at javax.swing.JComponent.getPreferredSize (JComponent.java:1027)
   at javax.swing.JViewport.getViewSize (JViewport.java:239)
   at javax.swing.JScrollPane$1.stateChanged (JScrollPane.java:511)
   at javax.swing.JViewport.fireStateChanged (JViewport.java:422)
   at javax.swing.JViewport.setView (JViewport.java:347)
   at javax.swing.JScrollPane.setViewportView (JScrollPane.java:484)
   at javax.swing.JScrollPane.<init> (JScrollPane.java:591)
   at javax.swing.JScrollPane.<init> (JScrollPane.java:574)
   at com.lambda.Debugger.Debugger.createJL (Debugger.java:554)
   at com.lambda.Debugger.Debugger.createJL (Debugger.java:538)
   at com.lambda.Debugger.Debugger.createTTYPanel (Debugger.java:910)
   at com.lambda.Debugger.Debugger.initialize (Debugger.java:287)

With my patch reapplied that issue goes away. And IDB starts up again.
But according to bug #13439 "swing: regression with omniscient debugger"
https://savannah.gnu.org/bugs/?func=detailitem&item_id=13439
this isn't a full solution since IF YOU PATCH THE APPLICATION you can
get it to show more stuff without my patch applied. I am not clear on
why that is though. And I think we should not need application patching.

I would like to get ODB working more since it is a nice test application
using swing but not Graphics2D (which nobody seems to know how to enable
anymore since it is unclear which combination of gtk+/cairo is needed at
compile or runtime with --enable-gtk-cairo).

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]