[piccolo2d-dev] Re: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Updates: Status: Fixed Comment #14 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 This issue was closed by revision r978. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] [piccolo2d] r978 committed - Fixes issue 163....
Revision: 978 Author: cmal...@pixelzoom.com Date: Mon Mar 8 10:35:45 2010 Log: Fixes issue 163. - Removed the HiercharyBoundsListener that was added in r973, it was not totally effective, and it's not clear why it was partially effective. - Added component.revalidate to updateBounds, so that bounds are computed based on correct component size. - Removed redundant call to component.revalidate in constructor, since the constructor calls updateBounds. http://code.google.com/p/piccolo2d/source/detail?r=978 Modified: /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java === --- /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Fri Feb 26 13:32:02 2010 +++ /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Mon Mar 8 10:35:45 2010 @@ -42,8 +42,6 @@ import java.awt.event.ContainerAdapter; import java.awt.event.ContainerEvent; import java.awt.event.ContainerListener; -import java.awt.event.HierarchyBoundsAdapter; -import java.awt.event.HierarchyEvent; import java.awt.geom.Rectangle2D; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -319,19 +317,13 @@ component.putClientProperty(PSWING_PROPERTY, this); initializeComponent(component); -component.revalidate(); +//TODO: this listener is suspicious, it's not listening for any specific property component.addPropertyChangeListener(new PropertyChangeListener() { /** {...@inheritdoc} */ public void propertyChange(final PropertyChangeEvent evt) { updateBounds(); } }); -component.addHierarchyBoundsListener(new HierarchyBoundsAdapter() { -/** {...@inheritdoc} */ -public void ancestorResized(HierarchyEvent arg0) { -updateBounds(); -} -}); updateBounds(); listenForCanvas(this); @@ -356,6 +348,7 @@ // TODO: should we make sure this is called at least once // TODO: does this sometimes need to be called when size already equals // preferred size, to relayout/update things? +component.revalidate(); if (componentNeedsResizing()) { component.setBounds(0, 0, component.getPreferredSize().width, component.getPreferredSize().height); } -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Comment #16 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 I applied the component.revalidate fix in r978. One thing that I didn't note in the commit message: I opted NOT to remove the PropertyChangeListener that's added in the PSwing constructor. Unlike the HierarchyBoundsListener (which I did remove), this PropertyChangeListener has been there for a long time. So rather than introduce some new problem, I thought it prudent to leave it alone for now. I did add a TODO comment indicating that this listener looks suspicious, because it's calling updateBounds regardless of which property changes. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Updates: Status: New Comment #17 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Rats. This is still broken. I've been developing and testing on a very fast MacBook Pro. One of my colleagues ran TestPSwingDynamicComponent on a slower Windows machine, and when that app starts up, none of the Swing stuff outside the PSwingCanvas is drawn. See attached screenshot, no-draw.png. When he mouses over areas of the frame outside the canvas, JComponents are drawn. Looking into PSwingCanvas, I see that the Swing repaint manager is replaced by PSwingRepaintManager. The javadoc for PSwingRepaintManager.addInvalidComponent indicates that it's called by component.revalidate, and it in turn calls PSwing.updateBounds. So what I've done by calling component.revalidate in updateBounds is to introduce an infinite loop: component.revalidate - PSwingRepaintManager.addInvalidComponent - PSwing.updateBounds - component.revalidate - ... Putting a System.out.prinln at the first line of PSwing.updateBounds confirms this. On my speedy Mac, everything still manages to get redraw. But on a slow machine, the event dispatch queue is hammered, and some things don't draw. Back to the drawing board. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] [piccolo2d] r979 committed - Issue 163: Removed infinite loop introduced in r978 by calling compon...
Revision: 979 Author: cmal...@pixelzoom.com Date: Mon Mar 8 16:28:26 2010 Log: Issue 163: Removed infinite loop introduced in r978 by calling component.revalidate in PSwing.updateBounds. With the removal of HeirarchyBoundsListener in r978, this should put PSwing back to r965, the state it was in before we started working on this issue. http://code.google.com/p/piccolo2d/source/detail?r=979 Modified: /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java === --- /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Mon Mar 8 10:35:45 2010 +++ /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Mon Mar 8 16:28:26 2010 @@ -348,7 +348,6 @@ // TODO: should we make sure this is called at least once // TODO: does this sometimes need to be called when size already equals // preferred size, to relayout/update things? -component.revalidate(); if (componentNeedsResizing()) { component.setBounds(0, 0, component.getPreferredSize().width, component.getPreferredSize().height); } -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Comment #19 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Commited PSwing r979. This backs out the component.repaint added in r978, since it was causing an infinite loop. PSwing should now be back to the state it was in before we started working on this issue (r965). -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] [piccolo2d] r980 committed - Issue 163: restore component.revalidate call in constructor to get us ...
Revision: 980 Author: cmal...@pixelzoom.com Date: Mon Mar 8 16:36:20 2010 Log: Issue 163: restore component.revalidate call in constructor to get us back to state of PSwing r965 http://code.google.com/p/piccolo2d/source/detail?r=980 Modified: /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java === --- /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Mon Mar 8 16:28:26 2010 +++ /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Mon Mar 8 16:36:20 2010 @@ -317,6 +317,7 @@ component.putClientProperty(PSWING_PROPERTY, this); initializeComponent(component); +component.revalidate(); //TODO: this listener is suspicious, it's not listening for any specific property component.addPropertyChangeListener(new PropertyChangeListener() { /** {...@inheritdoc} */ -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Comment #20 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Commited PSwing r979. This backs out the component.revalidate added in r978, since it was causing an infinite loop. PSwing should now be back to the state it was in before we started working on this issue (r965). -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Comment #22 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 It's interesting that this bounds problem does not occur with PhET's Piccolo 1.2 snapshot (r390). I recall that we reported some breaking changes to PSwing, so I looked back through the commit comments and found this for r863: Applying PSwing file provided by sreid. Javadocs have been re-added. And some Refactoring has taken place. The only file changed in r863 was PSwing. But other source in the pswing package (PSwingRepaintManager, PSwingCanvas,...) also differs from our 1.2 snapshot. So I suspect that something was changed outside of PSwing that doesn't place nice with the PSwing file provided by sreid. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
[piccolo2d-dev] Re: Release Piccolo2D.Java 1.3
--- [ ] +1 I support this release [ ] +0 [X] -0 [ ] -1 I oppose this release because... I'm going to abstain from this vote. This release is generally solid, with the exception of the pswing package. Since issue 163 has been reopened, and since I've investigated further, I think that pswing has some new problems that weren't in 1.2 (issue 163 being an example). I can't +1 the release, since my client (PhET) relies heavily on pswing. But I can't -1 the release because I think that fixing pswing and bringing it up to the same standards as the reset of Piccolo2D is going to take considerable time, and I hate to see 1.3 delayed any longer. If anyone else feels strongly about pswing, then my lack of confidence in its current state may influence your vote. Otherwise, I think PhET should take the lead in fixing improving whatever version of pswing ships with 1.3. PhET uses it heavily, in some complex situations, and contributed it in (more or less) its current state. On Mar 2, 8:57 pm, Michael Heuer heue...@gmail.com wrote: This is a vote for releasing Piccolo2D.Java 1.3 based on release candidate 4 (version 1.3-rc4). Since release candidate 3 new issues 163 and 165 have been fixed and verified. 1.3-rc4 is available from the downloads page: http://code.google.com/p/piccolo2d/downloads/list?can=2q=1.3-rc4 --- [ ] +1 I support this release [ ] +0 [ ] -0 [ ] -1 I oppose this release because... Votes from Piccolo2D project committers are binding, however votes from other contributors and users are welcomed. The vote must receive at least three +1 binding votes and no -1 binding votes. Vote will close at 12:00 GMT Tuesday 09 March 2010. On behalf of the Piccolo2D developers, michael -- Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en