<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog @ SIB Visions &#187; Docking</title>
	<atom:link href="http://blog.sibvisions.com/tag/docking/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sibvisions.com</link>
	<description>Blog @ SIB Visions</description>
	<lastBuildDate>Mon, 13 Apr 2026 09:47:01 +0000</lastBuildDate>
		<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Docking Framework with JVx application (Swing)</title>
		<link>https://blog.sibvisions.com/2017/03/15/docking-framework-with-jvx-application-swing/</link>
		<comments>https://blog.sibvisions.com/2017/03/15/docking-framework-with-jvx-application-swing/#comments</comments>
		<pubDate>Wed, 15 Mar 2017 14:28:26 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Docking]]></category>
		<category><![CDATA[JVx]]></category>

		<guid isPermaLink="false">https://blog.sibvisions.com/?p=6430</guid>
		<description><![CDATA[In last weeks, we got some inguiries about Docking support in JVx. Our answer was always the same: 
JVx itself doesn't offer a Docking API because there are many docking frameworks available and it's super easy to integrate one of them.
But this wasn't the expected answer (for most people) because it wasn't clear enough or [...]]]></description>
			<content:encoded><![CDATA[<p>In last weeks, we got some inguiries about Docking support in JVx. Our answer was always the same: </p>
<blockquote><p>JVx itself doesn't offer a Docking API because there are many docking frameworks available and it's super easy to integrate one of them.</p></blockquote>
<p>But this wasn't the expected answer (for most people) because it wasn't clear enough or it wasn't believed. We said that the integration of any existing library or framework is super easy and super fast because it's usually not more effort than the integration in any other source code. But still....</p>
<p><strong>Let's add some numbers</strong></p>
<p><em>Integration in our existing JVx application</em><br />
10 minutes (only one screen) and 30 minutes (the whole desktop)</p>
<p><em>Docking Framework Evaluation</em><br />
3 hours (Test code, examples, ...)</p>
<p><em>Implementing Docking Features</em><br />
6 hours (because of missing documentation and/or incomplete examples)</p>
<p>So, the integration took not more than 10 minutes, but the missing knowledge of Docking Frameworks was expensive. But this had nothing to do with JVx because getting know-how with frameworks or tools are always expensive.</p>
<div style="display: block; height: 15px;"></div>
<p>We tried two different docking frameworks, but found much more: <a href="http://stackoverflow.com/questions/304874/what-are-good-docking-frameworks-for-java-swing">Stackoverflow</a> question</p>
<p><center>We didn't consider commercial frameworks and inactive projects. Also GPL solutions weren't an option for us.</center></p>
<p>The first candidate was <a href="http://forge.scilab.org/index.php/p/flexdock/">FlexDock</a> because "the screenshot was impressive".<br />
Our first demo was working but we didn't find any documentation (only one inofficial <a href="http://www.javalobby.org/java/forums/t52990.html">getting started</a>). The demo application was complete enough but we had some problems because the framework uses a static context for component registration and this was a no-go. The API was simple but unclear/inconsistent in many situations. </p>
<p>We tried the next framework and this was <a href="http://www.docking-frames.org/">Docking Frames</a>. The last update of this framework was Feb 2017 and documentation is available. The tutorials are good and more than enough. The framework itself is super powerful but the API.... (oh my good). There is a core API and a common API. You shouldn't use the core API  and work with common API instead. After some hours we had all our features working, but the documentation is soo complex and all examples are really complex. Long story, short: <em>Very powerful but not easy to understand</em>.</p>
<p>We took a simple demo application and tried to replace a Split Panel, in one of our screens, with dockable panels. After this was done, we replaced the whole MDI desktop (internal fames) with a dockable desktop (dockable panels).</p>
<p>The result is shown in different videos:</p>
<p><center><div class="wp-caption aligncenter nomargin" style="width: 570px"><iframe width="560" height="315" src="https://www.youtube.com/embed/JUwQ9xPqJDE" frameborder="0" allowfullscreen></iframe><p class="wp-caption-text">Docking Framework integration (simple Screen)</p></div></center></p>
<p><center><div class="wp-caption aligncenter nomargin" style="width: 570px"><iframe width="560" height="315" src="https://www.youtube.com/embed/t4drC7BTjgQ" frameborder="0" allowfullscreen></iframe><p class="wp-caption-text">Docking Framework integration (frame and tab mode)</p></div></center></p>
<p>And the whole use-case, with replaced MDI desktop:</p>
<p><center><div class="wp-caption aligncenter nomargin" style="width: 570px"><iframe width="560" height="315" src="https://www.youtube.com/embed/WXLA4nKqJ6s" frameborder="0" allowfullscreen></iframe><p class="wp-caption-text">Docking Framework integration (desktop mode)</p></div></center></p>
<div style="display: block; height: 15px;"></div>
<p>And, finally I want to show you the source code of our changes:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;"><span class="co3">/** the data table. */</span><br />
<span class="kw1">private</span> NavigationTable tableElegantdock <span class="sy0">=</span> <span class="kw1">new</span> NavigationTable<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co3">/** the details group. */</span><br />
<span class="kw1">private</span> UIGroupPanel groupPanelElegantdock <span class="sy0">=</span> <span class="kw1">new</span> UIGroupPanel<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="co3">/** the docking control. */</span><br />
<span class="kw1">private</span> CControl ccontrol<span class="sy0">;</span></p>
<p><span class="kw1">private</span> <span class="kw4">void</span> initializeUI<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Throwable</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; ...</p>
<p>&nbsp; &nbsp; <span class="me1">ccontrol</span> <span class="sy0">=</span> <span class="kw1">new</span> CControl<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; ccontrol.<span class="me1">putProperty</span><span class="br0">&#40;</span>StackDockStation.<span class="me1">TAB_PLACEMENT</span>, TabPlacement.<span class="me1">TOP_OF_DOCKABLE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; DefaultSingleCDockable dock1 <span class="sy0">=</span> <span class="kw1">new</span> DefaultSingleCDockable<span class="br0">&#40;</span><span class="st0">&quot;data&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock1.<span class="me1">setTitleText</span><span class="br0">&#40;</span><span class="st0">&quot;Data&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock1.<span class="me1">setMinimizable</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock1.<span class="me1">setExternalizable</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock1.<span class="me1">add</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw3">Component</span><span class="br0">&#41;</span>tableElegantdock.<span class="me1">getResource</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; DefaultSingleCDockable dock2 <span class="sy0">=</span> <span class="kw1">new</span> DefaultSingleCDockable<span class="br0">&#40;</span><span class="st0">&quot;detail&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock2.<span class="me1">setTitleText</span><span class="br0">&#40;</span><span class="st0">&quot;Details&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock2.<span class="me1">setMinimizable</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock2.<span class="me1">setExternalizable</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock2.<span class="me1">add</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw3">Component</span><span class="br0">&#41;</span>groupPanelElegantdock.<span class="me1">getResource</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; CGrid cgrid <span class="sy0">=</span> <span class="kw1">new</span> CGrid<span class="br0">&#40;</span>ccontrol<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; cgrid.<span class="me1">add</span><span class="br0">&#40;</span>0, &nbsp;0, &nbsp;1, &nbsp;1, dock1<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; cgrid.<span class="me1">add</span><span class="br0">&#40;</span>1, &nbsp;0, &nbsp;1, &nbsp;1, dock2<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; ccontrol.<span class="me1">getContentArea</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">deploy</span><span class="br0">&#40;</span>cgrid<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; dock1.<span class="me1">setVisible</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; dock2.<span class="me1">setVisible</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; add<span class="br0">&#40;</span><span class="kw1">new</span> UICustomContainer<span class="br0">&#40;</span>ccontrol.<span class="me1">getContentArea</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>, UIBorderLayout.<span class="me1">CENTER</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<div style="display: block; height: 15px;"></div>
<p>The relevant code for JVx integration (will only work for JVx' swing UI):</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">dock1.<span class="me1">add</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw3">Component</span><span class="br0">&#41;</span>tableElegantdock.<span class="me1">getResource</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</div>
<p>Use the JVx resource (JPanel) and add it as component.</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">dock2.<span class="me1">add</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw3">Component</span><span class="br0">&#41;</span>groupPanelElegantdock.<span class="me1">getResource</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>Use the JVx resource (JPanel with a TitledBorder) and add it as component.</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">add<span class="br0">&#40;</span><span class="kw1">new</span> UICustomContainer<span class="br0">&#40;</span>ccontrol.<span class="me1">getContentArea</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>, UIBorderLayout.<span class="me1">CENTER</span><span class="br0">&#41;</span></div>
</div>
<p>Adds the dock control to the screen as custom container. This class connects a standard Container with JVx UI.</p>
<div style="display: block; height: 15px;"></div>
<p>I won't publish the code for the desktop replacement because it's the same again with different variable names.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2017/03/15/docking-framework-with-jvx-application-swing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
