<?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>nifty-gui &#187; design</title>
	<atom:link href="http://nifty-gui.lessvoid.com/archives/category/design/feed" rel="self" type="application/rss+xml" />
	<link>http://nifty-gui.lessvoid.com</link>
	<description>a nifty gui for your java opengl/lwjgl application</description>
	<lastBuildDate>Sun, 15 Jan 2012 17:54:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>now git replaces svn completely and Nifty 1.3.1 is scheduled</title>
		<link>http://nifty-gui.lessvoid.com/archives/321</link>
		<comments>http://nifty-gui.lessvoid.com/archives/321#comments</comments>
		<pubDate>Thu, 15 Sep 2011 00:08:01 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=321</guid>
		<description><![CDATA[The idea to keep svn around for a bugfix release 1.3.1 while keeping the main development for Nifty 1.4 in git sounded reasonable at first. But since we&#8217;ve got so quickly used to git going back to svn each time really felt odd And although its possible to use git and svn together it kinda [...]]]></description>
			<content:encoded><![CDATA[<p>The idea to keep svn around for a bugfix release 1.3.1 while keeping the main development for Nifty 1.4 in git sounded reasonable at first. But since we&#8217;ve got so quickly used to git going back to svn each time really felt odd <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  And although its possible to use git and svn together it kinda made no sense to keep svn around at all. So now everything is git which makes things more clear. Good bye svn!</p>
<p>So there is now a 1.3.1 branch in git. But wait! Doesn&#8217;t Nifty consist of lots of individual jars (nifty, controls, style, renderers, sound-system implementations and so on)? So we need a branch for each individual jar, don&#8217;t we?</p>
<p>Yes, but fortunately we can combine all of the individual maven projects into a <a href="http://www.sonatype.com/books/mvnex-book/reference/multimodule.html">multi-module maven project</a>. This way we can now build the nifty-core project together with all of the dependent jars. This gives us the additional benefit to use the parent pom to define versions for plugins we use as well as common dependencies in one place instead of all the individual poms.</p>
<p>To combine the different repositories into one we&#8217;ve used yet another feature of git. It&#8217;s possible to treat another git repository as a remote repo when both exist on the same filesystem. And this his how it works:</p>
<p><code>git remote add &lt;name-we-want-to-give-this&gt; /path/to/other/repo/.git<br />
git fetch &lt;name-we-want-to-give-this&gt;</code></p>
<p>And that&#8217;s all! We can now merge with this remote one exactly the same as with any regular branch! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So with all of the projects merged into one repository and with all of the maven multi-module setup in place everything looks pretty again. Instead of the individual projects/repos we only need to branch a single git repository/maven project. Here is the <a href="http://nifty-gui.git.sourceforge.net/git/gitweb.cgi?p=nifty-gui/nifty;a=tree;h=refs/heads/1.3.1;hb=refs/heads/1.3.1">Nifty 1.3.1 Branch in the Git Repository</a>.</p>
<p>The current development is concentrating on Nifty 1.3.1. This version will contain bugfixes and improvements based on the Nifty 1.3 release. 1.3.1 will be compatible with 1.3 and will especially improve Niftys performance. For instance with some of the latest commits Nifty will now generate much less new objects each frame which will reduces the amout of GC runs necessary by quite a bit already <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There are some other performance improvements scheduled as well especially to improve the rendering speed of text elements.</p>
<p>void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/321/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ListBox Overhaul, new and improved API available and some more</title>
		<link>http://nifty-gui.lessvoid.com/archives/233</link>
		<comments>http://nifty-gui.lessvoid.com/archives/233#comments</comments>
		<pubDate>Sun, 12 Dec 2010 23:10:32 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[demo]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[event bus]]></category>
		<category><![CDATA[eventbus]]></category>
		<category><![CDATA[listbox]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[new api]]></category>
		<category><![CDATA[nifty]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=233</guid>
		<description><![CDATA[The ListBox has been greatly improved and got itself a new Nifty Java API. You can find an example right here (click the image for a webstart demo) or keep reading for all the details below. Example You can check the first example of the new ListBox online with the following Webstart URL: The source [...]]]></description>
			<content:encoded><![CDATA[<p>The ListBox has been greatly improved and got itself a new Nifty Java API. You can find an example right here (click the image for a webstart demo) or keep reading for all the details below.</p>
<p><strong>Example</strong></p>
<p>You can check the first example of the new ListBox online with the following Webstart URL:</p>
<p><a href="http://nifty-gui.sourceforge.net/webstart/nifty-default-controls-examples-1.0.jnlp"><img title="Bildschirmfoto 2010-12-12 um 23.40.53" src="../wp-content/2010/12/Bildschirmfoto-2010-12-12-um-23.40.53-300x225.png" alt="" width="300" height="225" /></a></p>
<p>The source code of this project is available online. You can check out the source directly from SVN using <a href="https://nifty-gui.svn.sourceforge.net/svnroot/nifty-gui/nifty-default-controls-examples/trunk">https://nifty-gui.svn.sourceforge.net/svnroot/nifty-gui/nifty-default-controls-examples/trunk</a> or you can browse it online here: <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls-examples/trunk/">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls-examples/trunk/</a>.</p>
<p>And if that is not enough &#8230; we&#8217;ve done the same new API treatment  to the CheckBox and we plan to do the same to the remaining Nifty  Standard Controls!</p>
<p><strong>Reference in the Wiki</strong></p>
<p>You can find a complete reference about the new standard controls in Nifty 1.3 already on the Wiki (for the ListBox and the CheckBox):</p>
<p><a href="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Nifty_Standard_Controls_%28Nifty_1.3%29">http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Nifty_Standard_Controls_%28Nifty_1.3%29</a></p>
<p>And you can keep reading about all the little Nifty details we&#8217;ve changed and improved and especially why.</p>
<p><span id="more-233"></span></p>
<p>It all started with a <a href="http://sourceforge.net/tracker/?func=detail&amp;aid=2874356&amp;group_id=223898&amp;atid=1059825">feature request for Nifty 1.3</a> which seems easy to add at first. Removing all or single elements from a Nifty ListBox sounds like a reasonable feature to have available. So I&#8217;d try to add this &#8230; and failed miserable! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The closer I looked into it the more despaired I&#8217;ve become.</p>
<p>What a mess!</p>
<p>Something I&#8217;d really love to do with Nifty 2.0 is to add a nice and clean API to the standard Nifty controls. The current way of interacting with most of the Nifty controls is kinda awkward (at least) and I want to improve this. So, I thought, hey, why not try to define a new API for the ListBox as a preparation for this and see how everything works out. Well, it turns out that in the end I&#8217;ve pretty much rewrote the whole ListBox! =) And that the new one is way better than what you currently have available!</p>
<p>One of the shortcomings of the old ListBox was speed. Internally it directly added the Nifty element tree adding elements dynamically and then used a Scrollpanel to scroll around that (maybe) huge list of elements. So basically it always rendered all elements and used the clipping of the element to hide everything that was not currently seen. Not a great idea after all <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Another problem was the API and that&#8217;s a little difficult to interact with Niftys internal screen representation. Although it&#8217;s not impossible to dynamically add/remove elements from Nifty this might not be the ideal solution to the ListBox problem.</p>
<p>So what did we changed? Well, actually a lot! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>The new ListBox:</strong></p>
<ul>
<li>Instead of relying upon the scroll panel we now only use Nifty elements for what you can see and simply replace the content of the elements when you scroll to a big list of items. So, when your ListBox only display 4 elements there really are only 4 Nifty elements allocated. Of course the ListBox allows many more Items to be added but in that case only the content of the 4 elements are replaced. You can now specify how many elements you want your display to show with the &#8220;displayItems&#8221; attribute.</li>
</ul>
<ul>
<li>Scrollbars are now optional and you can disable them completly with the &#8220;vertical&#8221; and &#8220;horizontal&#8221; attributes. Simply adding for instance vertical=&#8221;false&#8221; to the ListBox will hide the vertical Scrollbar.</li>
</ul>
<ul>
<li>The ListBox now supports single as well as multiple selections. This means you can now configure your ListBox to allow the selection of only a single item or that you want to select multipe items. If you don&#8217;t want to allow selection at all you can even disable the selection completly.</li>
</ul>
<ul>
<li> Instead of relying on storing Strings the new ListBox allows you to story your own Objects directly. So say you want your user to select different space ships by the name of the ship you could simply store your &#8220;Ship&#8221; instances directly in the ListBox. Nifty determines what text it should display for your instance by calling toString() of your objects. If this is not suitable for you, you can change this by setting a specifc <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls/trunk/src/main/java/de/lessvoid/nifty/controls/ListBoxViewConverter.java?revision=1167&amp;view=markup">ListBoxViewConverter</a> for your class.</li>
</ul>
<ul>
<li>The new ListBox now features a pretty complete API <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls/trunk/src/main/java/de/lessvoid/nifty/controls/ListBox.java?revision=1167&amp;view=markup">ListBox</a> that allows you to dynamically add, remove, select, clear items to the ListBox. This is now all available using generics..</li>
</ul>
<p><strong>EventBus Notification</strong></p>
<p>In the process of updating the ListBox we&#8217;ve noticed that we&#8217;re missing a nice way to allow the controls to notify other components of the system about things happening. If the selection of the ListBox is changed we&#8217;d like other parts to be notified about that event. Well, the first thing that comes to ones mind is of course the Listener/Observer pattern. But there are some problems with this approach, mostly the strong binding between the objects that communicate. There is a <a href="http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf">great PDF available from the OSGI people</a> that discusses some of the problems of the Listener pattern.</p>
<p>Having previously worked with GWT 2.x and its event bus architecture we&#8217;d like to have someting similar for Nifty too. What we want is a loose coupling between Nifty (as the creator of events) and your application (as the receiver of the events). As it turns out a publish/subscribe mechanism allows us to do just that! Nifty publishes events to some &#8220;global&#8221; EventBus. And your application on the other hand subscribes to this EventBus for all the events that it needs to handle. What sounds not very different from the standard Listener pattern at first is in fact a great improvement! There is only a dependency to the EventBus and not between the objects that communicate! Which helps a lot to decouple the objects from one another. Nifty does not need to know who will receive the event in the end. It just creates the event and publishes it to the EventBus and everybody interessted in it will be notified.</p>
<p>As it turns out there is a neat little project available that implements that mechanism for us. It is called <a href="http://www.eventbus.org/">EventBus</a> and is available as Open Source under the Apache License, Version 2.0. It&#8217;s only 80KB in size, so it should not hurt the download/memory footprint of Nifty that much. Nifty is now using the EventBus project for ListBox and CheckBox notifications which worked very very well so far! You subscribe to the EventBus using the id of the element as a topic and you&#8217;ll receive all events that the control with the given id produces. In the case of the ListBox this means that you receive instances of the <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-default-controls/trunk/src/main/java/de/lessvoid/nifty/controls/ListBoxSelectionChangedEvent.java?revision=1169&amp;view=markup">ListBoxSelectionChangedEvent</a>. This basically sends you the current selection of the ListBox everytime the selection has been changed <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Good Times,<br />
void</p>
<p>PS: And if you NOW don&#8217;t feel like christmas is already here then I can&#8217;t help you =)</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/233/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tired of Nifty XML? Try the new Nifty Builder Java classes! :D</title>
		<link>http://nifty-gui.lessvoid.com/archives/179</link>
		<comments>http://nifty-gui.lessvoid.com/archives/179#comments</comments>
		<pubDate>Sat, 04 Sep 2010 21:24:56 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[docs]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=179</guid>
		<description><![CDATA[In order to improve the usability of Nifty, Nifty user arielsan of gemserk has started creating a &#8220;Builder Pattern&#8221; based way to create Nifty GUIs. These classes can be used from within java to create a Nifty GUI without the need for an external xml file. We have improved the solution together and there is [...]]]></description>
			<content:encoded><![CDATA[<div id="magicdomid2840">
<p>In order to improve the usability of Nifty, Nifty user arielsan of <a href="http://blog.gemserk.com/">gemserk</a> has started creating a &#8220;Builder Pattern&#8221; based way to create Nifty GUIs. These classes can be used from within java to create a Nifty GUI without the need for an external xml file.</p>
<p>We have improved the solution together and there is a Nifty ScreenBuilder class available as your starting point. Here is a quick example what you can do with it:</p>
</div>
<div>
<pre class="brush:java">Screen mainScreen = new ScreenBuilder("main") {{
  controller(new ScreenControllerExample());

  layer(new LayerBuilder("layer") {{
    backgroundColor("#003f");
    childLayoutCenter();

    panel(new PanelBuilder() {{
      id("panel");
      childLayoutCenter();
      height(percentage(25));
      width(percentage(80));
    }});
  }});
}}.build(nifty);
</pre>
</div>
<div>
<p>This  should really read very well. We create a new Nifty Screen, add a  ScreenController, a single Layer with a backgroundColor and a panel  which is centered in the middle of the layer.</p>
</div>
<div>Please Note the double &#8220;{&#8221; and &#8220;}&#8221; characters. We&#8217;re creating anonymous inner classes with an initialize block to have a nice and readable form.</div>
<div>You can use the Nifty Builder to create your GUI completly in Java and without the need for a Nifty XML file now. Another use would be to do rapid prototyping of your GUI directly within Java. And you even have support from your IDE like autocompletion and javadoc too.<br />
<strong><br />
Please Note:</strong></div>
<div>
<p>
As we&#8217;re creating annonymous inner classes each time we add a new xxxBuilder() {{ }} method and we&#8217;re nesting them it&#8217;s possible to access methods from the previous annonymous class and that could be confusing because we could misconfigure the parent element. So it&#8217;s probably best to only use methods from the current Builder class.
</p>
<p>
Ariel also wrote an example GUI using the Builder mechanism which is part of the Java2d Renderer tests but can be used with other renderer systems too of course. You can find it in svn or use this direkt link to the file: <a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-java2d-renderer/trunk/tests/src/main/java/de/lessvoid/nifty/java2d/tests/GameExampleApp.java?view=markup">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-java2d-renderer/trunk/tests/src/main/java/de/lessvoid/nifty/java2d/tests/GameExampleApp.java?view=markup</a>
</p>
</div>
<div>Have fun,</div>
<div>void in cooperation with arielsan =)</div>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/179/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Nifty User zozo64 creates Basis Drag and Drop Demo!</title>
		<link>http://nifty-gui.lessvoid.com/archives/155</link>
		<comments>http://nifty-gui.lessvoid.com/archives/155#comments</comments>
		<pubDate>Mon, 28 Jun 2010 21:35:17 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[bubble]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=155</guid>
		<description><![CDATA[See! This is what I&#8217;ve meant! Nifty gives you an easy to use framework that you can extend with your own ideas. Just like Nifty user zozo64 did. Nifty is missing drag and drop support? No problem! He created his own! To be honest, he found some bugs too but all of that improved Niftys [...]]]></description>
			<content:encoded><![CDATA[<p>See! This is what I&#8217;ve meant! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Nifty gives you an easy to use framework that you can extend with your own ideas. Just like Nifty user zozo64 did. Nifty is missing drag and drop support? No problem! He created his own! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>To be honest, he found some bugs too <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but all of that improved Niftys core systems. So that&#8217;s a good thing. We&#8217;ll probably bring his work as a standard drag and drop control into the standard controls project soon.</p>
<p>For the moment you can take a look at the code. It&#8217;s part of the nifty examples project:</p>
<p><a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/dragndrop/">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/dragndrop/</a></p>
<p>And here is a first preview of zozo64 work:</p>
<p><object width="640" height="480"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=12880005&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=12880005&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="480"></embed></object>
<p><a href="http://vimeo.com/12880005">Nifty Basic Drag and Drop</a> from <a href="http://vimeo.com/user1070526">void</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/155/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamically Changing Button Text/Width and the Centerlayout</title>
		<link>http://nifty-gui.lessvoid.com/archives/122</link>
		<comments>http://nifty-gui.lessvoid.com/archives/122#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:03:55 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[bubble]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[button control text]]></category>
		<category><![CDATA[button text]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[changing text]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=122</guid>
		<description><![CDATA[Jattra tries to dynamically change button text from within Java and he needs a Button that automatically resizes according to the width of the changed text. You can follow both threads at the Nifty Help Forum at sf.net: Changing Button Text Thread Resizing Buttons to Text Thread. Read the complete blog post for details. Dynamically [...]]]></description>
			<content:encoded><![CDATA[<p>Jattra tries to dynamically change button text from within Java and he needs a Button that automatically resizes according to the width of the changed text.</p>
<p>You can follow both threads at the Nifty Help Forum at sf.net:</p>
<ul>
<a href="https://sourceforge.net/projects/nifty-gui/forums/forum/807893/topic/3546927">Changing Button Text Thread</a></ul>
<ul>
<a href="https://sourceforge.net/projects/nifty-gui/forums/forum/807893/topic/3558041">Resizing Buttons to Text Thread</a>.</ul>
<p>Read the complete blog post for details.<br />
<span id="more-122"></span></p>
<p>Dynamically changing text was easy and has been added to the ButtonControl. You can now simply change text with the following code from java:</p>

<div class="wp_syntax"><div class="code"><pre class="java5">screen.<span style="color: #006600;">findControl</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backButton&quot;</span>, ButtonControl.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setText</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;New Text&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Automatically resizing Buttons was a bit more involving tho.</p>
<p>Nifty actually has build in support for resizing elements according to other elements. But before we can understand what that means we first need to know a bit about the internal workings of a Nifty Button Control.</p>
<p>A Nifty Button consists of a Panel element with childLayout=&#8221;center&#8221; and one child element which is a Label element that represents the actual button text. So far so good and the standard style set (nifty-style-black) simply adds a fixed width to the button.</p>
<p>So simply using the Button control:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;control</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Hello World&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>will give you a button with a style specific fixed width.</p>
<p>You can override this fixed width when you use the button control like that:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;control</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;4532px&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Hello Large Button World&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>This works pretty good if you don&#8217;t need to change the button label text. No matter what you do to a button with a fixed width it will always stay at this width (Unless you change the width constraint from code as one of Jattras code examples shows. And although this works it is a bit cumbersome but until now the only way to achieve resizing buttons).</p>
<p>So what should we do to fix this?</p>
<p>Well, actually there is not really much to do. If you ever used a childLayout=&#8221;vertical&#8221; on something without setting a width but every child in that special element had a fixed size you already have seen that Nifty actually resizes the parent element!</p>
<p>And this is basically default behaviour in Nifty: Whenever Nifty finds an element without a width (or height) constraint it looks at all the child elements and if they all have a fixed width (or height) it automatically resizes the parent element to the size of all child elements.</p>
<p>And this is just what we need here <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As stated above the Button control uses childLayout=&#8221;center&#8221; and up until now the center layout did not support this kind of auto-resizing feature. But this has been added to svn a moment ago.</p>
<p>So whenever Nifty encounters an element with childLayout=&#8221;center&#8221; and the child element has a fixed width then it will resize the element to the child width. And this works for our button control too! And it works even when dynamically changing text from within Java <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Well, there is one thing to note tho. For backward compatibility the nifty-style-black still sets a fixed width to the button. So to enable the auto resizing you have to override the witdh of the button with an empty String.</p>
<p>Example to enable the auto resizing Button:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;control</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;autoresizing button&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>And that&#8217;s it. <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Note:</strong><br />
Another thing to note is, that the change to the center layout logic now requires you to set a width to all elements that use childLayout=&#8221;center&#8221;. Before this change there was no auto resizing done to elements that use center layout. To prevent the auto resizing that will be used on that elements now you need to specify a width to this elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/122/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Feature &#8211; Keyframes for Nifty Effects</title>
		<link>http://nifty-gui.lessvoid.com/archives/108</link>
		<comments>http://nifty-gui.lessvoid.com/archives/108#comments</comments>
		<pubDate>Tue, 27 Oct 2009 01:05:40 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[bubble]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[interpolation]]></category>
		<category><![CDATA[introduction]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=108</guid>
		<description><![CDATA[Well, I&#8217;m currently rewriting the old Nifty Introduction Demonstration that somehow didn&#8217;t survive my last blog server switch It was posted right here but the jnlp disappear. The demo explained some basic concepts of Nifty and it was written in Nifty I&#8217;m rewritting it now to update it to the current Nifty Standards. In the [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;m currently rewriting the old Nifty Introduction Demonstration that somehow didn&#8217;t survive my last blog server switch <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  It was <a href="http://nifty-gui.lessvoid.com/archives/9">posted right here</a> but the jnlp disappear. The demo explained some basic concepts of Nifty and it was written in Nifty <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m rewritting it now to update it to the current Nifty Standards.</p>
<p>In the process I just want a moving Nifty GUI Logo like this one</p>
<p><a href="http://nifty-gui.lessvoid.com/wp-content/2009/10/tutorial-intro.gif"><img class="alignnone size-medium wp-image-109" title="tutorial-intro" src="http://nifty-gui.lessvoid.com/wp-content/2009/10/tutorial-intro.gif" alt="" width="128" height="96" /></a></p>
<p>So the logo should resize while fading in and keep on resizing while fading out.</p>
<p><span id="more-108"></span><br />
My first try was this xml (only the resizing part is shown with the &#8220;imageSize&#8221; effect attached to &#8220;onStartScreen&#8221;):</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;imageSize&quot;</span> <span style="color: #000066;">startSize</span>=<span style="color: #ff0000;">&quot;0.7&quot;</span> <span style="color: #000066;">endSize</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">neverStopRendering</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;imageSize&quot;</span> <span style="color: #000066;">startSize</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">endSize</span>=<span style="color: #ff0000;">&quot;1.3&quot;</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">neverStopRendering</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">startDelay</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></pre></div></div>

<p>Which was reasonable but doesn&#8217;t work. It doesn&#8217;t work because effects with a startDelay are in fact already active. In this case the second onStartScreen imageSize effect overwrites the first one with it&#8217;s intial startSize of 1.0 for the time the startDelay is active. Which, yeah, makes sense for most effects but sucks in this case.</p>
<p>What I&#8217;d really want to write is this instead:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;imageSize&quot;</span> <span style="color: #000066;">neverStopRendering</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;0.7&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value</span> <span style="color: #000066;">time</span>=<span style="color: #ff0000;">&quot;1200&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;1.3&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/onStartScreen<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>Well, and now you can actually write it like this! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>What this does is performing linear interpolation for of the given values. In the example above the value for the imageSize effect starts with 0.7 and changes to 1.0 over a time of 600ms. After that it continues to be interpolated from 1.0 to 1.3 for the next 600ms. When value tags are present they will overwrite the length parameter of the effect. So in the example the imageSize effect will last for 1200ms.</p>
<p>I&#8217;ve just commited this to svn. It is still work in progress and is therefore only available for the &#8220;imageSize&#8221; and the &#8220;fade&#8221; effect. I&#8217;m currently thinking about extending it to other effects where it is appropriate. I&#8217;m also considering to not only interpolate float values but to make it more general and the actual values are effect specific, so that you could interpolate color values for instance.</p>
<p>void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/108/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nifty plays well with others and of course with slick2d too</title>
		<link>http://nifty-gui.lessvoid.com/archives/91</link>
		<comments>http://nifty-gui.lessvoid.com/archives/91#comments</comments>
		<pubDate>Sun, 13 Sep 2009 13:20:29 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[compatibily]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[overlay]]></category>
		<category><![CDATA[Slick]]></category>
		<category><![CDATA[slick2d]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/?p=91</guid>
		<description><![CDATA[Nifty can be used as a standalone GUI. So when your game enters its menu or option screens Nifty is all there is on the screen and all user input is handled by Nifty. When using Nifty together with Slick2d this is represented by the NiftyGameState class. Using this class your Slick2d StateBasedGame can easliy [...]]]></description>
			<content:encoded><![CDATA[<p>Nifty can be used as a standalone GUI. So when your game enters its menu or option screens Nifty is all there is on the screen and all user input is handled by Nifty.</p>
<p>When using Nifty together with Slick2d this is represented by the NiftyGameState class. Using this class your Slick2d StateBasedGame can easliy switch from your in game state to the NiftyGameState and display the GUI.</p>
<p><strong>But</strong> this is not the only way Nifty can be used. You can easily use Nifty to render your in-game GUI too! Nifty plays well with others (as long as they use OpenGL/lwjgl for rendering that is).</p>
<p>It&#8217;s not complicated at all and I wanted to write example code that demonstrates how easy it is for a long time. Motivated by a question at the <a title="Nifty Forum at sourceforge.net" href="http://sourceforge.net/projects/nifty-gui/forums/forum/807893">Nifty Forum at souceforge.net</a> I did now <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>What&#8217;s demonstrated in the new slick example is, how you can use Nifty to render a GUI on top of a normal slick GameState.</p>
<p>Here is a screenshot of the example which renderes Text from within Slick that changes color when you press the keys 1-3. On top of this it renders a Nifty GUI that responds to mouse events. Additionally if you press 1-3 the colored Nifty boxes start to shake <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div id="attachment_92" class="wp-caption aligncenter" style="width: 310px"><a href="http://nifty-gui.lessvoid.com/wp-content/2009/09/bildschirmfoto-2009-09-13-um-145515.png"><img class="size-medium wp-image-92" title="Slick Overlay with Nifty GUI" src="http://nifty-gui.lessvoid.com/wp-content/2009/09/bildschirmfoto-2009-09-13-um-145515-300x225.png" alt="Slick Overlay with Nifty GUI" width="300" height="225" /></a><p class="wp-caption-text">Slick Overlay with Nifty GUI</p></div>
<p>You can try it out with the Webstart:</p>
<p><a href="http://nifty-gui.sourceforge.net/webstart/nifty-slick-overlay-demo.jnlp">http://nifty-gui.sourceforge.net/webstart/nifty-slick-overlay-demo.jnlp</a></p>
<p>and you can find the example in svn or you can browse it online here:</p>
<p><a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/slick/niftyoverlay/">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/java/de/lessvoid/nifty/examples/slick/niftyoverlay/</a> (Java classes)</p>
<p><a href="http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/resources/slick/niftyoverlay/overlay.xml?revision=534&amp;view=markup">http://nifty-gui.svn.sourceforge.net/viewvc/nifty-gui/nifty-examples/trunk/src/main/resources/slick/niftyoverlay/overlay.xml?revision=534&amp;view=markup</a> (Nifty XML for the Screen &#8211; overlay.xml)</p>
<p>Keep reading the full Article to see the details on how we get this to work and what you need to consider.</p>
<p><span id="more-91"></span></p>
<p>The way it works is pretty easy and it even works with anything you&#8217;ve rendered in lwjgl. Slick is not required but as shown it works very well with Slick too.</p>
<p>So you just need to:</p>
<ol>
<li> <strong>Save your current OpenGL-State and enable 2d Mode</strong><br />
You have to make sure you save your current OpenGL state and make sure you are in 2d &#8220;mode&#8221; before calling Nifty. Which means that everything is setup for 2d OpenGL rendering (orthogonal projection, modelview matrix aligned with the screen, etc. In Slick this is all handled by a single call to SlickCallable.enterSafeBlock(). This makes sure that the current Slick state is saved and changes in Slick or Nifty don&#8217;t disturb each other (we&#8217;re already in 2d mode too because of slick).</li>
<li><strong>Call Nifty to render its GUI</strong><br />
You call Nifty.render() to render the Nifty GUI. You can call render() with a boolean parameter that tells Nifty to clear the screen (parameter = true) or if it should not clear the screen at all (parameter = false). If you are rendering an overlay you probably want to leave the screen as is and render your GUI on top. So in this case simply call nifty.render(false).</li>
<li><strong>Restore your State and continue your own Rendering</strong><br />
When nifty.render() returns you can reset your state so that you can continue rendering 3d triangles or whatever you want to render on top (!) of Nifty GUI. Again in Slick this is a single SlickCallable.leaveSafeBlock() call.</li>
<li><strong>Forward KeyEvents</strong><br />
You decide if keyEvents get past through to Nifty by calling nifty.keyEvent() with the events you want that Nifty gets. If you don&#8217;t call keyEvent() no key events will get to Nifty what might or might not be what you want.</li>
<li><strong>Forward MouseEvents</strong><br />
Handling mouse events are a bit trickier because they are handled through the InputSystem interface which you need to call the Nifty constructor with. But creating an implementation of the InputSystem is easy because at the moment it only consists of one method that Nifty uses to request a List of current available MouseEvents. So you&#8217;re implementation can decide when and what mouse events get through to Nifty in the InputSystem-Implementation.</li>
</ol>
<p>The example in nifty-examples svn demonstrates how to forward MouseEvents but does not care about keyboard Events.</p>
<p>And that&#8217;s it! Nifty GUI playing together with others! Nifty! <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>void</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/91/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Separating Styles and Resources from the Main Nifty Jar</title>
		<link>http://nifty-gui.lessvoid.com/archives/23</link>
		<comments>http://nifty-gui.lessvoid.com/archives/23#comments</comments>
		<pubDate>Thu, 23 Oct 2008 23:30:12 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/archives/23</guid>
		<description><![CDATA[At the moment the current &#8220;nifty.jar&#8221; is about 435 KB in size. This is because the jar contains some xml style definitions for the standard nifty controls and resource files like images and fonts. If you won&#8217;t use the standard controls or images this is a waste of filesize. So now we&#8217;ve extracted the resources [...]]]></description>
			<content:encoded><![CDATA[<p>At the moment the current &#8220;nifty.jar&#8221; is about 435 KB in size. This is because the jar contains some xml style definitions for the standard nifty controls and resource files like images and fonts. If you won&#8217;t use the standard controls or images this is a waste of filesize.</p>
<p>So now we&#8217;ve extracted the resources into a separate &#8220;nifty-default-styles.jar&#8221;. The &#8220;nifty.jar&#8221; now only contains the actual code and is only 280 KB big <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now you&#8217;ll need both jars in your classpath when you want to use the default styles but you can add your own of course.</p>
<p>Currently only available in svn or in the latest 0.0.5-snapshot.</p>
<p>Nifty <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/23/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connect a xml screen with a ScreenController class in java</title>
		<link>http://nifty-gui.lessvoid.com/archives/20</link>
		<comments>http://nifty-gui.lessvoid.com/archives/20#comments</comments>
		<pubDate>Sun, 10 Aug 2008 09:07:42 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/archives/20</guid>
		<description><![CDATA[Nifty GUI uses XML to store the layout of your GUI. To connect such a XML description with some class in Java there is the ScreenController Interface you need to provide: /**  * ScreenController Interface all screen controllers should support.  * @author void  */ public interface ScreenController &#123; /**   * Bind this ScreenController to [...]]]></description>
			<content:encoded><![CDATA[<p>Nifty GUI uses XML to store the layout of your GUI. To connect such a XML description with some class in Java there is the ScreenController Interface you need to provide:</p>

<div class="wp_syntax"><div class="code"><pre class="java5"><span style="color: #808080; font-style: italic;">/**
 * ScreenController Interface all screen controllers should support.
 * @author void
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> ScreenController <span style="color: #66cc66;">&#123;</span>
  <span style="color: #808080; font-style: italic;">/**
   * Bind this ScreenController to a screen. This happens
   * when the Screen got the onStartScreen() method.
   * @param nifty nifty
   * @param screen screen
   */</span>
  <span style="color: #993333;">void</span> bind<span style="color: #66cc66;">&#40;</span>Nifty nifty, Screen screen<span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/**
   * called when all start effects are ended and the screen
   * is ready for interactive manipulation.
   */</span>
  <span style="color: #993333;">void</span> onStartScreen<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/**
   * called when the onEndScreen effects ended and this screen is done.
   */</span>
  <span style="color: #993333;">void</span> onEndScreen<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>To let Nifty know what ScreenController class you want to use for a Nifty Screen there is the &#8220;controller&#8221; attribute on the <screen> xml tag:</p>

<div class="wp_syntax"><div class="code"><pre class="xml">...
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;nifty<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;screen</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">controller</span>=<span style="color: #ff0000;">&quot;com.mypackage.HelloWorldStartScreen&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
  ...
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/screen<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/nifty<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>To resolve the concrete ScreenController instance Nifty can use two different ways:</p>
<ol>
<li>Nifty creates a new instance of the given ScreenController class and registers this instance with the Screen</li>
<li>You can give Nifty a ScreenController instance that matches the class given in the controller attribute. Nifty will first look for an existing instance and creates a new class only when it can&#8217;t find one.</li>
</ol>
<p>To register ScreenController instances with Nifty there are additional parameters on the &#8220;fromXml()&#8221; method of the Nifty class. This way you can even add multiple different instances for use in multiple Nifty screens.</p>

<div class="wp_syntax"><div class="code"><pre class="java5">  <span style="color: #808080; font-style: italic;">/**
   * load xml.
   * @param filename file to load
   * @param controllers controllers to use
   */</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> fromXml<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #aaaadd; font-weight: bold;">String</span> filename, <span style="color: #000000; font-weight: bold;">final</span> ScreenController ... <span style="color: #006600;">controllers</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
...</pre></div></div>

<p><strong>Note: </strong>You still need the controller attribute in the xml so that Nifty can connect the screen with your ScreenController instance.</p>
<p><strong>Note: </strong>In case you use anonymous inner classes like in this example here:</p>

<div class="wp_syntax"><div class="code"><pre class="java5"><span style="color: #000000; font-weight: bold;">class</span> MyStuff <span style="color: #66cc66;">&#123;</span>
...
<span style="color: #006600;">nifty</span>.<span style="color: #006600;">fromXml</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;menu.xml&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> ScreenController<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> bind<span style="color: #66cc66;">&#40;</span>Nifty nifty, Screen screen<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
...</pre></div></div>

<p>the classname then turns to &#8220;MyStuff$1&#8243;.</p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Style Progress&#8230;</title>
		<link>http://nifty-gui.lessvoid.com/archives/17</link>
		<comments>http://nifty-gui.lessvoid.com/archives/17#comments</comments>
		<pubDate>Thu, 29 May 2008 21:48:55 +0000</pubDate>
		<dc:creator>void</dc:creator>
				<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://nifty-gui.lessvoid.com/archives/17</guid>
		<description><![CDATA[Old Nifty XML &#8211; pretty ugly &#160; Nifty XML with Style &#8211; a lot better &#160; Nifty XML Style Definition &#60;!-- main menu style --&#62; &#60;!-- &#60;attributes childLayout=&#34;vertical&#34; align=&#34;center&#34; valign=&#34;center&#34; height=&#34;50%&#34; /&#62; &#60;effect&#62; &#60;onStartScreen name=&#34;hide&#34; length=&#34;500&#34; inherit=&#34;true&#34; startDelay=&#34;1000&#34; /&#62; &#60;onStartScreen name=&#34;fade&#34; startColor=&#34;#fff0&#34; endColor=&#34;#ffff&#34; length=&#34;1000&#34; startDelay=&#34;500&#34; inherit=&#34;true&#34; /&#62; &#60;onEndScreen name=&#34;fade&#34; startColor=&#34;#ffff&#34; endColor=&#34;#fff0&#34; length=&#34;500&#34; inherit=&#34;true&#34; /&#62; &#60;/effect&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Old Nifty XML &#8211; pretty ugly</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xml">&nbsp;</pre></div></div>

<p><strong>Nifty XML with Style &#8211; a lot better <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>

<div class="wp_syntax"><div class="code"><pre class="xml">&nbsp;</pre></div></div>

<p><strong>Nifty XML Style Definition</strong></p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- main menu style --&gt;</span></span>
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--
  &lt;attributes childLayout=&quot;vertical&quot; align=&quot;center&quot; valign=&quot;center&quot; height=&quot;50%&quot; /&gt;</span>
</span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;effect<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hide&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">inherit</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">startDelay</span>=<span style="color: #ff0000;">&quot;1000&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onStartScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fade&quot;</span> <span style="color: #000066;">startColor</span>=<span style="color: #ff0000;">&quot;#fff0&quot;</span> <span style="color: #000066;">endColor</span>=<span style="color: #ff0000;">&quot;#ffff&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;1000&quot;</span> <span style="color: #000066;">startDelay</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">inherit</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onEndScreen</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fade&quot;</span> <span style="color: #000066;">startColor</span>=<span style="color: #ff0000;">&quot;#ffff&quot;</span> <span style="color: #000066;">endColor</span>=<span style="color: #ff0000;">&quot;#fff0&quot;</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">inherit</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/effect<span style="font-weight: bold; color: black;">&gt;</span></span></span>
--&gt;
&nbsp;
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- menu item style --&gt;</span></span>
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--
  &lt;attributes align=&quot;center&quot; /&gt;</span>
</span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;hover</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;200%&quot;</span> <span style="color: #000066;">falloffConstraint</span>=<span style="color: #ff0000;">&quot;horizontal&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;effect<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;onFocus</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pulsate&quot;</span> <span style="color: #000066;">hoverWidth</span>=<span style="color: #ff0000;">&quot;200%&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;200%&quot;</span> <span style="color: #000066;">period</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">startColor</span>=<span style="color: #ff0000;">&quot;#3c000000&quot;</span> <span style="color: #000066;">endColor</span>=<span style="color: #ff0000;">&quot;#ff7c00ff&quot;</span> <span style="color: #000066;">timeType</span>=<span style="color: #ff0000;">&quot;infinite&quot;</span> <span style="color: #000066;">cycle</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/effect<span style="font-weight: bold; color: black;">&gt;</span></span></span>
--&gt;</pre></div></div>

<p> <img src='http://nifty-gui.lessvoid.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nifty-gui.lessvoid.com/archives/17/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

