multisplitpane / dockable frameworks?

37 views
Skip to first unread message

Jason S

unread,
Aug 5, 2009, 10:47:45 AM8/5/09
to JavaBuilders
any suggestions on how to use JavaBuilders with JXMultiSplitPane
(http://swinglabs.org/hudson/job/SwingX%20Weekly%20Build/javadoc/org/
jdesktop/swingx/JXMultiSplitPane.html) or a dockable framework?

Jacek Furmankiewicz

unread,
Aug 5, 2009, 10:54:42 AM8/5/09
to JavaBuilders
What is this pane? The docs are abysmal.

usually you just add a type to the config,

e.g. SwingJavaBuilder.getConfig().addType(JXMultiSplitPane.class);

However, if that panel has some special logic then you may need to
write a specialyzed type handler for it.

Jason S

unread,
Aug 5, 2009, 11:08:38 AM8/5/09
to JavaBuilders
there's a decent article here...
http://today.java.net/pub/a/today/2006/03/23/multi-split-pane.html

I haven't used it yet, so I can't quite say...
it looks like you have to call setModel() on a layout model (that
would probably be difficult to integrate with JavaBuilders, but it
looks easy enough to set up in Java) that has a set of named locations
in the multisplitpane model. Then you add children by calling
multisplitpane.add(component, "locationName").

My application is pretty simple: I have 3 JPanels that include a tree,
a list, and an image preview pane. But it doesn't seem to easily fall
into an obvious layout, and I'd like to give the user some choices
including at least the following: tree|list|preview (3 panels side by
side with sliders in between), or (tree over list) | preview (tree
+list top/bottom), or (tree|list) + preview in a 3rd external frame. I
would rather use a docking framework, but if I can't figure out how to
get one working easily, I'm fine with using a multisplitpane
approach.

Correct me if I'm wrong, but is it always possible in JavaBuilders to
instantiate separate components with separate YAML files (could you
declare multiple ones in one file?) and then use them as child
components of a top-level component that is not easily integratable
with JavaBuilders?

Jacek Furmankiewicz

unread,
Aug 5, 2009, 11:14:28 AM8/5/09
to JavaBuilders
On Aug 5, 11:08 am, Jason S <jmsa...@gmail.com> wrote:
> On Aug 5, 10:54 am, Jacek Furmankiewicz <jace...@gmail.com> wrote:
> I haven't used it yet, so I can't quite say...
> it looks like you have to call setModel() on a layout model (that
> would probably be difficult to integrate with JavaBuilders, but it
> looks easy enough to set up in Java) that has a set of named locations
> in the multisplitpane model. Then you add children by calling
> multisplitpane.add(component, "locationName").

Yes, you would need to write a custom handler for it, it's not that
complicated though.
Once I'm done with 1.0, maybe I can do it as part of the SwingX
extensions.

> Correct me if I'm wrong, but is it always possible in JavaBuilders to
> instantiate separate components with separate YAML files (could you
> declare multiple ones in one file?) and then use them as child
> components of a top-level component that is not easily integratable
> with JavaBuilders?

The general idea is one PARENT component per YAML file (but of course
it can have an unlimited part of child components).
So I would create all your parts in SwingJB and then maybe manually
code the JXMultiSplitPane as the root container
manually.

Jason S

unread,
Aug 5, 2009, 12:04:25 PM8/5/09
to JavaBuilders
On Aug 5, 11:14 am, Jacek Furmankiewicz <jace...@gmail.com> wrote:
> The general idea is one PARENT component per YAML file (but of course
> it can have an unlimited part of child components).
> So I would create all your parts in SwingJB and then maybe manually
> code the JXMultiSplitPane as the root container
> manually.

OK. Is there any downside of creating a "dummy" container that's a
JPanel, using JavaBuilders, then remove()ing the components from the
dummy container, and adding them to my real root container? The reason
I ask is that I use BuildResult later and it seems a lot easier to
manage one BuildResult rather than 3 BuildResult objects.

Jacek Furmankiewicz

unread,
Aug 5, 2009, 12:09:10 PM8/5/09
to JavaBuilders
There is probably some Swing overhead to it, but nothing that SwingJB
would care about. We just create them, as best as we can. What you do
afterwards with them is totally up to you...

Alexandre Navarro

unread,
Aug 16, 2009, 3:04:29 PM8/16/09
to javabu...@googlegroups.com
I developed on extension for the dockable framework MyDoggy.

You can see a tutorial, sample and screenshot on
http://kenai.com/svn/swingjavabuilderext~others/site/swingjavabuilderext-mydoggy/tutorial.html

I will do something with Netbeans RCP dock framework in the future.

Alexandre
Reply all
Reply to author
Forward
0 new messages