Skip to main content

oneTouchExpandable widget for JXMultiSplitPane

8 replies [Last post]
sbozian
Offline
Joined: 2010-08-30
Points: 0

Hi,

I've been recently exploring the JSplitPane and JXMultiSplitPane components. Obviously, JXMultiSplitPane is more convenient if we are dealing with more than two panels (unless one wants to nest multiple JSplitPanes).

So basically, I want to use a JXMultiSplitPane. However, I need the oneTouchExpandable widget JSplitPane has. So is there any work done (or that will be done) to add this feature on the JXMultiSplitPane?

If not, can you please advise on any alternative implementation?

Thanks a lot,
Shant

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kschaefe
Offline
Joined: 2006-06-08
Points: 0

That feature of JSplitPane has never been requested.  Please add a feature request for it.  Obvisously, any patches or work that you can contribute will increase the speed at which the feature is implemented.

Karl

sbozian
Offline
Joined: 2010-08-30
Points: 0

Hi Karl, Jeanette, Luan, and all who can help,

I'm not sure if there is any ongoing work in SWINGX-1462 oneTouchExpandable widget for JXMultiSplitPane, but I've been lately toying with that issue until I reached something which works well enough.

The attached zip file contains a testcase illustrating the development, in addition to image files used. Please, take a look and tell me what you think about it. I added comments and javadocs as much as possible to explain what I did.

Basically, I tried to follow Luan's recommendation in terms of providing my own DividerPainter via setDividerPainter to add the behavior, yet I don't feel good about my implementation. The dirtiest part, I think, is the way I create the buttons, and add them to my panel using OverlayLayout. I wanted to make those buttons part of the Divider, but couldn't figure out what component they should be added to.

Also, if ideally this oneTouchExpandable widget should rather be implemented in the UI delegate (as I think is the case for JSplitPane), could you advise on a roadmap? I really appreciate your help.

Regards,
Shant

kschaefe
Offline
Joined: 2006-06-08
Points: 0

More than ever, I think that JXMultiSplitPane needs a UI delegate.  You code mostly works; I did find some edge cases that throw exceptions, such as attempting to collapse a node that has a collapsed sibling.

As a workaround, this could probably last a bit, doing the right things for you.  I'm not sure that the DividerPainter is the correct place to put the button code.  I think you are combatting JXMultiSplitPanes idea that divider a lightweight by trying to add expanders.  Perhaps, if we were to add expanders, the divider would have to become a real Swing component?

Not sure what more feedback you're looking for.  So let me know.

Karl

kschaefe
Offline
Joined: 2006-06-08
Points: 0

I'll try to give a look soon.

Karl

sbozian
Offline
Joined: 2010-08-30
Points: 0

Hi Karl,

Any updates?

Thanks,
Shant

sbozian
Offline
Joined: 2010-08-30
Points: 0

Thank you Karl. Tell me what you think.

Shant

sbozian
Offline
Joined: 2010-08-30
Points: 0

Did anyone have the time to check?

Thanks,
Shant

sbozian
Offline
Joined: 2010-08-30
Points: 0

Hi Karl,

Thank you for your reply. I just created feature request SWINGX-1462 in this regard.

Thanks again,
Shant