JXCollapsiblePanel and resizing of dialogs

View: New views
6 Messages — Rating Filter:   Alert me  

JXCollapsiblePanel and resizing of dialogs

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have a JXCollapsiblePanel that is used to display advanced options in a dialog. We are using MigLayout for layout rendering of the dialog.

Initially when the dialog is displayed, the collapsible panel is collapsed and thus the dialog is resized to a smaller size. Now when the panel is expanded, it does not fit to the screen any more and thus the dialog would need something like "pack()" to be resized correctly to the new size.

Is there a way to do this with JXCollapsiblePanel, i.e. how do I get informed via some listener that the panel is done with expanding/collapsing so I can resize the dialog accordingly?

Thanks... Dominik.
[Message sent by forum member 'centic' (dominik.stadler@...)]

http://forums.java.net/jive/thread.jspa?messageID=367161

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...


Re: JXCollapsiblePanel and resizing of dialogs

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dominik,

the property to listen for is "animationState" - it's fired when the animation is ready. There's a simple example in the test hierarchy, in one of the JXTaskPaneSomeThing classes

HTH
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367239

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...


Re: JXCollapsiblePanel and resizing of dialogs

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

just noticed that this works only if the animated property is true - which I consider a bug

https://swingx.dev.java.net/issues/show_bug.cgi?id=1185

CU
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367248

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...


Re: JXCollapsiblePanel and resizing of dialogs

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, thanks for the quick reply, I have implemented via the "animated" property listener for now, I also expected the collapsed to be more useful, but it is sent before the expanding/collapsing is actually finished...
[Message sent by forum member 'centic' (dominik.stadler@...)]

http://forums.java.net/jive/thread.jspa?messageID=367271

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...


Re: JXCollapsiblePanel and resizing of dialogs

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't think it's a bug.  The property to listen for is collapsed.  If animated and you need to know when the animation is complete, then you can listen for animationState.  Different properties for different purposes.

Karl
[Message sent by forum member 'kschaefe' (kschaefe@...)]

http://forums.java.net/jive/thread.jspa?messageID=367289

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...


Re: JXCollapsiblePanel and resizing of dialogs

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Karl,

> I don't think it's a bug.  The property to listen for
> is collapsed.  If animated and you need to know when
> the animation is complete, then you can listen for
> animationState.  Different properties for different
> purposes.

how could I have guessed that we disagree here <g>

The problem is, that if there is no animation because the animated property is false, client code is not notified that the collapse/expand is really finished. Whatever the property name, there must be a single property to listen to which notifies about the "really-finished", independent of whether or not the process is animated. So the options are

- either fire a collapsed only at the very end, that is when the animation has ended
- or fire a animationState ended even if there has not been an animation
- or maybe a third I can't think of?

My preference would be the first because
- more in line with the spirit of how property change notification is supposed to happen, that is only after all internal update is ready.
- one property is simpler than two :-)

CU
Jeanette
[Message sent by forum member 'kleopatra' (fastegal@...)]

http://forums.java.net/jive/thread.jspa?messageID=367296

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...