<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>JMatter Blog: Icon Fun..</title>
    <link>http://jmatter.org/articles/2006/11/16/icon-fun</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Simplify</description>
    <item>
      <title>Icon Fun..</title>
      <description>&lt;p&gt;Yesterday I redid the Icon resolution for types.  I thought this might be a good topic for re-starting the jmatter blog entries.  Activity here has been somewhat dormant for a while..&lt;/p&gt;

&lt;p&gt;The way icons are associated with types is by following a naming convention.  The idea was well-illustrated in NakedObjects v1.0.  For example, if you have a class User.java, you can place icons &lt;code&gt;User32.png&lt;/code&gt; and &lt;code&gt;User16.png&lt;/code&gt; in the &lt;code&gt;resources/images&lt;/code&gt; directory and that icon would be used in a number of the views representing instances of this type.&lt;/p&gt;

&lt;p&gt;In JMatter, there are a number of twists.  For one, you can specify different icons to be used for lists of users.  So &lt;code&gt;Users32.png&lt;/code&gt; and &lt;code&gt;Users16.png&lt;/code&gt; are also automatically picked up for use by views of lists of users.&lt;/p&gt;

&lt;p&gt;Here's the second twist:  User.java in JMatter is Stateful.  A User can be in Locked or Unlocked State.  So, UserLocked32.png and UserUnlocked32.png are also automatically picked up and preferred for instances in a given state.  I use this to show an icon of a user with a Lock icon overlayed on top of it.&lt;/p&gt;

&lt;p&gt;Of course, JMatter will pick up either a png or a gif.&lt;/p&gt;

&lt;p&gt;Here's the new twist I put in yesterday (in subversion):  inheritance fallback.  So take the ContactManager demo application as an example.  In it, I create the class &lt;code&gt;PersonContact&lt;/code&gt; which extends the Person class.  I no longer need to provide a PersonContact32.png icon.  The app will automatically fall back to using Person32.png.&lt;/p&gt;

&lt;p&gt;I feel good about this small enhancement.  In the next weblog entry, I will talk about some of the progress I've been making recently on the meta-front.  Lots to talk about and it's pretty exciting.&lt;/p&gt;

&lt;p&gt;/ eitan&lt;/p&gt;</description>
      <pubDate>Thu, 16 Nov 2006 15:28:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:5ef992f0-60d1-49cf-9fc2-09050968cf4e</guid>
      <author>Eitan Suez</author>
      <link>http://jmatter.org/articles/2006/11/16/icon-fun</link>
    </item>
  </channel>
</rss>

