[piccolo2d-dev] Re: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Updates: Status: Verified Comment #37 on issue 163 by atdi...@gmail.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Verified issue on Mac OS X 64-bit, Win Vista 32-bit -- Intel Mac Pro. OpenJDK - Intel Dell Dimension. -- 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 #35 on issue 163 by heue...@gmail.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Looks good to me, please apply to trunk. -- 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 #28 on issue 163 by re...@colorado.edu: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 My collaborator cmalley I resolved issue 163, by fixing PSwing and PSwingRepaintManager. We tested that this resolves the problem in TestPSwingDynamicComponent (attached to the ticket description). We have also been using this fix successfully in our work for several months with no serious new complications. We had started a discussion of this in the piccolo developer forum, but it stalled out, please see http://groups.google.com/group/piccolo2d-dev/browse_thread/thread/a3370d05706bd93?fwc=1 Please let us know if you'd like us to check these changes into the 1.3 branch and/or trunk, or if you'd like someone else to review the changes first. You can see the changes in files attached to aforementioned thread. -- 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: Started Owner: cmal...@pixelzoom.com Labels: Type-Defect Priority-High Effort-Medium OpSys-All Toolkit-Piccolo2D.Java Component-Extras Milestone-1.3.1 Comment #29 on issue 163 by heue...@gmail.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Great, commit to piccolo2d.java/branches/release-1.3, post the revision number here, and we'll review. -- 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 #31 on issue 163 by re...@colorado.edu: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 In r1045, I committed our fixes to PSwing and PSwingRepaintManager, and also our latest version of TestPSwingDynamicComponent, which has been renamed to PSwingDynamicComponentTest for consistency with other tests in the package. The commit message is: Added a test PSwingDynamicComponentTest for testing handling of dynamic pswing content. Fixed issue 163 by improving support for dynamic resizing of pswing target components. Refactoring of PSwing and PSwingRepaintManager to simplify and improve readability. Google automatically parsed fixed issue 163 to close the ticket, please note, however, that this fix still needs verification. If this is incorrect, please feel free to reopen the ticket. -- 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 #32 on issue 163 by re...@colorado.edu: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 After review of the fixes in r1045, we should discuss whether they should also be copied to trunk. -- 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: Owner: re...@colorado.edu Comment #33 on issue 163 by heue...@gmail.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Fixed is correct, after review it goes to Verified. And yes, these changes should be copied to trunk after review. -- 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 #23 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 component.revalidate calls PSwingRepaintManager.addInvalidComponent, which calls PSwing.updateBounds. So calls to revalidate will result in calls to updateBounds. In PSwing r930, there are 3 calls to updateBounds in listeners (lines 325,523,527). If I replace those calls with component.revalidate, things seem to work correctly, but the PSwing's components visibly changes its layout (looks jerky) when it's repainted. -- 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 #24 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 More general issue... I don't understand why we need to explicitly call component.revalidate. When (for example) ComponentListener.componentResized is called, why is the component's size/preferredSize invalid? -- 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 #25 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 TestPSwingDynamicComponent has a PSwing wrapping a JPanel, which contains 3 JComponents. I added this debug output to the ComponentListener added in PSwing.initializeComponent: System.out.println( PSwing$ComponentAdapter.componentResized + e.getComponent().getClass().getName() ); When the text of one of the panel's JComponents is changed, PSwing's ComponentListener.componentResized is called 4 times, here's the debug output: PSwing$ComponentAdapter.componentResized edu.colorado.phet.common.piccolophet.test.TestPSwingDynamicComponent$ComponentPanel PSwing$ComponentAdapter.componentResized javax.swing.JLabel PSwing$ComponentAdapter.componentResized javax.swing.JCheckBox PSwing$ComponentAdapter.componentResized javax.swing.JRadioButton So this is likely the source of the what I described as jerky behavior. It's described elsewhere in descriptions of revalidate/validate/invalidate as flickering. -- 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: 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] 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] 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] 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: Issue 163 in piccolo2d: PSwing doesn't draw dynamic JComponent properly
Comment #12 on issue 163 by allain.lalonde: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Can't disagree with you regarding the hierarchy listener, I even mentioned the strange behaviour when I made the change. The fact is, it did resolve the problem. It shouldn't have, but it did. You said, that if you add component.revalidate(); to PSwing updateBounds, then it fixes the problem, what problem? The ellipsis, or the incorrect layout, or both? And is that after you've removed the hierarchy listener? -- 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 #13 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Sorry, I should have been clearer and it was late. Adding component.revalidate() with no other changes to PSwing fixes both the ellipsis and layout issues. Apparently the bounds of both the component and PSwing were being updated using the component's dirty notion of its preferred size. I then took a look at the HierarchyBoundsListener and PropertyChangeListener added in the constructor, both of which exist to call updateBounds. I added debug output to HierarchyBoundsListener.ancestorResized and PropertyChangeListener.propertyChanged (printing getPropertyName), then ran both TestPSwingDynamicComponent and one of our applications that makes heavy use of PSwing. I didn't see anything that leads me to believe that these listeners are being called in a situation that affects the bounds. If you'd like me to make the changes to PSwing myself, let me know. I've never committed to Piccolo's SVN repository, so I'll need a little guidance on any formalities. -- 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: Fixed Comment #4 on issue 163 by allain.lalonde: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Fixed in r973 -- 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 #5 on issue 163 by cmal...@pixelzoom.com: PSwing doesn't draw dynamic JComponent properly http://code.google.com/p/piccolo2d/issues/detail?id=163 Verified that r973 solves the problem, both in TestPSwingDynamicComponent and the PhET application where this was first noticed. Note that there were a couple of unrelated format changes in PSwing r973, probably attributable to Eclipse. Thanks once again Allain. HierarchyBoundsListener is a new one for me. Should someone change their vote and fail 1.3-rc3? -- 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