<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6885067460687713893</id><updated>2012-02-02T22:18:28.575+01:00</updated><category term='javafx'/><category term='fridayfun'/><category term='canvas'/><category term='custom'/><category term='javascript'/><category term='java'/><category term='groovy'/><category term='html5'/><category term='swing'/><category term='steelseries'/><category term='fxgconverter'/><title type='text'>Harmonic Code</title><subtitle type='html'>The life of a nerd that loves to code legacy Java Swing...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>63</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-2586860003058532180</id><published>2012-01-27T17:15:00.000+01:00</published><updated>2012-01-27T17:15:49.592+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Gradient trick...</title><content type='html'>&lt;span style="font-family: Verdana, sans-serif;"&gt;Aloha,&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;during my work at &lt;a href="http://www.quintiq.com/" target="_blank"&gt;Quintiq&lt;/a&gt; i stumbled upon a problem when drawing lot's of linear gradients in "realtime". In our software we have a gantt chart component that could contain thousands of nodes. Each of these nodes could contain multiple so called compartments which are representing a range of values. So the node itself is visualized using a LinearGradientPaint and also each compartment is visualized with it's own LinearGradientPaint. So far this should not be a problem but now it comes...we can't really cache things because the whole gantt chart is so to say "live". This means if somewhere in the businessmodel a value changed it will affect the ganttchart in the way that the nodes and their compartments will change it's size. Another problem is that the nodes could not only have different widths but also different heights.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;The compartments are separate shapes that will drawn on top of the nodes.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;And that's not enough, the chart that is visible on the screen only represents a small part of the whole data which means one could scroll horizontal which let new nodes appear on the screen and others might change their height (this is something special to this kind of graph in our software).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-7ggtD6Jto3k/TyLGR8xeN7I/AAAAAAAAArw/_HDiiS3DfuQ/s1600/GanttChartPost.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-7ggtD6Jto3k/TyLGR8xeN7I/AAAAAAAAArw/_HDiiS3DfuQ/s1600/GanttChartPost.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Long story short...we could nail the performance problem to the drawing of the linear gradients and their creation.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;So i was thinking about how to improve the drawing speed of these gradients and came to an interesting approach that i would like to share with you in this post.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;First of all i created a 1px wide BufferedImage with the most common height of the nodes. Then i filled this 1px image with a linear gradient (e.g. the green one) and saved the image for later use. Everytime when there was a new color of a compartment i created an 1px gradient image for this color.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;The trick is now to use the TexturePaint to fill all these nodes which has the big advantage that it will scale the gradientimage automaticaly to the needed height. Because we have to create each gradient only once now the repaint speed could be reduced by 30ms on each repaint.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;This performance problem only occured when the gantt chart became really huge with thousands of nodes, but i thought it might be interesting for you to know.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Here is a little code snippet that will give you a hint on what i did...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class="java" name="code"&gt;private BufferedImage nodeTexture;&lt;br /&gt;&lt;br /&gt;private void init() {&lt;br /&gt;    private final float[] fractions = {&lt;br /&gt;        0.0f,&lt;br /&gt;        0.5f,&lt;br /&gt;        1.0f&lt;br /&gt;    };&lt;br /&gt;    private final Color[] colors = {&lt;br /&gt;        Color.RED,&lt;br /&gt;        Color.GREEN,&lt;br /&gt;        Color.BLUE&lt;br /&gt;    };&lt;br /&gt;    nodeTexture = createNodeTexture(24, fractions, colors);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;protected void paintComponent(Graphics g) {&lt;br /&gt;    ...&lt;br /&gt;    Graphics2D g2 = (Graphics2D) g.create();&lt;br /&gt;    for (RoundRectangle2D node : nodes) {&lt;br /&gt;        TexturePaint nodePaint = new TexturePaint(nodeTexture, node.getBounds());&lt;br /&gt;        g2.setPaint(nodePaint);&lt;br /&gt;        g2.fill(node);&lt;br /&gt;    }&lt;br /&gt;    g2.dispose();&lt;br /&gt;    ...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Method that creates a 1px wide gradient image    &lt;br /&gt;private BufferedImage createNodeTexture(final int HEIGHT, float[] fractions, Color[] colors) {&lt;br /&gt;    GraphicsEnvironment gfxEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();&lt;br /&gt;    GraphicsConfiguration gfxConf = gfxEnv.getDefaultScreenDevice().getDefaultConfiguration();&lt;br /&gt;    BufferedImage image = gfxConf.createCompatibleImage(1, HEIGHT, Transparency.OPAQUE);&lt;br /&gt;    Graphics2D g2 = image.createGraphics();&lt;br /&gt;    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);&lt;br /&gt;    Point2D start = new Point2D.Double(0, 0);&lt;br /&gt;    Point2D stop = new Point2D.Double(0, HEIGHT);&lt;br /&gt;    final LinearGradientPaint GRADIENT_NODE = new LinearGradientPaint(&lt;br /&gt;        start, &lt;br /&gt;        stop, &lt;br /&gt;        fractions, &lt;br /&gt;        colors);&lt;br /&gt;    g2.setPaint(GRADIENT_NODE);&lt;br /&gt;    g2.fillRect(0, 0, 1, HEIGHT);&lt;br /&gt;    g2.dispose();&lt;br /&gt;    return image;&lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Before i forget it...we are hiring, so if you are looking for a job in the Java and/or C++ area please check &lt;a href="http://www.quintiq.com/careers/job-openings.aspx?pagnr=1&amp;amp;country=Netherlands&amp;amp;expertise=Development" target="_blank"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;That's it for today, so keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-2586860003058532180?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/2586860003058532180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2012/01/gradient-trick.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/2586860003058532180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/2586860003058532180'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2012/01/gradient-trick.html' title='Gradient trick...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-7ggtD6Jto3k/TyLGR8xeN7I/AAAAAAAAArw/_HDiiS3DfuQ/s72-c/GanttChartPost.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-1352329365252087288</id><published>2012-01-06T10:28:00.003+01:00</published><updated>2012-01-06T23:49:24.418+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Friday Fun Component XV</title><content type='html'>&lt;span style="font-family: Verdana, sans-serif;"&gt;Here we go again...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Today i have nothing special for you but just another traffic light component. This time the component is more compatible to different background colors because it's semitransparent.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;We needed something for our software and the other traffic light component was simply too dark...so i created this one...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-3hWL-RCsnos/TwMlvDwoqlI/AAAAAAAAArQ/WV22-RXNOC8/s1600/120103-0002.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-3hWL-RCsnos/TwMlvDwoqlI/AAAAAAAAArQ/WV22-RXNOC8/s1600/120103-0002.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://db.tt/xvPgVywU" &gt;click to see it in action...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;As you can see it comes in two versions and you could switch between both versions by using the &lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;yellowVisible&lt;/i&gt;&lt;/span&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt; property.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;The frame has the color #333333 with an opacity of 50% and the inner part has the color #CCCCCC with an opacity of 50%.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Due to the transparency this component fits better on different backgroundcolors because they shine through.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;This component is now also part of the SteelSeries Java Swing component library.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Well that's all for this friday, as always you could download the binary and source (as &lt;a href="http://www.netbeans.org/"&gt;NetBeans&lt;/a&gt; project) here:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;binary version: &lt;a href="http://dl.dropbox.com/u/84552/TrafficLight2/TrafficLight2.jar"&gt;TrafficLight2.jar&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;source &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &lt;a href="http://dl.dropbox.com/u/84552/TrafficLight2/TrafficLightDemo2.zip"&gt;TrafficLightDemo2.zip&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;So enjoy the upcoming weekend and keep coding...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-1352329365252087288?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/1352329365252087288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2012/01/friday-fun-component-xv.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1352329365252087288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1352329365252087288'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2012/01/friday-fun-component-xv.html' title='Friday Fun Component XV'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-3hWL-RCsnos/TwMlvDwoqlI/AAAAAAAAArQ/WV22-RXNOC8/s72-c/120103-0002.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-3734532237641737246</id><published>2012-01-02T17:06:00.001+01:00</published><updated>2012-01-05T14:40:42.513+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.9.10 (QuickRelease)</title><content type='html'>&lt;span style="font-family: Verdana, sans-serif;"&gt;Happy new year everybody...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;UPDATE: due to some minor modifications the current version is 3.9.12&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;I know i said it would take some months until you will see the next release but i needed some components be part of the library so i decided this morning to make a quick release and added these new things to the lib.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;The new things i have added are the traffic light and light bulb you might know already from the friday fun components, another traffic light component that might fit better to different color schemes and at least 8 new indicator symbols in the IndicatorGauge.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;To give you an idea on what the stuff looks like...here they are...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;The traffic lights and the light bulb...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-jFW6wUnIeKU/TwGggrGKnSI/AAAAAAAAAqc/jPb4JD2ffz8/s1600/120102-0002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-jFW6wUnIeKU/TwGggrGKnSI/AAAAAAAAAqc/jPb4JD2ffz8/s1600/120102-0002.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;and the eight new symbols which are just arrows pointing to different directions...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-HYKXYbOWH-A/TwGg1D42DZI/AAAAAAAAAqs/wsFkABGeB6g/s1600/120102-0001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-HYKXYbOWH-A/TwGg1D42DZI/AAAAAAAAAqs/wsFkABGeB6g/s1600/120102-0001.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;And that's all for this release...like i said a quick release with just a few new additions. You will find the new version either &lt;a href="http://dl.dropbox.com/u/84552/SteelSeries3/SteelSeries-3.9.10.jar" target="_blank"&gt;here&lt;/a&gt; on this blog on the right side or at &lt;a href="http://search.maven.org/#search%7Cga%7C1%7CSteelSeries" target="_blank"&gt;MavenCentral&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;For those of you that are interested in the progress of the SteelSeriesFX i could show you one screenshot of the current state...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-9lo5ceeNSn0/TwHV1LLzWvI/AAAAAAAAAq4/qje14yyKKJ8/s1600/120102-0003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-9lo5ceeNSn0/TwHV1LLzWvI/AAAAAAAAAq4/qje14yyKKJ8/s1600/120102-0003.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;As you can see i made some progress but it's still a looooooong way to go...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;so stay tuned and keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-3734532237641737246?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/3734532237641737246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2012/01/steelseries-3910-quickrelease.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3734532237641737246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3734532237641737246'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2012/01/steelseries-3910-quickrelease.html' title='SteelSeries 3.9.10 (QuickRelease)'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-jFW6wUnIeKU/TwGggrGKnSI/AAAAAAAAAqc/jPb4JD2ffz8/s72-c/120102-0002.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-5187190097733147146</id><published>2011-11-25T13:33:00.000+01:00</published><updated>2011-11-25T13:33:39.717+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.9.9</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It took some time due to some conferences and my new job but i finally decided that it's time for another release of the SteelSeries component library.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because i will port the complete library to JavaFX 2.0 this will be the last release &amp;nbsp;of the Swing library for the next months.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Porting the lib to JavaFX 2.0 means a complete rewrite from scratch combined with learning JavaFX...so this will also take some time...which means patience my friends...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;But now let's talk about the stuff that's in this release...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The DisplaySingle component (lcd with a single row) got most of my attention in this release. So first of all it's now capable of displaying also text instead of numbers only.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-lMGlS1MlQCI/Ts90GiQjIMI/AAAAAAAAAmU/dl5F46pVBwM/s1600/111125-0001.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-lMGlS1MlQCI/Ts90GiQjIMI/AAAAAAAAAmU/dl5F46pVBwM/s1600/111125-0001.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://www.youtube.com/watch?v=chyhlWiYcJw" target="_blank"&gt;Click me to see a youtube video of the scrolling...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you click on the link below the image you will see a little video on youtube that shows the rudimentary scrolling capability that is supported by the DisplaySingle component.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The display of text could be enabled/disabled by using setting the lcdNumericValues property to false and fill the lcdText property with some text.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;There's also a new LcdColor available that is only useful in the DisplaySingle component and will be used to visualize sections in the lcd display.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Without any section applied to the DisplaySingle it will look like this:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-vhhH2xUhAWg/Ts-CHxnGc9I/AAAAAAAAApg/7X7HaRBlUfo/s1600/111125-0026.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-vhhH2xUhAWg/Ts-CHxnGc9I/AAAAAAAAApg/7X7HaRBlUfo/s1600/111125-0026.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As an example i defined sections as follows:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Section[] sections = {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; new Section(0, 25, Color.GREEN),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; new Section(25, 50, Color.YELLOW),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; new Section(50, 75, Color.ORANGE),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; new Section(75, 100, Color.RED)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you set these sections with the setSections() method to a DisplaySingle component and activate the visibility of the sections by calling setSectionsVisible(true) you will get results like follows:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-rrgHMo43Jgg/Ts-CIkVO2TI/AAAAAAAAApo/nKQy_Q9kRQw/s1600/111125-0027.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-rrgHMo43Jgg/Ts-CIkVO2TI/AAAAAAAAApo/nKQy_Q9kRQw/s1600/111125-0027.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-LlU9QqkwPpE/Ts-CJErNksI/AAAAAAAAApw/-JEOJgqpYQQ/s1600/111125-0028.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-LlU9QqkwPpE/Ts-CJErNksI/AAAAAAAAApw/-JEOJgqpYQQ/s1600/111125-0028.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Y2Sos0ckH1I/Ts-CJxtMhYI/AAAAAAAAAp4/qLP07FYB9J4/s1600/111125-0029.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Y2Sos0ckH1I/Ts-CJxtMhYI/AAAAAAAAAp4/qLP07FYB9J4/s1600/111125-0029.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-kFAarTlc544/Ts-CKaOwQEI/AAAAAAAAAqA/hPYBDj30IBc/s1600/111125-0030.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-kFAarTlc544/Ts-CKaOwQEI/AAAAAAAAAqA/hPYBDj30IBc/s1600/111125-0030.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;We will use this feature to visualize the quality of kpi's in the next version of the Quintiq software.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the gauges it's now possible to adjust the color for the inner (green in the image) and outer frame (red in the image), which was requested...&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-T8kFNRyRxNo/Ts-CCFFarjI/AAAAAAAAAok/8IqOZ4Kuya0/s1600/111125-0018.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-T8kFNRyRxNo/Ts-CCFFarjI/AAAAAAAAAok/8IqOZ4Kuya0/s1600/111125-0018.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And again some new pointer types are available...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-F41MRims3Gw/Ts-B5y50ITI/AAAAAAAAAm4/w5rJicUeCPg/s1600/111125-0005.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-F41MRims3Gw/Ts-B5y50ITI/AAAAAAAAAm4/w5rJicUeCPg/s320/111125-0005.png" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-B3a8YKaRAvY/Ts-B6AhZVxI/AAAAAAAAAnA/yXaqQ1nr3g4/s1600/111125-0006.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-B3a8YKaRAvY/Ts-B6AhZVxI/AAAAAAAAAnA/yXaqQ1nr3g4/s320/111125-0006.png" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bWU6zx8uBgw/Ts-B6hPp9NI/AAAAAAAAAnI/mJpqAdJkY58/s1600/111125-0007.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-bWU6zx8uBgw/Ts-B6hPp9NI/AAAAAAAAAnI/mJpqAdJkY58/s320/111125-0007.png" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-TAULdb-17UI/Ts-B7KwYDrI/AAAAAAAAAnQ/2PB_sUPhwlM/s1600/111125-0008.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-TAULdb-17UI/Ts-B7KwYDrI/AAAAAAAAAnQ/2PB_sUPhwlM/s320/111125-0008.png" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The pointer type 13 and also type 2 now change their color dependend on the background color. That means the pointer will get a better contrast on the choosen background color. The color that will be used to fill the pointer is the same as the label color defined in the background color.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another new thing i've added to the lib is the ability to use logarithmic scaling for the gauges which might be useful when measuring over a large range of values.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The implementation is rudimentary and only for base 10 but it's a start...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ZPpW5v8-r2o/Ts-B-C0taEI/AAAAAAAAAn0/srSufZHqxCg/s1600/111125-0013.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-ZPpW5v8-r2o/Ts-B-C0taEI/AAAAAAAAAn0/srSufZHqxCg/s1600/111125-0013.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;logScaling disabled (default)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Zmg9lsozrDg/Ts-B_3wFPUI/AAAAAAAAAoI/VyUokcZMEgk/s1600/111125-0015.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Zmg9lsozrDg/Ts-B_3wFPUI/AAAAAAAAAoI/VyUokcZMEgk/s1600/111125-0015.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;logScaling enabled&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The logarithmic scaling is available on the radial and linear gauges and bargraphs.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you could see on the images above there's also another new feature that makes it possible to adjust the orientation of the ticklabels.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;There are three possibilities available:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;normal&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;horizontal&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;tangent&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;and that's how they look like...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-mmV-XBbnEzw/Ts-B8_JbIII/AAAAAAAAAng/unJxt6gzvlU/s1600/111125-0010.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-mmV-XBbnEzw/Ts-B8_JbIII/AAAAAAAAAng/unJxt6gzvlU/s1600/111125-0010.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-sXI22Lh37IY/Ts-B9Ctc6LI/AAAAAAAAAno/RORMtjWugx8/s1600/111125-0011.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-sXI22Lh37IY/Ts-B9Ctc6LI/AAAAAAAAAno/RORMtjWugx8/s1600/111125-0011.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-U15nVzlWsD0/Ts-B9mlqxqI/AAAAAAAAAns/sM51BzuZZlU/s1600/111125-0012.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-U15nVzlWsD0/Ts-B9mlqxqI/AAAAAAAAAns/sM51BzuZZlU/s1600/111125-0012.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And that's still not the end, there's also a new frame design called GlossyMetal which looks like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-mUQDCcTPrSQ/Ts-B776EiRI/AAAAAAAAAnc/H4WWh0pS3zs/s1600/111125-0009.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-mUQDCcTPrSQ/Ts-B776EiRI/AAAAAAAAAnc/H4WWh0pS3zs/s1600/111125-0009.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Started talking about the frames there's also a new feature that makes it possible to choose a custom color for a frame (this feature only works for the frame design named ShinyMetal) and could be switched on with setFrameBaseColorEnabled(true). If you have switched this feature on you could set a frame base color that will be used to colorize the frame of the gauge which leads to a visualization like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-1_GGG3qtuyQ/Ts-CAXn8WZI/AAAAAAAAAoU/BrL6nItiCPw/s1600/111125-0016.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-1_GGG3qtuyQ/Ts-CAXn8WZI/AAAAAAAAAoU/BrL6nItiCPw/s1600/111125-0016.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The next feature is something that was on my list for a long time but i never found the time to do it...now it's done...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Frameless gauges...&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-BolAL0TMG-4/Ts-CBQ-Qw6I/AAAAAAAAAoc/Bn8GaqzHe-Q/s1600/111125-0017.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-BolAL0TMG-4/Ts-CBQ-Qw6I/AAAAAAAAAoc/Bn8GaqzHe-Q/s1600/111125-0017.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you switch off the visibility of the frame the gauge will take the whole space of the component instead of simply not show the frame. This is really useful if you do have a lot of gauges on your dashboard where you don't need the frames.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;At least i made some modifications to the visualization of the sections in a gauge that might be useful for business dashboards. Because that are only small modifications i won't explain everthing but show you some more images...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-GSb7WSINafA/Ts-CCgb8AyI/AAAAAAAAAoo/KREcaNnL15c/s1600/111125-0019.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-GSb7WSINafA/Ts-CCgb8AyI/AAAAAAAAAoo/KREcaNnL15c/s1600/111125-0019.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-9je_IMs9l4g/Ts-CEoUVm6I/AAAAAAAAAo8/f0ZVkiW5Gy8/s1600/111125-0021.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-9je_IMs9l4g/Ts-CEoUVm6I/AAAAAAAAAo8/f0ZVkiW5Gy8/s1600/111125-0021.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-SR1i0kua-4g/Ts-CFTvZ8BI/AAAAAAAAApE/YBLXZV8XSOk/s1600/111125-0022.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-SR1i0kua-4g/Ts-CFTvZ8BI/AAAAAAAAApE/YBLXZV8XSOk/s1600/111125-0022.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-sMg_YL22PKg/Ts-CGych00I/AAAAAAAAApQ/xqNCqD6_BuM/s1600/111125-0024.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-sMg_YL22PKg/Ts-CGych00I/AAAAAAAAApQ/xqNCqD6_BuM/s1600/111125-0024.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-8VWlcUiAL0g/Ts-CHdemF9I/AAAAAAAAApY/4td1uWfj_Ug/s1600/111125-0025.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-8VWlcUiAL0g/Ts-CHdemF9I/AAAAAAAAApY/4td1uWfj_Ug/s1600/111125-0025.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As always you could find the binary version on the right side of this blog.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I guess that's it for 3.9.9 and like i said already this will be the last release for the next months because i really have not time to do all this stuff in my spare time again and will focus on the SteelSeriesFX version...so stay tuned and keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-5187190097733147146?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/5187190097733147146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/steelseries-399.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5187190097733147146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5187190097733147146'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/steelseries-399.html' title='SteelSeries 3.9.9'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-lMGlS1MlQCI/Ts90GiQjIMI/AAAAAAAAAmU/dl5F46pVBwM/s72-c/111125-0001.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-1593927510198988402</id><published>2011-11-18T16:30:00.000+01:00</published><updated>2011-11-18T16:30:44.282+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Friday Fun Component XIV</title><content type='html'>&lt;span style="font-family: Verdana, sans-serif;"&gt;Aloha,&lt;/span&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;back from &lt;a href="http://www.devoxx.com/"&gt;Devoxx&lt;/a&gt; which was great again i still found some time to release another little fun component for you.&lt;/span&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;It's a range slider that i've created for the server team of &lt;a href="http://www.quintiq.com/"&gt;Quintiq&lt;/a&gt;. This slider is in principle a simple &lt;a href="http://download.oracle.com/javase/6/docs/api/javax/swing/JSlider.html"&gt;JSlider&lt;/a&gt; with two knobs instead of one.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;We use this slider to specify a range of days (e.g. a week or so) but you can use it for all kind of ranges.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Here is a screenshot of it...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-sCvX1XKcif4/TsZ2B_eJt3I/AAAAAAAAAmM/-1cxz6Q1lnw/s1600/111118-0001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-sCvX1XKcif4/TsZ2B_eJt3I/AAAAAAAAAmM/-1cxz6Q1lnw/s1600/111118-0001.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;On the screenshot you could see most of the features the range slider has to offer. One could set different kinds of knob shapes, knob designs, track styles, range colors etc.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;One interesting feature might be that you can drag no only the thumbs but also the range itself which could be useful if you have defined a range and would like to keep the delta but on a different position on the scale.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Because it's still 4:30 pm in Germany i won't go into detail now and leave it up to you to play around with the little &lt;a href="http://dl.dropbox.com/u/84552/RangeSlider/rangeslider.jnlp"&gt;demo app&lt;/a&gt; i created.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Because i did not want to reinvent the wheel i based the slider on the work of &lt;a href="http://ernienotes.wordpress.com/2010/12/27/creating-a-java-swing-range-slider/"&gt;Ernie Yu&lt;/a&gt; who blogged about it last year in december.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;And if you like it you might want to download the sources as always presented a s a &lt;a href="http://netbeans.org/"&gt;NetBeans&lt;/a&gt; project...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Binary jar:&lt;/b&gt; &lt;a href="http://dl.dropbox.com/u/84552/RangeSlider/RangeSlider.jar"&gt;RangeSlider.jar&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Source &amp;nbsp; &amp;nbsp; :&lt;/b&gt;&amp;nbsp;&lt;a href="http://dl.dropbox.com/u/84552/RangeSlider/RangeSlider.zip"&gt;Rangeslider.zip&lt;/a&gt; (NetBeans project)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;And that's it for this friday...enjoy the upcoming weekend and keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-1593927510198988402?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/1593927510198988402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/friday-fun-component-xiv.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1593927510198988402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1593927510198988402'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/friday-fun-component-xiv.html' title='Friday Fun Component XIV'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-sCvX1XKcif4/TsZ2B_eJt3I/AAAAAAAAAmM/-1cxz6Q1lnw/s72-c/111118-0001.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-6823819489859071622</id><published>2011-11-11T10:02:00.009+01:00</published><updated>2011-11-11T10:02:00.735+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Friday Fun Component XIII</title><content type='html'>&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;And another one...even if i was really busy this week due to an internal training course named the "Demo challenge" i could not resist to release another friday fun component.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;This time it's all about a traffic light component that might be useful to visualize the state of something...and here is what it looks like...&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-nvmrRfqs2Jk/TrmLytqes7I/AAAAAAAAAlc/Z2vf5mdduBQ/s1600/111108-0001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-nvmrRfqs2Jk/TrmLytqes7I/AAAAAAAAAlc/Z2vf5mdduBQ/s1600/111108-0001.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-o5lgwyjunqI/TrmLy4xb7dI/AAAAAAAAAlg/GxVFHDM1ICk/s1600/111108-0002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-o5lgwyjunqI/TrmLy4xb7dI/AAAAAAAAAlg/GxVFHDM1ICk/s1600/111108-0002.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-wBGI6C175Zc/TrmLzSULsyI/AAAAAAAAAls/nm89jF5u2vk/s1600/111108-0003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-wBGI6C175Zc/TrmLzSULsyI/AAAAAAAAAls/nm89jF5u2vk/s1600/111108-0003.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;This component is one of the simplest ones i've build so far and only has three properties...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="background-color: transparent; font-family: 'Trebuchet MS', sans-serif;"&gt;redOn &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (boolean)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="background-color: transparent; font-family: 'Trebuchet MS', sans-serif;"&gt;yellowOn &amp;nbsp; &amp;nbsp;(boolean)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="background-color: transparent; font-family: 'Trebuchet MS', sans-serif;"&gt;greenOn &amp;nbsp; &amp;nbsp; (boolean)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;Each of these has a getter and a setter and that's it...like i said...really simple...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;It's scalable as you expected and as last week i created a little &lt;a href="http://dl.dropbox.com/u/84552/TrafficLight/trafficlight.jnlp"&gt;demo app&lt;/a&gt; that will give you the chance to take a look at the component before you might want to download the sources...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Source (NetBeans project): &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;a href="http://dl.dropbox.com/u/84552/TrafficLight/TrafficLight.zip" style="font-family: Verdana, sans-serif;"&gt;TrafficLight.zip&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Binary jar: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href="http://dl.dropbox.com/u/84552/TrafficLight/TrafficLight.jar" style="font-family: Verdana, sans-serif;"&gt;TrafficLight.jar&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;I hope this component will be useful for one or the other and if you have ideas for other components you would like me to create...just let me know...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: -webkit-auto;"&gt;&lt;span style="font-family: 'Trebuchet MS', sans-serif;"&gt;Keep coding and enjoy the upcoming weekend...&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-6823819489859071622?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/6823819489859071622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/friday-fun-component-xiii.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6823819489859071622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6823819489859071622'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/friday-fun-component-xiii.html' title='Friday Fun Component XIII'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-nvmrRfqs2Jk/TrmLytqes7I/AAAAAAAAAlc/Z2vf5mdduBQ/s72-c/111108-0001.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-8381136685656244987</id><published>2011-11-04T07:34:00.000+01:00</published><updated>2011-11-10T20:32:13.490+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Friday Fun Component XII</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Due to some training sessions that i have to do this week and next week i'll only release a very small blogpost about another fun component that i created for &lt;a href="http://twitter.com/mittie"&gt;Dierk König&lt;/a&gt; of &lt;a href="http://www.canoo.com/"&gt;Canoo&lt;/a&gt;. It's all about a light bulb...which looks like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-0Yico5iKaSU/TrJTfZOd3EI/AAAAAAAAAlU/-DGb_tFx6hw/s1600/111103-0006.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-0Yico5iKaSU/TrJTfZOd3EI/AAAAAAAAAlU/-DGb_tFx6hw/s1600/111103-0006.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well it's nothing special but might be useful for the one or other visualization.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The component has the following properties:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;direction &amp;nbsp; (SwingUtilities.NORTH(default), EAST, SOUTH, WEST)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;glowColor (java.awt.Color)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;alpha &amp;nbsp; &amp;nbsp; &amp;nbsp; (float 0.0f...1.0f)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;on &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (boolean)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I created a little &lt;a href="http://dl.dropbox.com/u/84552/LightBulb/lightbulb.jnlp"&gt;demo app&lt;/a&gt; that let you play with some of these parameters.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And as always the source and the binary jar:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Source (NetBeans project): &amp;nbsp; &amp;nbsp;&lt;a href="http://dl.dropbox.com/u/84552/LightBulb/LightBulb.zip"&gt;LightBulb.zip&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Binary jar: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href="http://dl.dropbox.com/u/84552/LightBulb/LightBulb.jar"&gt;LightBulb.jar&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Like i said...it's a short post, so keep coding...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-8381136685656244987?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/8381136685656244987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/friday-fun-component-xii.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8381136685656244987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8381136685656244987'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/11/friday-fun-component-xii.html' title='Friday Fun Component XII'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-0Yico5iKaSU/TrJTfZOd3EI/AAAAAAAAAlU/-DGb_tFx6hw/s72-c/111103-0006.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-8930775562152629685</id><published>2011-10-28T08:00:00.001+02:00</published><updated>2011-11-10T20:32:13.491+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Friday Fun Component XI</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here we go again...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I'm really busy these days which is the reason why the blog was not updated for such a long time but...it's friday again which means time for some fun...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Two days ago &lt;a href="http://twiiter.com/GeertjanW"&gt;Geertjan Wielenga&lt;/a&gt; from the &lt;a href="http://www.netbeans.org/"&gt;NetBeans&lt;/a&gt; team at Oracle contacted me and asked for a StickyNote component that he would like to use in the NetBeans platform (see the result &lt;a href="http://blogs.oracle.com/geertjan/entry/sticky_note"&gt;here&lt;/a&gt;).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well i liked the idea and i really like NetBeans which pushed me even a bit more to create the component.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Long story short...here it is...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-rrNl46ZsdAs/TqmBFeWjDQI/AAAAAAAAAkA/-rLP0hH60CI/s1600/111027-0002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-rrNl46ZsdAs/TqmBFeWjDQI/AAAAAAAAAkA/-rLP0hH60CI/s1600/111027-0002.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you could see it's really just a simple sticky note. It contains a JEditorPane that is editable which means you could put the sticky note somewhere and start typing.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;First i thought it would make sense to add a scrolling behaviour to the component too but a real sticky note also has no scrolling right... :)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The component comes with two kinds of fonts, the standard font which is Verdana and a handwriting font (which is default). But you can use whatever font you like by setting the customFont(java.awt.Font) and setCustomFontEnabled(true) methods. You might also want to change the color of the note which could be done by using the setNoteColor(java.awt.Color) method. So the result could look like these...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-1Wa5CkpJUag/TqmBEn48WPI/AAAAAAAAAj8/sI_9O-e4kYE/s1600/111027-0001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-1Wa5CkpJUag/TqmBEn48WPI/AAAAAAAAAj8/sI_9O-e4kYE/s1600/111027-0001.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you took a look at Geertjans blogpost and read the sticky notes on the screenshot you will find something like "Maybe add a &amp;nbsp;pin to note"...so why not adding a pin to the note just for the fun of it...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-TMtHOrvkQj4/TqmBHj4PmMI/AAAAAAAAAkg/gKNiBTrld28/s1600/111027-0006.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-TMtHOrvkQj4/TqmBHj4PmMI/AAAAAAAAAkg/gKNiBTrld28/s1600/111027-0006.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You could enable/disable the pin by using setPushPinVisible(true/false).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So here is the source (as NetBeans project) and a binary version that you could use directly...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://dl.dropbox.com/u/84552/StickyNote/StickyNote.zip" style="font-family: Verdana, sans-serif;"&gt;Source (NetBeans project)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://dl.dropbox.com/u/84552/StickyNote/StickyNote.jar" style="font-family: Verdana, sans-serif;"&gt;Binary version (jar)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's it for today, so enjoy your weekend and keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-8930775562152629685?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/8930775562152629685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/10/friday-fun-component-xi.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8930775562152629685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8930775562152629685'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/10/friday-fun-component-xi.html' title='Friday Fun Component XI'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-rrNl46ZsdAs/TqmBFeWjDQI/AAAAAAAAAkA/-rLP0hH60CI/s72-c/111027-0002.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-7706236025190185533</id><published>2011-10-11T23:10:00.000+02:00</published><updated>2011-10-11T23:10:28.323+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Short note about Java ONE 2011...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Hi there,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;last friday i returned from my trip to &lt;a href="http://www.oracle.com/javaone/index.html"&gt;JavaOne&lt;/a&gt; and i have to say that this conference really rocks.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well to be honest i did not thought this way when i arrived at the conference because the venue was terrible in my eyes. This is because i never attended a conference where the talks have been split up to different hotels...and we are talking about huge hotels which means it takes a while until you find your way through all these floors...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The splitting somehow destroys the "community feeling" that usually is present at a conference which means all the people are hiding somewhere in the hotels and it's hard to find someone if you are searching for someone.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;But nevertheless i met a lot of people which was a really great experience, especially talking to Greg Brown of the JavaFX team was really interesting because we simply had a lot of stuff to talk about...really enjoyed that.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Sunday:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;When i arrived at sunday evening i was a little bit in a hurry to check in to the hotel and pick up my badge for JavaOne because i arrived in SFO around 6pm.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After i picked the badge up i went outside to the Mason Street café where i met &lt;a href="http://www.linkedin.com/pub/dir/Frank/Greco"&gt;Frank Greco&lt;/a&gt; from &lt;a href="http://www.kaazing.com/"&gt;Kaazing&lt;/a&gt;. We had a nice discussion about HTML5, websockets etc.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Monday:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Fortunately i met &lt;a href="http://twitter.com/aalmiray"&gt;Andres Almiray&lt;/a&gt; and &lt;a href="http://twitter.com/ixchelruiz"&gt;Ixchel Ruiz&lt;/a&gt; on monday morning so they picked me up at Mason Street café and showed me the speakers lounge etc. which was great to know. After that we attended the keynote that had some nice things in it (i just say JavaFX on an iPad and an Android device...)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After the keynote i started exploring the venue and attended lots of talks.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Tuesday:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On tuesday i continued my exploration by visiting the exhibition area. I talked to the Vaadin guys and decided to add support for Vaadin to the FxgConverter. In addition i asked again for one of their t-shirts but again got the answer that they don't have them available. I told them that i asked them last year at JFokus and this year at JFokus and again on JavaOne and never got one...so they said they will send me one...what should i say...they really did...THANX A LOT !!!&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After talking to Vaadin i walked to the Jetbrans booth and talked with them about the possibility to add the fxg converter as a plugin to IntelliJ and they directly send me a template that i'm now working on to get the FxgConverter as plugin for IntelliJ Idea. Again THANX A LOT !!!&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The last booth i visited was one of the JavaFX desks of Oracle where i met Greg Brown of the JavaFX team. Like i said we had a lot of good discussions that i really enjoyed...so i'll keep in touch with Greg that's for sure.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another highlight was the Java Desktop lunch that was organized by &lt;a href="http://steveonjava.com/"&gt;Stephen Chin&lt;/a&gt;&amp;nbsp;(a really nice guy btw)&amp;nbsp;and i have to say even if it was short it was good to see and talk to people that have the same interests as i have...Java on the desktop.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://javafx.com/"&gt;JavaFX&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You know i kept an eye on JavaFX since back to the days when it was called &lt;a href="http://blogs.oracle.com/chrisoliver/entry/f3"&gt;F3&lt;/a&gt; (FormFollowsFunction) and "just" a project of Chris Olliver and i really didn't liked the whole &lt;a href="http://download.oracle.com/javafx/1.3/tutorials/core/"&gt;JavaFX script&lt;/a&gt; stuff that Sun made out of it. I can't really explain why i did not like JavaFX script (might be all the braces) but i know that something prevented me from ever using it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;When i heard that Oracle will reinvent the wheel another time i was not really looking forward to the result but i have to say that it was worth taking a look at it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now that it's implemented in Java the whole JavaFX thing makes much more sense and if you start working with it, it feels somehow familiar. Maybe this is because it was made by the same people that created Swing...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well it's not completely finished yet and i still miss some things that are available in Swing but i have to say that the JavaFX team did a great job by porting it to Java. They convinced me so that i started porting the SteelSeries library to JavaFX which means there will be a SteelSeriesFX in the near future (depending on the spare time that i'll have in my new job). So even if you think you won't need all the effects and animations in JavaFX it's really worth a look.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://groovy.codehaus.org/GroovyFX"&gt;GroovyFX&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well to be honest there are also parts in JavaFX that really looks quirky and lead to a lot of boilerplate code but fortunately &lt;a href="http://pleasingsoftware.blogspot.com/"&gt;Dean Iverson&lt;/a&gt; and Jim Clarke did a great job on creating GroovyFX which is a &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; port to JavaFX. With using GroovyFX you are able to reduce the amount of code to a minimum. The really good thing is that you won't loose the readability but you will in fact get a better readability too...it's just amazing. By the way there's also a &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; port to JavaFX called &lt;a href="http://code.google.com/p/scalafx/"&gt;ScalaFX&lt;/a&gt; which is similar to GroovyFX in the amount of code you won't have to write.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://griffon.codehaus.org/"&gt;Griffon&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I knew it for some time but never played around with it...SHAME ON ME !!! Griffon really rocks and i hope to find some time to finally play around with it. After attending the talk of &lt;a href="http://twitter.com/aalmiray"&gt;Andres Almiray&lt;/a&gt; i just can tell you if you are a Swing developer you should take a look at Griffon, it really has some nice features in it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Back to the conference:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Mentioning &lt;a href="http://twitter.com/#!/deanriverson"&gt;Dean Iverson&lt;/a&gt; reminds me on the talks he gave at JavaOne...if you ever have the chance to attend to one of his talks...GO THERE !!!!! This guy is really entertaining and has a lot of knowledge to share with you...his talks have been my favourites at JavaOne.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another great talk was the one of &lt;a href="http://twitter.com/mittie"&gt;Dierk König&lt;/a&gt; (&lt;a href="http://www.canoo.com/"&gt;Canoo&lt;/a&gt;) which was slideless...such a nice idea to simply code in front of the audience. So anyone that had a question just asked and Dierk replied to it by live coding the answer. The complete contrast to Dierks talk was a talk about JavaFX multimedia stuff which was one of the not as good talks i attended. After this talk i thought by myself that it should be forbidden for the speaker to sit in front of his computer during the talk (except he is coding/showing something). The whole presentation got so boring just because the speakers (3 of them) just sitting in front of their computers which made the whole scene looked like a "Stillleben"...i left the talk before it was finished.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Even if i'm not coding for mobile devices i attended a talk about &lt;a href="http://www.oracle.com/technetwork/java/javame/javamobile/download/lwuit/index.html"&gt;LWUIT&lt;/a&gt; (LightWeight UI Toolkit) which is used in the Java ME area. The reason why i attended this talk was that they have a nice concept for the presentation, they brought their graphical designer with them and let him explain how and why he created specific graphical things in LWUIT. This was interesting because it demonstrated the problems with the Designer-Developer workflow that was part of my talk.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Wednesday:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On wednesday i had my talk at 1pm and it was fun...so for everyone that is interested you could find the pdf of my presentation &lt;a href="https://oracleus.wingateweb.com/published/oracleus2011/sessions/23240/S23240_144217.pdf"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Wednesday evening i spent some time at the event on treasure island where Sting and Tom Petty and the heartbreakers played but i have to say that there have been too many people out there for me so i decided to went back to the hotel early.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Thursday:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;At thursday which was the last day of the conference i decided to spent half the day at Google in Mt. View visiting &lt;a href="http://alexruiz.developerblogs.com/"&gt;Alex Ruiz&lt;/a&gt; which was worth every second...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Alex is such a nice guy and we talked a lot (most of the time about our kids) which i really enjoyed and i'm looking forward to meet him again...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because i started my new job at &lt;a href="http://www.quintiq.com/"&gt;Quintiq&lt;/a&gt; yesterday i won't have much time left to blog but i'll try to keep things running so stay tuned...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-7706236025190185533?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/7706236025190185533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/10/short-note-about-java-one-2011.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7706236025190185533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7706236025190185533'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/10/short-note-about-java-one-2011.html' title='Short note about Java ONE 2011...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-5270485497730131505</id><published>2011-09-13T14:30:00.003+02:00</published><updated>2011-09-18T12:58:47.606+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fxgconverter'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><category scheme='http://www.blogger.com/atom/ns#' term='javafx'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><title type='text'>FxgConverter 2.0</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To get nice graphics from a drawing program into java code i use &lt;a href="http://www.adobe.com/de/products/fireworks.html"&gt;Adobe Fireworks&lt;/a&gt; capability to export &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/FXG+2.0+Specification"&gt;Adobe fxg&lt;/a&gt; files which i convert into Java2d code.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because my old &lt;a href="http://idisk.mac.com/han.solo-Public/FxgConverter/fxgconverter.jnlp"&gt;fxg converter&lt;/a&gt; was not the most beautiful coded piece of software i always knew that someday in the future i would have to recreate it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Long story short...it's done...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This is the new fxg converter...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-OqmLUPdzJOk/Tm8z3-KxfNI/AAAAAAAAAiY/YrusxvFHTyQ/s1600/110913-0001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="402" src="http://4.bp.blogspot.com/-OqmLUPdzJOk/Tm8z3-KxfNI/AAAAAAAAAiY/YrusxvFHTyQ/s640/110913-0001.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you can see it looks very similar to the old version and i only changed the available options.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the background i now use a complete new parser/translator combi written in &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This new parser/translator combi is able to convert fxg code to&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://java.sun.com/products/java-media/2D/index.jsp"&gt;Java2D&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://javafx.com/"&gt;JavaFX 2.0&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html"&gt;HTML5 Canvas&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://code.google.com/intl/de-DE/webtoolkit/"&gt;GWT&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://groovy.codehaus.org/GroovyFX"&gt;GroovyFX&lt;/a&gt; (based on JavaFX 2.0)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://www.android.com/"&gt;Android&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The GWT code might still have some issues because i never used GWT. So if you encounter problems with the GWT code, please let me know so that i can fix it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The idea behind the converter is that you could create your graphics in a drawing program like &lt;a href="http://www.adobe.com/de/products/fireworks.html"&gt;Adobe Fireworks&lt;/a&gt; or &lt;a href="http://www.adobe.com/de/products/illustrator.html"&gt;Adobe Illustrator&lt;/a&gt; and export the graphics to an Adobe fxg file. If you drag this file to the fxg converter it will show you a preview of the drawing for example like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-AT9CHrs7Uzg/Tm8z4Dk6ItI/AAAAAAAAAic/hR-bG0BMZK8/s1600/110913-0002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="458" src="http://4.bp.blogspot.com/-AT9CHrs7Uzg/Tm8z4Dk6ItI/AAAAAAAAAic/hR-bG0BMZK8/s640/110913-0002.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now you could select the language/dialect to which the converter should convert the graphics code and press convert.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;During the conversion (which could take some time dependend on the image size) the converter looks like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-u1r9kr56J_U/Tm8z5tilNYI/AAAAAAAAAig/39VlVKkC2co/s1600/110913-0003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="458" src="http://4.bp.blogspot.com/-u1r9kr56J_U/Tm8z5tilNYI/AAAAAAAAAig/39VlVKkC2co/s640/110913-0003.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And after the conversion is finished you will find the file that contains the converted code on your desktop.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Java2D:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The java file is in principle a custom component incl. resizing logic that you directly use in a ui editor like matisse in &lt;a href="http://www.netbeans.org/"&gt;Netbeans&lt;/a&gt;. The Java component uses the converted graphics in the form of java &lt;a href="http://download.oracle.com/javase/6/docs/api/java/awt/image/BufferedImage.html"&gt;BufferedImage&lt;/a&gt; objects. Each layer of the original drawing will be a BufferedImage with the name of the layer. In addition to the java file the converter will also export a file named JavaShadow.java. This file contains methods to create drop- and innershadows and will only be used if you uncomment the lines in the component code.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;JavaFX:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The javafx file is a javafx component that uses the converted graphics in the form of javafx &lt;a href="http://download.oracle.com/javafx/2.0/api/index.html"&gt;Group&lt;/a&gt; objects. Each layer of the original drawing will be a javafx Group object with the name of the layer. In addition to the component file the converter will also export a file that uses the component so that you could directly see how you could implement the new javafx component in your code.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;HTML5 Canvas:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The javascript file contains a canvas component that uses the converted graphics &amp;nbsp;in the form of context objects of &amp;lt;canvas&amp;gt; elements. In addition to the javascript file the converter will also export a html file that uses the canvas component so that you could see how you could implement the canvas component in your html page.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;GWT:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The gwt file contains in principle the same code as the HTML5 Canvas code with just a few differences. You should be able to directly use the created file in your gwt project. Like i said before, if you encounter problems, please let me know.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;UPDATE 1:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Since today (thursday, 15th of september) the FxgConverter2 also supports exports to &lt;a href="http://groovy.codehaus.org/GroovyFX"&gt;GroovyFX&lt;/a&gt; which is in principle a groovier version of the JavaFX code.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;UPDATE 2:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Since friday, 16th of september the FxgConverter2 also supports exports to &lt;a href="http://www.android.com/"&gt;Android&lt;/a&gt; devices. It will create a custom view that contains the image and will be instantiated by an Activity.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;&lt;a href="http://twitter.com/GeertjanW"&gt;Geertjan Wielenga&lt;/a&gt; from the Netbeans team at Oracle is also working on a plugin of the converter. Check out his progress &lt;a href="http://blogs.oracle.com/geertjan/entry/from_adobe_fxg_to_java"&gt;here...&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You could find the new &lt;a href="http://idisk.mac.com/han.solo-Public/FxgConverter2/fxgconverter2.jnlp"&gt;FXG Converter 2&lt;/a&gt; here on this blog on the right side...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Please keep in mind that the new converter only supports FXG 2.0 (it will also convert FXG 1.0 but you'll find problems with gradients).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's it for today...so keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-5270485497730131505?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/5270485497730131505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/09/fxgconverter-20.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5270485497730131505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5270485497730131505'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/09/fxgconverter-20.html' title='FxgConverter 2.0'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-OqmLUPdzJOk/Tm8z3-KxfNI/AAAAAAAAAiY/YrusxvFHTyQ/s72-c/110913-0001.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-8516054404495312094</id><published>2011-09-07T11:57:00.000+02:00</published><updated>2011-11-10T20:30:47.362+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.9.6</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Glow with the flow...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Finally i was able to finish another release of the SteelSeries component library and again there's lot's of new stuff in here.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;First of all i have made many many many changes in the code where i did not add features but only replace all full classified class descriptions by their related import statements. That tooks a lot of time and i'm sure that there are still some in there.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In addition i have also changed the placments of the braces to more common format that the open braces are placed on the same row and not in a new one. But that's only for those of you who read the code...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In addition i moved from trident animation library 6.2 to version 6.3 that you could get &lt;a href="http://shemnon.com/speling/2011/07/insubstantial-63-release.html"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;No 3.9.4 and 3.9.5 release ?&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You might ask yourself where are the 3.9.4 and 3.9.5 releases? Well the 3.9.4 was ready to go and when i took all the screenshot for this post i figured out that i missed something that i would like to add to this release so i added the feature (which was really small) and created another release which was 3.9.5. But that's not enough, again two bugs appear in the last minute and so it came finally to 3.9.6&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So let's start with the news...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;NO NO_FRAME:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I removed the FrameDesign NO_FRAME from the library because it was not really needed anymore. One should use setFrameVisible(false) instead.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;NEW LCD COLORS:&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-2Mec8OKrNmU/TmSGjzMl7LI/AAAAAAAAAh8/1MzYGVXcYM0/s1600/NewLcdColors.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-2Mec8OKrNmU/TmSGjzMl7LI/AAAAAAAAAh8/1MzYGVXcYM0/s1600/NewLcdColors.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On the image you could see the new LcdColors in 3.9.6 which are named DARKBLUE_LCD, LILA_LCD, BLACKRED_LCD and DARKGREEN_LCD.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because i gave some love to the DisplaySingle component i have more to show here...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LCD THRESHOLD INDICATOR:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-IWDiJubZaiI/TmSGjGwKrYI/AAAAAAAAAh0/uNCE9xl21jc/s1600/LcdThresholdIndicator.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-IWDiJubZaiI/TmSGjGwKrYI/AAAAAAAAAh0/uNCE9xl21jc/s1600/LcdThresholdIndicator.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;All components that contain an LCD now supports the minValue, maxValue and threshold property. And if the current value exceeds the maxValue, a little indicator on the lower left corner of the lcd display will appear and visualize that the current value is out of range.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;During a talk with my future colleagues i figured out that it might make sense to use an lcd itself to indicate the current value. In a gauge i could display sections but in an lcd what could i change to visualize the current value ???&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Right the complete color of the lcd...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LCD SECTIONS:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-pGLbHgqVWmU/TmSGis_pHKI/AAAAAAAAAhw/DJZkzzolxQo/s1600/LcdSections.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-pGLbHgqVWmU/TmSGis_pHKI/AAAAAAAAAhw/DJZkzzolxQo/s320/LcdSections.png" width="250" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This means one could define now an array of Section objects and pass it to the DisplaySingle component. If the current value is in the range of a section the complete display will change it's color related to the color that is defined in the active section. Please keep in mind that this feature works best on the LcdColors BLUE2 (image above), GREEN etc. which means all monocolored LcdColors (without a glass reflection effect).&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another nice feature of the DisplaySingle that is new in this release is the QualityOverlay feature. In principle it's similar to the Sections feature that i mentioned before but in this case i use some kind of a progressbar to visualize the quality of the current value. But let's have a look...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LCD QUALITY OVERLAY:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-rGJFLtzinEY/TmSGiLRxuvI/AAAAAAAAAhs/phHI_EWarXU/s1600/LcdQuality.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-rGJFLtzinEY/TmSGiLRxuvI/AAAAAAAAAhs/phHI_EWarXU/s1600/LcdQuality.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You could imagine that this feature is only useful in special usecases but if you need it it's now available... :-)&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;When i was in Basel at &lt;a href="http://www.canoo.com/"&gt;Canoo&lt;/a&gt;, &lt;a href="http://twitter.com/mittie"&gt;Dierk König&lt;/a&gt; mentioned that the threshold led might be to small to be recognized when not in front of the monitor and we discussed ideas on how to improve...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;GLOW:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-63HZ3KQh5D0/TmSGg2uxT7I/AAAAAAAAAhc/Hdwl0kEZUfs/s1600/GaugeGlowOff.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-63HZ3KQh5D0/TmSGg2uxT7I/AAAAAAAAAhc/Hdwl0kEZUfs/s1600/GaugeGlowOff.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you take a closer look at the gauges above you will figure out that there is an additional frame on the inside of the gauges. This frame could be made visible by using setGlowVisible(true). And if you use setGlowing(true), it will use the current glowcolor and visualize it like this...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-wXKgJTtOWMA/TmSGhDpnplI/AAAAAAAAAhg/mTsI63QuneE/s1600/GaugeGlowOn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-wXKgJTtOWMA/TmSGhDpnplI/AAAAAAAAAhg/mTsI63QuneE/s1600/GaugeGlowOn.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This might be useful to visualize a certain value or threshold or whatever...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;By the way...to come back to the LCD one more time...it supports the glow too... :-)&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-d5VDSEaB6Hs/TmSGh3MSL_I/AAAAAAAAAho/OnfLkovFEj4/s1600/LcdGlow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-d5VDSEaB6Hs/TmSGh3MSL_I/AAAAAAAAAho/OnfLkovFEj4/s1600/LcdGlow.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On the radial gauges you will find a new PointerType which is TYPE10. This type of pointer was created to be used on very small gauges, where the standard pointers are simply too small, so it looks like this...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;POINTER TYPE 10:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-TNv42ysPjtQ/TmSGkjh80qI/AAAAAAAAAiE/aPUXwtOUbo8/s1600/PointerType10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-TNv42ysPjtQ/TmSGkjh80qI/AAAAAAAAAiE/aPUXwtOUbo8/s1600/PointerType10.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On the image above you could see the new pointer type and to show you the difference i created a small gauge with the new and with a standard pointer.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well the next new things are related to the BackgroundColor of the gauges and i have to say that the first of the following new BackgroundColors does not really fit to a gauge but someone asked for it and here we go...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LINEN BACKGROUND:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-rhg7Hc0oRag/TmSGjXZP31I/AAAAAAAAAh4/tbQRnIaqJ2E/s1600/Linen.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-rhg7Hc0oRag/TmSGjXZP31I/AAAAAAAAAh4/tbQRnIaqJ2E/s1600/Linen.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;NOISY_PLASTIC BACKGROUND:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-7BWSbrLZzM0/TmSGkVUUKaI/AAAAAAAAAiA/MgBmuLnkMT4/s1600/NoisyPlastic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-7BWSbrLZzM0/TmSGkVUUKaI/AAAAAAAAAiA/MgBmuLnkMT4/s1600/NoisyPlastic.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The idea for the NOISY_PLASTIC came from &lt;a href="http://twitter.com/wzberger"&gt;Wolfgang Zitzelsberger&lt;/a&gt; of &lt;a href="http://www.jyloo.com/"&gt;Jyloo Software&lt;/a&gt; (creator of the &lt;a href="http://www.jyloo.com/synthetica/themes/"&gt;Synthetica LAF&lt;/a&gt;) and i saw it on their blog. I tried to get mine as good as theirs but i think their texture looks still better.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you can see you could define the color of the texture and this is another new feature in this release, called TextureColor. The TextureColor is a standard Color that could be set and will be used to colorize the LINEN, BRUSHED_METAL and PUNCHED_SHEET texture.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here are some examples of BRUSHED_METAL...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-A7snRHJF-To/TmSGlJIWesI/AAAAAAAAAiI/S_1TwpdlEhg/s1600/TextureColorBrushedMetal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-A7snRHJF-To/TmSGlJIWesI/AAAAAAAAAiI/S_1TwpdlEhg/s1600/TextureColorBrushedMetal.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;and PUNCHED_SHEET:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-byvvsbmNT6g/TmSGlrv-weI/AAAAAAAAAiM/TGU0IzxHEE8/s1600/TextureColorPunchedSheet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-byvvsbmNT6g/TmSGlrv-weI/AAAAAAAAAiM/TGU0IzxHEE8/s1600/TextureColorPunchedSheet.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well with the PUNCHED_SHEET texture it's a little bit different because in the current version of the library the texture will be created in an enum and will be used on every gauge. This means changing the texture color e.g. to red will change the texture in all gauges that are using the PUNCHED_SHEET texture.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The next thing that is available now is an additional LED which could be configured by the user, so it's called userLed. This LED will not be used by the library so you could set it visible, set on or off and let it blink. Of course one could define the color of the userLed.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;USER_LED:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-s-Z4PEQkEbw/TmSGmKIuNsI/AAAAAAAAAiQ/ZZJlmhJY1c0/s1600/UserLed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="331" src="http://4.bp.blogspot.com/-s-Z4PEQkEbw/TmSGmKIuNsI/AAAAAAAAAiQ/ZZJlmhJY1c0/s640/UserLed.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So if you are in the need to have an additional indicator for whatever value, you could now use the userLed feature to visualize it.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another new thing is the highlighting of Sections and Areas in the gauges. This means if the pointer is over a section/area that contains the current gauge value, the section/area will be highlighted.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;HIGHLIGHT SECTIONS / AREAS:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-FI1mVH6yMFQ/TmSGhvUfaQI/AAAAAAAAAhk/C51wI1KOPck/s1600/HighlightSectionsAreas.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="446" src="http://1.bp.blogspot.com/-FI1mVH6yMFQ/TmSGhvUfaQI/AAAAAAAAAhk/C51wI1KOPck/s640/HighlightSectionsAreas.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the left column on the above image you see the behaviour that you might know already, it simply shows the sections/areas that you have defined.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the middle column you see that the green section/area is brighter than the other sections/areas because i switched on the hightlightSection/highlightArea feature of the gauges.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;There is also the possibility to show only the highlighted section/area which you could see on the right column. To achieve this behaviour you just have to call setSectionsVisible(false) and setHighlightSections(true). The same will work for the areas too.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now we are coming to an end...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;DESIGN SETS:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The last new feature is the possibility to define so called DesignSets (2 for each gauge) and toggle between those DesignSets. So you might ask yourself for what this might be useful and here is the answer to it...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you use a dashboard with gauges on a notebook to visualize data and you have to use the notebook outside you will define the colors of the gauges in the way that it is good readable. If you now go back inside a dark house the colors of the gauges might not fit anymore to the new surrounding brightness.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Or if you would like to use the dashboard by day and night you might need different colors for your gauges.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;For reasons like that i have added the DesignSet which mainly contains the colors/designs of the frame, background, pointer, knobs, lcd and led. You could either toggle between design1 and design2 or you could call setActiveDesign() with the gauge and the design you would like to set.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here is the code to define a DesignSet:&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;pre class="java" name="code"&gt;DesignSet night = &lt;br /&gt;            new DesignSet.Builder().frameDesign(FrameDesign.BLACK_METAL)&lt;br /&gt;                                   .backgroundColor(BackgroundColor.BLACK)&lt;br /&gt;                                   .lcdColor(LcdColor.BLACK_LCD)&lt;br /&gt;                                   .knobStyle(KnobStyle.BLACK)&lt;br /&gt;                                   .color(ColorDef.RED)&lt;br /&gt;                                   .build();&lt;br /&gt;DesignSet day = &lt;br /&gt;            new DesignSet.Builder().frameDesign(FrameDesign.SHINY_METAL)&lt;br /&gt;                                   .backgroundColor(BackgroundColor.WHITE)&lt;br /&gt;                                   .lcdColor(LcdColor.STANDARD_GREEN_LCD)&lt;br /&gt;                                   .knobStyle(KnobStyle.SILVER)&lt;br /&gt;                                   .color(ColorDef.BLUE)&lt;br /&gt;                                   .ledColor(LedColor.BLUE)&lt;br /&gt;                                   .build();&lt;br /&gt;        &lt;br /&gt;radial1.setDesign1(day);&lt;br /&gt;radial1.setDesign2(night);&lt;br /&gt;radial1.setActiveDesign(radial1, night);&lt;br /&gt;        &lt;br /&gt;radial2.setDesign1(day);&lt;br /&gt;radial2.setDesign2(night);&lt;br /&gt;radial2.setActiveDesign(radial2, day);&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I used the builder pattern to create the DesignSet so you can decide which kind of parameters you would like to store in your DesignSet.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And that's would it would look like...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-B2ozmG-IB30/TmSGfx-c3ZI/AAAAAAAAAhU/3Y0M6xvbAY4/s1600/DesignSets.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-B2ozmG-IB30/TmSGfx-c3ZI/AAAAAAAAAhU/3Y0M6xvbAY4/s1600/DesignSets.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well that's it for 3.9.6, so i hope you find one or two useful new things for you in this release, which is available as &lt;a href="http://idisk.mac.com/han.solo-Public/SteelSeries3/SteelSeries-3.9.6.jar"&gt;binary&lt;/a&gt; here on the page or you could get the source from &lt;a href="http://kenai.com/projects/steelseries"&gt;project Kenai&lt;/a&gt;. You also find the SteelSeries lib on &lt;a href="http://search.maven.org/#search%7Cga%7C1%7CSteelSeries"&gt;Maven Central&lt;/a&gt;, if you search for "SteelSeries"&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-8516054404495312094?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/8516054404495312094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/09/steelseries-396.html#comment-form' title='19 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8516054404495312094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8516054404495312094'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/09/steelseries-396.html' title='SteelSeries 3.9.6'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-2Mec8OKrNmU/TmSGjzMl7LI/AAAAAAAAAh8/1MzYGVXcYM0/s72-c/NewLcdColors.png' height='72' width='72'/><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-7785267002535333525</id><published>2011-09-02T19:15:00.001+02:00</published><updated>2011-11-10T20:30:47.363+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fxgconverter'/><category scheme='http://www.blogger.com/atom/ns#' term='javafx'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Groovy graphics...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I know i know...it's nearly a month ago the last time i blogged about something but i just can tell you i have learned a lot in the last month...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Those of you who follow me on twitter know it already i started playing with Groovy and the only thing i can say about it is ... IT REALLY ROCKS !!!&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It might not be the one and only solution for everything but it makes you so much more productive, it's amazing.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Thanx to &lt;a href="http://twitter.com/mittie"&gt;Dierk König&lt;/a&gt; and &lt;a href="http://twitter.com/aalmiray"&gt;Andres Almiray&lt;/a&gt; who motivated me to choose the groovy way of life.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Two weeks ago i was at &lt;a href="http://www.canoo.com/"&gt;Canoo&lt;/a&gt;&amp;nbsp;(which is btw a really really nice company) again in Basel (CH) and during the two days of my visit Dierk came up with the idea of using an &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/FXG+2.0+Specification"&gt;Adobe fxg&lt;/a&gt; file as resource for the design of a component. This means you have to parse the file in process instead of preprocessing the file. This idea lights my fire and i started looking into Groovy to create a new fxg parser.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well Groovy and XML really is a dreamteam, so creating the parser was really not a big deal. After the parser was finished i started looking into a so called translator which translates the converted fxg data into different languages. First of all i started with &lt;a href="http://java.sun.com/products/java-media/2D/index.jsp"&gt;Java2D&lt;/a&gt; which was easy, after it was ready to go &lt;a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html"&gt;HTML5 Canvas&lt;/a&gt;, &lt;a href="http://code.google.com/intl/de-DE/webtoolkit/"&gt;GWT&lt;/a&gt; followed.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So now the new Parser-Translator duo is able to convert Adobe fxg files into files for all those languages. It's not completely finished because i have to come around the 64kb barrier for methods/classes in Java but i'll fix this asap and will use the new converter to replace the current one.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;A few days ago &lt;a href="http://twitter.com/deanriverson"&gt;Dean Iverson&lt;/a&gt; asked me if it would be possible to create also JavaFX 2.0 output and so i started looking into this. Yesterday i finished the export to JavaFX 2.0 and was really happy about it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So excited that i could not sleep which let leave the bed around 4:30 AM to get my ideas into code.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The idea came from &lt;a href="http://pleasingsoftware.blogspot.com/"&gt;Dean Iverson&lt;/a&gt; and was about creating a JavaFX 2.0 component on the fly using an Adobe fxg file so a similar idea like the one from Dierk König. First of all i was not sure if i could easily realize but this morning i knew i could and so i started coding.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The result is 450 lines of Groovy code that makes it possible to parse a fxg file live and return JavaFX Groups for each layer of the fxg file.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here is a little screenshot of a JavaFX component using a fxg file on the fly:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-slJN1UPupog/TmEHTyEsh1I/AAAAAAAAAhM/nWBq5HTjI7c/s1600/110902-0003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-slJN1UPupog/TmEHTyEsh1I/AAAAAAAAAhM/nWBq5HTjI7c/s1600/110902-0003.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And all you need to realize this is the following piece of JavaFX code...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="java" name="code"&gt;public class FxgTest extends Application&lt;br /&gt;{&lt;br /&gt;    @Override&lt;br /&gt;    public void start(Stage stage) {&lt;br /&gt;        Test component = new Test(400, 400);&lt;br /&gt;        Scene scene = new Scene(component, 400, 400);&lt;br /&gt;        stage.setTitle("FXG -&amp;gt; JavaFX (live)");&lt;br /&gt;        stage.setScene(scene);&lt;br /&gt;        stage.show();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public class Test extends Parent {&lt;br /&gt;        public Test(int width, int height) {&lt;br /&gt;            String fxgFile = "/FILE.FXG";&lt;br /&gt;            FxgFxParser parser = new FxgFxParser();&lt;br /&gt;            Map&lt;string, group=""&gt; groups = parser.parse(fxgFile, width, height, true);&lt;br /&gt;            getChildren().addAll(groups.values());&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        Application.launch(args);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;If you now start the application, it will load the given fxg file, parse and convert it and display it on the stage.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;If you would like to play with this stuff you need to have the &lt;a href="http://javafx.com/downloads/all.jsp"&gt;JavaFX 2.0 beta&lt;/a&gt; installed otherwise it won't run.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;If you are on a Mac you need to be a member of the &lt;a href="https://java-partner.sun.com/"&gt;Java Partner Program of Oracle&lt;/a&gt; to get the Mac version of the JavaFX 2.0 beta.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;You will also need &lt;a href="http://groovy.codehaus.org/Download"&gt;Groovy 1.8&lt;/a&gt; installed to play with the code but you could easily download it at &lt;a href="http://groovy.codehaus.org/"&gt;Codehaus&lt;/a&gt; and install it without a problem.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;The code itself is hosted at github and could be found here:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;a href="git://github.com/HanSolo/FxgFXParser.git"&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;git://github.com/HanSolo/FxgFXParser.git&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;Well it's not the biggest blogpost but i'm really excited about it and so it was worth the time to write it...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;The SteelSeries 3.9.4 is also nearly finished and will be released soon...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;At the moment i'm writing this Dean wrote me that FXG files exported by Adobe Illustrator do not convert nicely so i'm on that now and will hopefully fix it soon.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;FXG Files exported by Adobe Fireworks should be fine (don't ask me why they export different kind of FXG dialect)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;Keep coding and enjoy the upcoming weekend,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"&gt;Gerrit&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-7785267002535333525?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/7785267002535333525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/09/groovy-graphics.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7785267002535333525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7785267002535333525'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/09/groovy-graphics.html' title='Groovy graphics...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-slJN1UPupog/TmEHTyEsh1I/AAAAAAAAAhM/nWBq5HTjI7c/s72-c/110902-0003.png' height='72' width='72'/><thr:total>7</thr:total><georss:featurename>Münster, Germany</georss:featurename><georss:point>51.964711 7.628496</georss:point><georss:box>51.651646 6.9967820000000005 52.277776 8.26021</georss:box></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-7817094073072790622</id><published>2011-08-05T06:33:00.001+02:00</published><updated>2011-11-10T20:32:13.491+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><title type='text'>Friday Fun Component X</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Flip it baby...&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;A year ago i created a &lt;a href="http://www.youtube.com/watch?v=Obinsku3pVo"&gt;departure board component&lt;/a&gt; in Swing when i came back from Paris where i saw the &lt;a href="http://en.wikipedia.org/wiki/File:Gare_du_Nord_Fallblattanzeiger_Departure-board.JPG"&gt;original departure board&lt;/a&gt; at Gare du Nord trainstation.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the meantime many people asked me for that component but i never had the time to recreate it so that one could use it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because it was still on my list i decided to create a scalable version of the flip-char as a single component that you could use to create whatever component you need with it. As an example i added a simple FlipCharPanel which contains 16 characters so that you get an idea of how to use the single FlipChar component.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The flipping effect is a simple fake because i simply created nine images that i'll play each time a character is flipping to the next character.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I splitted the character itself in two pieces and display the top part directly and the bottom part when the nine images have be drawn. Because these panels flip at really high speed it was no really needed to really created transformed images of each "flipping phase" which would make the whole thing really slow. Especialy with lots of characters flipping at the same time the effect is good enough to give you the impression of flipping characters.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the Netbeans project file you will also find a BackgroundPanel that fit's to the colors of the FlipChar and could be used for something like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ywGlunsAKQo/TjaUbS_4Z1I/AAAAAAAAAgo/6LR9mfTlIzo/s1600/110801-0001.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="104" src="http://3.bp.blogspot.com/-ywGlunsAKQo/TjaUbS_4Z1I/AAAAAAAAAgo/6LR9mfTlIzo/s640/110801-0001.png" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/FlipChar/flipchar.jnlp"&gt;Click here to see it in action...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you could see this is the same panel as the webstart demo but with a different background.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Each of the FlipChar components is scalable so that you could create smaller or bigger displays too.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;video controls="" height="360" preload="" width="424"&gt;&lt;br /&gt;&lt;source src="http://idisk.mac.com/han.solo-Public/videos/FlipChar.mp4" type="video/mp4; codecs=&amp;quot;avc1.42E01E, mp4a.40.2&amp;quot;"&gt;&lt;/source&gt;&lt;br /&gt;&lt;source src="http://idisk.mac.com/han.solo-Public/videos/FlipChar.webm" type="video/webm; codecs=&amp;quot;vp8, vorbis&amp;quot;"&gt;&lt;/source&gt;&lt;br /&gt;&lt;source src="http://idisk.mac.com/han.solo-Public/videos/FlipChar.theora.ogv" type="video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;"&gt;&lt;/source&gt;&lt;br /&gt;&lt;/video&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You could also change the color of the characters by using the setFontColor() method of the FlipChar component. All FlipChar components will be registered to a GlobalTimer that you have to start after you have initialized your component.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To save memory the so called FlipImages will be created only once for each size and will be shared through a enum. This leads to problems if you would like to use FlipChar components of different size in one application because the flip images will be created only for one size. If you need this functionality you have to add the flip images to the FlipChar component itself but this would create the images for each FlipChar component...so it's your decision.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Binary and Source&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Binary version of the flipchar component: &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/FlipChar/FlipChar.jar"&gt;FlipChar.jar&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://www.netbeans.org/"&gt;Netbeans&lt;/a&gt; project: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href="http://idisk.mac.com/han.solo-Public/FlipChar/FlipChar.zip"&gt;FlipChar.zip&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's all for today so keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-7817094073072790622?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/7817094073072790622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/08/friday-fun-component-x.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7817094073072790622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7817094073072790622'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/08/friday-fun-component-x.html' title='Friday Fun Component X'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-ywGlunsAKQo/TjaUbS_4Z1I/AAAAAAAAAgo/6LR9mfTlIzo/s72-c/110801-0001.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-7162700756736455577</id><published>2011-07-28T09:38:00.002+02:00</published><updated>2011-07-28T09:42:51.776+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><title type='text'>HTML5...the web strikes back...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Last week i was in Berlin at &lt;a href="http://blog.gameduell.net/"&gt;GameDuell&lt;/a&gt;, where i gave a little talk about HTML5 and some of it's features. Because &lt;a href="http://dev.w3.org/html5/spec/Overview.html"&gt;HTML5&lt;/a&gt; has so many nice features i had to focus on some of them. I have added links to the presentation and the demo at the end of this post. Because i do not have much time this post will be about a combination of three HTML5 features...&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Offline&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;WebSocket&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Canvas&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I created a little website that only contains one of the steelseries gauges and a textfield...so nothing special...but the trick here is that i add a HTML5 manifest file to the page so that it will be stored locally on the machine once you opened it. This means the page will also be available if there's no internet access.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's really amazing because you could define which parts of your page should be available offline/cached (incl. scripts and css of course).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The manifest file of my demo page was really simple and looked like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; CACHE MANIFEST&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: #38761d;"&gt;# rev 5&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; /demo/canvas.html&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; /demo/js/steelseries-min.js&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; /demo/js/tween-min.js&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Important to know is that the manifest file has to start with the words "CACHE MANIFEST" and if you would like to refresh the cache you have to modify the manifest file. Because it's versioned by it's bytes you could also add a simple comment (like i did "&lt;span class="Apple-style-span" style="color: #38761d;"&gt;# rev 5&lt;/span&gt;") and change the comment which leads to a refresh of the cached parts of your page.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Ok, that's easy but why did i create this page...?&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To explain this i need to explain the whole idea of the demo first. So i would like to be able to demonstrate a websocket connection and i would like to use the gauges of my steelseries library. So the library was meant to be used to visualize sensor data...so i only need a sensor right...?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Why not use the sensors of my htc desire smartphone and use the gauge to visualize it...?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To make this possible i need to put the computer with the browser (where the gauge is running) in the same network as the Android cellphone which is possible using an adhoc network.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So these are the steps i need for the setup of the demo:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Create a AdHoc network on my Macbook Pro&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Connect the HTC Desire to the AdHoc network&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Start a node.js server on the Macbook Pro that listens on the UDP port where the data will come in and forward the data via websocket&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Start a Kaazing Gateway that makes it possible to forward the websocket to specified addresses&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After this setup is running i could start the software on the HTC Desire that sends the sensor data of the orientation sensor via udp to the IP address of the Macbook Pro and because they are in the same network, the node.js instance will receive the udp packages and forward them to a websocket that will be made available to localhost and another ip address by the Kaazing Gateway.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now the real fun part of the demo was that i could add more computers to the AdHoc network of the Macbook Pro and visualize the sensor data of the cellphone on them too.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you could follow so far you might now know why i had to cache the website with the gauge...yes...because in the moment i connect the other computers to the AdHoc network of the Macbook Pro they won't be able to load the page from the internet anymore...but from their cache they could... :-)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I created a little video to give you an idea of the functionality...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;video controls="" height="360" preload="" width="576"&gt;&lt;br /&gt;&lt;source src="http://idisk.mac.com/han.solo-Public/videos/Demo.mp4" type="video/mp4; codecs=&amp;quot;avc1.42E01E, mp4a.40.2&amp;quot;"&gt;&lt;/source&gt;&lt;br /&gt;&lt;source src="http://idisk.mac.com/han.solo-Public/videos/Demo.webm" type="video/webm; codecs=&amp;quot;vp8, vorbis&amp;quot;"&gt;&lt;/source&gt;&lt;br /&gt;&lt;source src="http://idisk.mac.com/han.solo-Public/videos/Demo.theora.ogv" type="video/ogg; codecs=&amp;quot;theora, vorbis&amp;quot;"&gt;&lt;/source&gt;&lt;br /&gt;&lt;/video&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It's not the very best video but i was not sure how to give you an impression about the setup. So on the video you will see the following devices...&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Macbook Pro (running &lt;a href="http://nodejs.org/"&gt;node.js&lt;/a&gt;, &lt;a href="http://www.kaazing.com/"&gt;Kaazing Gateway&lt;/a&gt; and &lt;a href="http://www.google.com/chrome/intl/de/landing_mac.html?hl=de"&gt;Chrome&lt;/a&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;iPad2 (running the demo on Safari mobile)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Win7 Netbook (running the demo on &lt;a href="http://www.google.com/chrome/intl/de/landing_mac.html?hl=de"&gt;Chrome&lt;/a&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;G5 Powermac (running the demo on &lt;a href="http://www.apple.com/de/safari/"&gt;Safari&lt;/a&gt;)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;All devices running the same canvas.html website that was cached on the devices before i connected them to the AdHoc network of the Macbook Pro.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you ask yourself how you could connect &lt;a href="http://nodejs.org/"&gt;node.js&lt;/a&gt; to udp and forward the websocket via &lt;a href="http://www.kaazing.com/"&gt;Kaazing Gateway&lt;/a&gt; i would strongly recommend to take a look at the blog of Matthias Wessendorfs blog (twitter: &lt;a href="http://twitter.com/@mwessendorf"&gt;@mwessendorf&lt;/a&gt;), where he described how get this up and running.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The presentation was splitted into two parts, a pdf and a html5 page. Please find the links to the documents here...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/Presentations/TheWebStrikesBack/TheWebStrikesBack.pdf"&gt;PDF presentation&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/Presentations/TheWebStrikesBack/html-slideshow/main/slideshow.html"&gt;HTML5 presentation&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Please keep that the WebSocket part of the html5 presentation won't work without the setup i described above. For the DeviceOrienation part i recommend a Macbook (Pro) in combination with Chrome to see something in motion.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In addition i have to mention that the webworker part will work best in Firefox5, in Chrome it seems to have problems (don't ask me why).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's it so far for today...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-7162700756736455577?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/7162700756736455577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/07/html5the-web-strikes-back.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7162700756736455577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/7162700756736455577'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/07/html5the-web-strikes-back.html' title='HTML5...the web strikes back...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-8327694444458064288</id><published>2011-07-22T17:01:00.000+02:00</published><updated>2011-11-10T20:32:13.491+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><title type='text'>Friday Fun Component IX</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Time for some progress...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I know it's a long time ago since i wrote the last blogpost but i really was busy the last weeks. Also today i do not have much time to create this little blogpost but you know it's friday and so it's time for some fun again...yay&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I remembered a little app that i wrote nearly 3 years ago where i implemented some kind of an animated progress bar and so i decided to extract this component from the app and share it with you.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It's not derived from JProgressBar but from JComponent and is really only a bar that could be used as a progressbar. Here's a little screenshot and webstart demo to give you an impression about the component...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-XWn2Sq3LoeE/TimPJvsOgOI/AAAAAAAAAgk/Sc8898ID0HY/s1600/%255B2011-07-22045416%255D++Animated+Progress-Animated+Progress.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-XWn2Sq3LoeE/TimPJvsOgOI/AAAAAAAAAgk/Sc8898ID0HY/s1600/%255B2011-07-22045416%255D++Animated+Progress-Animated+Progress.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/animatedprogress/animatedProgress.jnlp"&gt;Click here to see it live...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It's really not a big deal but it was fun to create it and so it's worth to share it with you. You could adjust parameters like...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;the colors of the bar&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;the color of the value/percentage text&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;the color of the fading infinite text&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;if it has rounded corners and the corner radius&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;the value and a max value&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Like i said the component is a little bit older and might not be optimized but as always you will get the source and you might want to optimize it (if you have the time)...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So here we go:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/animatedprogress/AnimatedProgress.jar"&gt;AnimatedProgress.jar&lt;/a&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(the component as binary)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/animatedprogress/AnimatedProgress.zip"&gt;AnimatedProgress.zip&lt;/a&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(the source as a Netbeans project)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you can see i'm a little bit in a hurry so enjoy the upcoming weekend and keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-8327694444458064288?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/8327694444458064288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/07/friday-fun-component-ix.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8327694444458064288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8327694444458064288'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/07/friday-fun-component-ix.html' title='Friday Fun Component IX'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-XWn2Sq3LoeE/TimPJvsOgOI/AAAAAAAAAgk/Sc8898ID0HY/s72-c/%255B2011-07-22045416%255D++Animated+Progress-Animated+Progress.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-3098586262208434537</id><published>2011-06-30T23:42:00.000+02:00</published><updated>2011-06-30T23:42:37.560+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><title type='text'>HTML5 Canvas update...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This is just a really short post to let you know about the modifications i made to the javascript version of the steelseries library.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Thanx to Mark Crossley who pushed me to add more features from the java version of the lib the current version of the javascript lib contains the following gauges.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Radials and RadialBargraphs...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-lSJpkjALqhU/TgzqorZFzTI/AAAAAAAAAfQ/aYmyVqbrdUE/s1600/ishot-5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="324" src="http://1.bp.blogspot.com/-lSJpkjALqhU/TgzqorZFzTI/AAAAAAAAAfQ/aYmyVqbrdUE/s640/ishot-5.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Linears and LinearBargraphs...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-4160jEwz0lw/TgzqSgTZaWI/AAAAAAAAAfI/cLM4wWJ07l8/s1600/ishot-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="374" src="http://3.bp.blogspot.com/-4160jEwz0lw/TgzqSgTZaWI/AAAAAAAAAfI/cLM4wWJ07l8/s640/ishot-3.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;DisplaySingle and DisplayMulti...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Mn0yfzSHLIg/TgzqpP8ARVI/AAAAAAAAAfU/TGGUOPtE054/s1600/ishot-6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="68" src="http://4.bp.blogspot.com/-Mn0yfzSHLIg/TgzqpP8ARVI/AAAAAAAAAfU/TGGUOPtE054/s320/ishot-6.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The Level component...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-TMS5nstdxaM/TgzrKxdBX0I/AAAAAAAAAfY/6Jb9lLWiorw/s1600/ishot-7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-TMS5nstdxaM/TgzrKxdBX0I/AAAAAAAAAfY/6Jb9lLWiorw/s1600/ishot-7.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The compass component...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-aWLG1SzOesE/Tgzra6atonI/AAAAAAAAAfc/a91Rokwit-Q/s1600/ishot-9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-aWLG1SzOesE/Tgzra6atonI/AAAAAAAAAfc/a91Rokwit-Q/s1600/ishot-9.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The horizon component...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-AA8o7ucTGBo/TgzqTFXqCkI/AAAAAAAAAfM/ixWZCRlnMNQ/s1600/ishot-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-AA8o7ucTGBo/TgzqTFXqCkI/AAAAAAAAAfM/ixWZCRlnMNQ/s1600/ishot-4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And last but not least the LED component...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ijPdPoj8yuY/TgzrvymHoHI/AAAAAAAAAfg/LxtK9r9s5uo/s1600/ishot-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-ijPdPoj8yuY/TgzrvymHoHI/AAAAAAAAAfg/LxtK9r9s5uo/s1600/ishot-11.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The following features from the java version are available for the gauges too:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;FrameDesign&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;BackgroundColor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;PointerColor / ValueColor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;PointerType&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;ForegroundType&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;KnobStyle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;KnobType&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Areas&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Sections&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LedColor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LcdColor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;DigitalFont&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And there's more to come...just stay tuned... :-)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You could find the latest version version of the lib always on the upper right part of the sidebar in this blog. At the same position you will find a link to the demo page that i'll update from time to time. Here's a current screenshot, click on the link below the image to start the demo.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-FncQ_qSiZd4/Tgzs-bCXTJI/AAAAAAAAAfk/5wYkcc56cgs/s1600/ishot-12.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-FncQ_qSiZd4/Tgzs-bCXTJI/AAAAAAAAAfk/5wYkcc56cgs/s1600/ishot-12.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/SteelSeries/SteelSeries.html"&gt;Click to see it in action...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Due to some improvements this demo will also work on a mobile like a HTC Desire or iPhone (even if it is a bit slow)...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-3098586262208434537?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/3098586262208434537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/06/html5-canvas-update.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3098586262208434537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3098586262208434537'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/06/html5-canvas-update.html' title='HTML5 Canvas update...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-lSJpkjALqhU/TgzqorZFzTI/AAAAAAAAAfQ/aYmyVqbrdUE/s72-c/ishot-5.png' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-3737982210967012046</id><published>2011-06-14T10:30:00.000+02:00</published><updated>2011-11-10T20:30:47.364+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.9.3</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Hello again...it's time for another release of the SteelSeries Java Swing component library.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Enable / disable nice scaling...&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because somebody asked for it i added the functionality to disable the usage of the automatic tickmark calculation. If you have for example limits of&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;minValue = 0&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;maxValue = 124&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;and you use the automatic tickmark calculation (&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;niceScale=true&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;) the calculation will set the maximum value to 140 instead of 124 to get a nice scaling. There might be usecases where you need to have the scale ends at 124 and for this reason one could now enable/disable the nice scaling by the method &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setNiceScale(boolean)&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; which default's true.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;A picture will better explain what this means...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-RHqmGxeHhnw/TeinTErG-XI/AAAAAAAAAdI/EVVBb777ETI/s1600/NiceScale.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-RHqmGxeHhnw/TeinTErG-XI/AAAAAAAAAdI/EVVBb777ETI/s1600/NiceScale.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On the left gauge the niceScale property is set to true and on the right it is set to false.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;More realistic inner shadow on radial gauges...&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another tiny thing that annoyed me a long time was the inner shadow of the radial gauges. Somehow it looked not the way it should and therefore i modified it a little bit so that it looks better to my eyes now.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-rleNBY9vdLM/TeinTYv0zlI/AAAAAAAAAdM/6a-tPLtnyus/s1600/OLD.png" /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img border="0" src="http://2.bp.blogspot.com/-6bJmOWRjrR4/TeinS8nMS8I/AAAAAAAAAdE/kvVg65OFusE/s1600/NEW.png" /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You might not even noticed the difference but for me it was visible all the time so i had to change it... :-)&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;New backgrounds...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;When i was playing around with the lib i thought i might add more background colors to the gauges and so i've added six new designs...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-2qi7WPKeYM0/TeinQ4YzhfI/AAAAAAAAAco/SDEcjnxueVs/s1600/BackgroundColor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-2qi7WPKeYM0/TeinQ4YzhfI/AAAAAAAAAco/SDEcjnxueVs/s1600/BackgroundColor.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well not all of them might be useful but you never know...so feel free to play around with it. Here i would like to thank &lt;a href="http://twitter.com/wzberger"&gt;Wolfgang Zitzelsberger&lt;/a&gt;&amp;nbsp;of &lt;a href="http://www.jyloo.com/"&gt;Jyloo Software&lt;/a&gt; for the idea with the carbon. And by the way if you don't know him you should know that he's in charge of the Synthetica look and feel which you could find &lt;a href="http://www.jyloo.com/synthetica/"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;StopWatch component...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And i have to say thanx again to Wolfgang because he also asked me for a StopWatch component and here it is...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kTBmulT4H2Y/TeinTinAVSI/AAAAAAAAAdQ/wGCyQvZFRn8/s1600/StopWatch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-kTBmulT4H2Y/TeinTinAVSI/AAAAAAAAAdQ/wGCyQvZFRn8/s1600/StopWatch.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It's nothing special with this stopwatch, just a simple analog stopwatch.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional clock design...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And talking about clocks...there's also a new clock design available in the existing Clock component of the SteelSeries. I while ago i created a Swing component that looked like the clock of the german railway company "Deutsche Bahn". So for those who do not know this clock just click &lt;a href="http://www.google.com/search?q=bahn+uhr&amp;amp;hl=de&amp;amp;prmd=ivns&amp;amp;tbm=isch&amp;amp;tbo=u&amp;amp;source=univ&amp;amp;sa=X&amp;amp;ei=OqvoTaKILcKr-ga3w9D2Dw&amp;amp;ved=0CGYQsAQ&amp;amp;biw=1218&amp;amp;bih=824"&gt;this link&lt;/a&gt; and you will find some images of it. So my version looks like this...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ah_uQqybZAo/TfCwApwK1rI/AAAAAAAAAeA/ukAipPxqT7E/s1600/ishot-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-ah_uQqybZAo/TfCwApwK1rI/AAAAAAAAAeA/ukAipPxqT7E/s1600/ishot-4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You could activate this design by changing the pointerType property in the Clock component to &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;eu.hansolo.steelseries.tools.PointerType.TYPE2&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;. In addition i've added the ability to let the second pointer move continuously by calling &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;secondMovesContinuous(true)&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because it's derived from &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;AbstractRadial&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; you could use all the frameDesigns, backgroundColors, pointerColors (except the SecondPointer which is always red) and foregroundTypes to customize this clock.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional frame designs...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So now that i mentioned frameDesigns it's time to talk about some new frameDesigns too. I have added three new frameDesigns to the lib that are looking like this...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-tbT7UmtLOFE/TeinSGXBRuI/AAAAAAAAAc4/5CWB3gmwWAY/s1600/FrameDesign.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-tbT7UmtLOFE/TeinSGXBRuI/AAAAAAAAAc4/5CWB3gmwWAY/s1600/FrameDesign.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It's again nothing special but i thought you could never have to much designs to choose from. Of course this designs are available for the linear gauges too. Because we are talking about the frames already i extended the effect feature of the frames.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Frame effects...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the former version you only could activate one frameEffect but i found that there too many possibilities that might make sense too, so i added a property named frameEffect and you could choose between four different effects as overlay for your frame, here they are...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-qq__YHmHB1M/TeinSRcDHKI/AAAAAAAAAc8/U-uta1yJat4/s1600/FrameEffect.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-qq__YHmHB1M/TeinSRcDHKI/AAAAAAAAAc8/U-uta1yJat4/s1600/FrameEffect.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;These frameEffects will work on all frameDesigns and on the radial and linear gauges. &lt;strike&gt;They won't work on the Radial2Top and Radial1Square component right now (but i'm working on a new ContourGradientPaint which hopefuly will make it possible to use it on these gauges too)&lt;/strike&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Instead of adding a new ContourGradientPaint class i have added a class to scale convex polygons which makes it possible to apply the frame effects also to the Radial2Top and Radial1Square component.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional foregrounds...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;But not only the backgrounds and frames got something new, i've also added two new foregroundTypes to the radial gauges, check them out...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-o2jSHU1Qapg/TeinRuRHd0I/AAAAAAAAAc0/aq5J2AfZTzU/s1600/ForegroundType.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-o2jSHU1Qapg/TeinRuRHd0I/AAAAAAAAAc0/aq5J2AfZTzU/s1600/ForegroundType.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The left one (TYPE4) has a more unobtrusive look where the right one (TYPE5) stays more present in the foreground.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Number systems in lcd...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So far so good but that was not the end right now...i've got the request if i could add a hexdecimal numberformat to the lcd component and you know i always try to do my best to make your wishes come true, so i added it to the lcd in general which means it's now available in all gauges and in the standalone lcd displays too.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Gx-q2-TSq4k/TeinSgyFp3I/AAAAAAAAAdA/MdxZB7jFkHE/s1600/LcdNumberSystem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="227" src="http://1.bp.blogspot.com/-Gx-q2-TSq4k/TeinSgyFp3I/AAAAAAAAAdA/MdxZB7jFkHE/s640/LcdNumberSystem.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Right now the decimal, hexadecimal and octal number system is supported.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional lcd design...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well there are some color schemes for the lcd but from time to time i find something new to implement and so i added another LcdColor named STANDARD_GREEN which looks like this... &lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-GmODRUISJtg/Tejb_FqcpxI/AAAAAAAAAdU/SIGt2qFgVYE/s1600/LcdColor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-GmODRUISJtg/Tejb_FqcpxI/AAAAAAAAAdU/SIGt2qFgVYE/s1600/LcdColor.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Like all the other things nothing special but it looks nice doesn't it...?&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional pointer type...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And talking about little new things i also want to mention the new pointerType in the radial gauges named TYPE9 that i found on a car...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-SGXiJJVw7O0/Tejb_T62HbI/AAAAAAAAAdY/IOcDRsE_I_o/s1600/PointerType.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-SGXiJJVw7O0/Tejb_T62HbI/AAAAAAAAAdY/IOcDRsE_I_o/s1600/PointerType.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This pointerType is a bit special, because it won't change it's color if you set the pointerColor but it will only change the little rectangle at it's end to the given pointerColor which means this pointer is best used on bright backgrounds.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional threshold indicator...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And now the smallest new add on (and it might change in the next release because i'm not 100% satisfied with it), another thresholdType named ARROW which comes in addition to the former thresholdType that is now named TRIANGLE. The color of the threshold indicator could now be modified too.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-r6W6t3TQAko/Tejb_qyVUKI/AAAAAAAAAdc/JsUAStlTJ2w/s1600/ThresholdType.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-r6W6t3TQAko/Tejb_qyVUKI/AAAAAAAAAdc/JsUAStlTJ2w/s1600/ThresholdType.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional center knob...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another tiny thing i've added to the library is a new type of center knob which is available for all radial components. Here's how it looks like...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ulusU7F6hXU/TfCsuySSK9I/AAAAAAAAAd4/gKJdKo4bO7s/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-ulusU7F6hXU/TfCsuySSK9I/AAAAAAAAAd4/gKJdKo4bO7s/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;KnobStyles...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After i finished the new center knob i figured out that it might be a good idea to have knobs with adjustable colors because if you have a brass colored frame the silver center knob won't fit very well to the design. Long story short...here they are... &lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-f3MsSxuksbQ/TfGtsasqyiI/AAAAAAAAAeE/BAAuJfPZhTM/s1600/ishot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-f3MsSxuksbQ/TfGtsasqyiI/AAAAAAAAAeE/BAAuJfPZhTM/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You might have figured out that the standard knob also got a little polish and looks more shiny now. By the way, the MinMax alignment posts do change their color too... :-)&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Additional pointers for the compass...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Oh what's this...how does the compass pointer look like...? Ahh...yes i gave some love to the compass component and added two additional pointer types, so here is an image of the three available types of pointers in the compass component...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-DeJMjwC5RXo/TfCsuWaIFkI/AAAAAAAAAd0/UuOIbBdsZ7E/s1600/ishot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-DeJMjwC5RXo/TfCsuWaIFkI/AAAAAAAAAd0/UuOIbBdsZ7E/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So far so good, now i just have another little modification which might be usefull for one or the other of you...the ability to save an image of a component.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Save component as image...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Each component now has a method named &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;getAsImage()&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; which will return a buffered image of the current state of the component. In addition i've added another helper method to the Util class in the package &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;eu.hansolo.steelseries.tools&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; which will save the given buffered image as a png image with the given name. Here's a small example on how to use it...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="java" name="code"&gt;// the component we would like to save as image is named radial&lt;br /&gt;SwingUtilities.invokeLater(new Runnable() &lt;br /&gt;{&lt;br /&gt;    @Override&lt;br /&gt;    public void run() &lt;br /&gt;    {&lt;br /&gt;        // store the radial component as radial.png&lt;br /&gt;        Util.INSTANCE.savePngImage(radial.getAsImage(), "radial.png");&lt;br /&gt;    }&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;New battery component...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Man that's a long post with lots of pictures again and to give you some eyecandy at the end i've added a battery component to the SteelSeries lib that takes integer values from 0 to 100 and looks like this...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-lERunQihPns/TeinRfLRIYI/AAAAAAAAAcs/RbVDp5zEO0s/s1600/Battery.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="51" src="http://3.bp.blogspot.com/-lERunQihPns/TeinRfLRIYI/AAAAAAAAAcs/RbVDp5zEO0s/s640/Battery.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So...i think it's done for today, i hope some of these modifications will be of use for you and please do me a favour and let me know if you have the need for a special component and i'll see what i can do for you...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-3737982210967012046?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/3737982210967012046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/06/steelseries-393.html#comment-form' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3737982210967012046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3737982210967012046'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/06/steelseries-393.html' title='SteelSeries 3.9.3'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-RHqmGxeHhnw/TeinTErG-XI/AAAAAAAAAdI/EVVBb777ETI/s72-c/NiceScale.png' height='72' width='72'/><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-8367797627585675482</id><published>2011-06-07T10:42:00.000+02:00</published><updated>2011-11-10T20:30:47.364+01:00</updated><title type='text'>Just scale it...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;During my work on the SteelSeries library i faced a lot of different problems when i tried to convert the graphical design from the drawing program into the code. One of the problems was related to inner shadows. In the Java2D api there's no method to create an inner shadow for an object but in design inner shadows are really useful to create some kind of realism.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you take a closer look to an inner shadow you will figure out easily that the shadow itself is in principle a scaled version of the object that has a color gradient which fades from shades of black to translucent (as you could see in the next images).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-zaIw4oTif1s/Te3drsMko_I/AAAAAAAAAdw/ahcj5onlX9Q/s1600/tmp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-zaIw4oTif1s/Te3drsMko_I/AAAAAAAAAdw/ahcj5onlX9Q/s1600/tmp.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To keep it simple i used a linear gradient from black to translucent in the examples above which does not correspond to the reality. &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well if you have shapes like circles or rectangles it's not a big deal to create an inner shadow by shrinking the shape arounds it's center and vary the color from shades of black to translucent (for radial shapes you could also use a &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;java.awt.RadialGradientPaint()&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; to achieve the same effect).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This means if you would like to create an effect like an inner shadow it's all about scaling. For standard shapes like ellipses and rectangles it's not a big deal but the real problem will become visible when it comes to polygons because you can't shrink every polygon around it's center (in this case i mean the center of the boundary box) as i'll show you later.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Center of gravity&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You might know the center of gravity (aka &lt;a href="http://en.m.wikipedia.org/wiki/Centroid"&gt;Centroid&lt;/a&gt;) from 3-dimensional objects but in fact you could also calculate the center of gravity for an area. But why do we need to calculate this point ?&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The answer is easy, because you could scale a polygon around it's centroid which means you could create an inner shadow with the same approach that works for circles and rectangles too. To calculate the area of a polygon and it's centroid you could find lot's of information on the web. After i did some math to understand how it works i searched the web for existing stuff to not reinvent the wheel again i found &lt;a href="http://paulbourke.net/geometry/polyarea/"&gt;this page&lt;/a&gt; which explains the principle and will give you some sourcecode too.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now that i had something to start with i created a class that takes a object of the type &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;java.awt.Shape&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;, iterates along the path, calculates the area of the polygon and centroid of the shape. By calculating the area of the polygon you have to keep in mind that negative areas (like "holes" in the polygon) have to be taken into account with a negative sign.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So the next step was the creation of a method that scales the given shape by a given factor. To achieve this i calculate the distance of each point in the polygon and multiply it with the scaling factor. With the usage of some trigonometry i &amp;nbsp;calculated the new scaled position of each point and created a new shape of the type &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;java.awt.geom.GeneralPath&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; from all the calculated points.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After some tests i tried to optimize the methods and figured out that i could use the inbuild &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;java.awt.geom.AffineTransform&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; to achieve the scaling of the shape too.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That means i really only have to calculate the area of the polygon and it's centroid and use the centroid do translate the shape that i scaled with &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;AffineTransform.createTransformedShape(java.awt.Shape shape)&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So now i have a little helper class that will take a shape and a scaling factor as it's argument and that'll return a scaled version of the given shape.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;ATTENTION:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;The placement of the scaling does only work for convex polyons !!!&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Convex polygon:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;A convex polygon is a polygon where every internal angle is less than or equal to 180°. In addition to this every line segment between two vertices remains inside or on the boundary of the polygon.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Concave polygon:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In contrast a concave polygon will always have an interior angle that is greater than 180° (e.g. a L-shaped polygon).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To show you the difference between those two types of polygons i prepared two images. On both images the upper polygon was scaled around it's centroid (visualized by a dot) and the lower polygon was scaled around the center of it's boundary.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Scaling of a convex polygon:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-zrrcRX2HgTA/Te3csD9EsyI/AAAAAAAAAdg/qkiv9AYInNY/s1600/ishot-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-zrrcRX2HgTA/Te3csD9EsyI/AAAAAAAAAdg/qkiv9AYInNY/s1600/ishot-3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Scaling of a concave polygon:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-zFkAbPyVhsI/Te3csoS22qI/AAAAAAAAAdk/k_CLC0squzQ/s1600/ishot-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-zFkAbPyVhsI/Te3csoS22qI/AAAAAAAAAdk/k_CLC0squzQ/s1600/ishot-4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The positioning of the scaled shape is not correct for the concave L-shaped polygon as you can see in the images above. This means if you have to handle this kind of polygons you still have to do some math to calculate and translate it scaled polygon to the right position.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;For those of you who would like to read the code...here you go...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="java" name="code"&gt;public enum Scaler&lt;br /&gt;{&lt;br /&gt;    INSTANCE;&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Returns a double that represents the area of the given point array of a polygon&lt;br /&gt;     * @param POLYGON&lt;br /&gt;     * @param N&lt;br /&gt;     * @return a double that represents the area of the given point array of a polygon&lt;br /&gt;     */&lt;br /&gt;    private double calcSignedPolygonArea(final Point2D[] POLYGON)&lt;br /&gt;    {        &lt;br /&gt;        final int N = POLYGON.length;&lt;br /&gt;        int i;&lt;br /&gt;        int j;&lt;br /&gt;        double area = 0;&lt;br /&gt;&lt;br /&gt;        for (i = 0; i &amp;lt; N; i++)&lt;br /&gt;        {&lt;br /&gt;            j = (i + 1) % N;&lt;br /&gt;            area += POLYGON[i].getX() * POLYGON[j].getY();&lt;br /&gt;            area -= POLYGON[i].getY() * POLYGON[j].getX();&lt;br /&gt;        }&lt;br /&gt;        area /= 2.0;&lt;br /&gt;&lt;br /&gt;        return (area);&lt;br /&gt;        //return(area &amp;lt; 0 ? -area : area); for unsigned&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Returns a Point2D object that represents the center of mass of the given point array which represents a&lt;br /&gt;     * polygon.&lt;br /&gt;     * @param POLYGON&lt;br /&gt;     * @return a Point2D object that represents the center of mass of the given point array&lt;br /&gt;     */&lt;br /&gt;    public Point2D calcCenterOfMass(final Point2D[] POLYGON)&lt;br /&gt;    {&lt;br /&gt;        final int N = POLYGON.length; &lt;br /&gt;        double cx = 0;&lt;br /&gt;        double cy = 0;        &lt;br /&gt;        double area = calcSignedPolygonArea(POLYGON);&lt;br /&gt;        final Point2D CENTROID = new Point2D.Double();&lt;br /&gt;        int i; &lt;br /&gt;        int j;&lt;br /&gt;&lt;br /&gt;        double factor = 0;&lt;br /&gt;        for (i = 0; i &amp;lt; N; i++)&lt;br /&gt;        {&lt;br /&gt;            j = (i + 1) % N;&lt;br /&gt;            factor = (POLYGON[i].getX() * POLYGON[j].getY() - POLYGON[j].getX() * POLYGON[i].getY());&lt;br /&gt;            cx += (POLYGON[i].getX() + POLYGON[j].getX()) * factor;&lt;br /&gt;            cy += (POLYGON[i].getY() + POLYGON[j].getY()) * factor;&lt;br /&gt;        }&lt;br /&gt;        area *= 6.0f;&lt;br /&gt;        factor = 1 / area;&lt;br /&gt;        cx *= factor;&lt;br /&gt;        cy *= factor;&lt;br /&gt;&lt;br /&gt;        CENTROID.setLocation(cx, cy);&lt;br /&gt;        return CENTROID;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Returns a Point2D object that represents the center of mass of the given shape.&lt;br /&gt;     * @param SHAPE&lt;br /&gt;     * @return a Point2D object that represents the center of mass of the given shape&lt;br /&gt;     */&lt;br /&gt;    public Point2D getCentroid(final Shape SHAPE)&lt;br /&gt;    {        &lt;br /&gt;        ArrayList&lt;point2d&gt; pointList = new ArrayList&lt;point2d&gt;(32);&lt;br /&gt;        final PathIterator PATH_ITERATOR = SHAPE.getPathIterator(null);&lt;br /&gt;        int lastMoveToIndex = -1;&lt;br /&gt;        while(!PATH_ITERATOR.isDone())&lt;br /&gt;        {&lt;br /&gt;            final double[] COORDINATES = new double[6];            &lt;br /&gt;            switch (PATH_ITERATOR.currentSegment(COORDINATES))&lt;br /&gt;            {               &lt;br /&gt;                case PathIterator.SEG_MOVETO:&lt;br /&gt;                    pointList.add(new Point2D.Double(COORDINATES[0], COORDINATES[1]));&lt;br /&gt;                    lastMoveToIndex++;&lt;br /&gt;                    break;&lt;br /&gt;                case PathIterator.SEG_LINETO:&lt;br /&gt;                    pointList.add(new Point2D.Double(COORDINATES[0], COORDINATES[1]));&lt;br /&gt;                    break;&lt;br /&gt;                case PathIterator.SEG_QUADTO:&lt;br /&gt;                    pointList.add(new Point2D.Double(COORDINATES[0], COORDINATES[1]));&lt;br /&gt;                    pointList.add(new Point2D.Double(COORDINATES[2], COORDINATES[3]));&lt;br /&gt;                    break;    &lt;br /&gt;                case PathIterator.SEG_CUBICTO:&lt;br /&gt;                    pointList.add(new Point2D.Double(COORDINATES[0], COORDINATES[1]));&lt;br /&gt;                    pointList.add(new Point2D.Double(COORDINATES[2], COORDINATES[3]));&lt;br /&gt;                    pointList.add(new Point2D.Double(COORDINATES[4], COORDINATES[5]));&lt;br /&gt;                    break;&lt;br /&gt;                case PathIterator.SEG_CLOSE:&lt;br /&gt;                    if (lastMoveToIndex &amp;gt;= 0)&lt;br /&gt;                    {&lt;br /&gt;                        pointList.add(pointList.get(lastMoveToIndex));&lt;br /&gt;                    }&lt;br /&gt;                    break;&lt;br /&gt;            }                                   &lt;br /&gt;            PATH_ITERATOR.next();&lt;br /&gt;        }&lt;br /&gt;        final Point2D[] POINT_ARRAY = new Point2D[pointList.size()];&lt;br /&gt;        pointList.toArray(POINT_ARRAY);        &lt;br /&gt;        return (calcCenterOfMass(POINT_ARRAY));&lt;br /&gt;    }&lt;br /&gt;                    &lt;br /&gt;    /**&lt;br /&gt;     * Returns a scaled version of the given shape, calculated by the given scale factor.&lt;br /&gt;     * The scaling will be calculated around the centroid of the shape.&lt;br /&gt;     * @param SHAPE&lt;br /&gt;     * @param SCALE_FACTOR&lt;br /&gt;     * @return a scaled version of the given shape, calculated around the centroid by the given scale factor.&lt;br /&gt;     */&lt;br /&gt;    public Shape scale(final Shape SHAPE, final double SCALE_FACTOR)&lt;br /&gt;    {&lt;br /&gt;        final Point2D CENTROID = getCentroid(SHAPE);&lt;br /&gt;        final AffineTransform TRANSFORM = AffineTransform.getTranslateInstance((1.0 - SCALE_FACTOR) * CENTROID.getX(), (1.0 - SCALE_FACTOR) * CENTROID.getY());&lt;br /&gt;        TRANSFORM.scale(SCALE_FACTOR, SCALE_FACTOR);&lt;br /&gt;        return TRANSFORM.createTransformedShape(SHAPE);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Returns a scaled version of the given shape, calculated by the given scale factor.&lt;br /&gt;     * The scaling will be calculated around the given point.&lt;br /&gt;     * @param SHAPE&lt;br /&gt;     * @param SCALE_FACTOR&lt;br /&gt;     * @param SCALE_CENTER&lt;br /&gt;     * @return a scaled version of the given shape, calculated around the given point with the given scale factor.&lt;br /&gt;     */&lt;br /&gt;    public Shape scale(final Shape SHAPE, final double SCALE_FACTOR, final Point2D SCALE_CENTER)&lt;br /&gt;    {        &lt;br /&gt;        final AffineTransform TRANSFORM = AffineTransform.getTranslateInstance((1.0 - SCALE_FACTOR) * SCALE_CENTER.getX(), (1.0 - SCALE_FACTOR) * SCALE_CENTER.getY());&lt;br /&gt;        TRANSFORM.scale(SCALE_FACTOR, SCALE_FACTOR);&lt;br /&gt;        return TRANSFORM.createTransformedShape(SHAPE);&lt;br /&gt;    }&lt;br /&gt;}&lt;/point2d&gt;&lt;/point2d&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And for the others that would prefer download and use it...that's for you...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/Scaler.java"&gt;Scaler.java&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Fortunately i do not have to handle concave polygons in the SteelSeries library and so t&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;he scaler class will be part of the SteelSeries library too and in the upcoming 3.9.3 release i'll use it to create some effects for the frames.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's it for today...so as always...keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-8367797627585675482?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/8367797627585675482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/06/just-scale-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8367797627585675482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8367797627585675482'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/06/just-scale-it.html' title='Just scale it...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-zaIw4oTif1s/Te3drsMko_I/AAAAAAAAAdw/ahcj5onlX9Q/s72-c/tmp.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-3112951758112167513</id><published>2011-05-31T08:10:00.000+02:00</published><updated>2011-05-31T08:10:00.151+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>Brothers from other mothers...</title><content type='html'>&lt;span style="font-family: Verdana, sans-serif;"&gt;"Write once run anywhere"...everybody remembers these words from Sun to promote the cross-platform functionality of Java. Today, more than 10 years later this is only true in different areas (but i think Java still is the platform which gives you the best cross-platform functionality on the market). Now we have tablet devices like the iPad, Android based devices and WebOS based devices.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;The problem with this devices is that your desktop java application won't run on them. The solution to this problem could be HTML5 Canvas which makes it possible to get the same graphical experience that you knew from Java Swing in your HTML5 capable browser.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;The Canvas 2D api is in fact very similar to the Java 2D api which makes it possible to create nearly the same graphics with it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;So to get the gauges from my steelseries Java library i first thought about porting them to Android and maybe iOS too. After i started porting a gauge to Android i felt that this was the wrong approach because it meant platform dependend code.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;So i took a closer look to HTML5 Canvas and figured out that porting the code to JavaScript was easier than i thought and the idea of a SteelSeries JavaScript edition was born.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;I started porting single gauges to Canvas but did not find the time to combine the components into one lib. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Fortunately i'v found some time last week to get some work done on the library and migrated all available components (which means the radials, the radialbargraphs, the compass and the level component) in the steelseries.js file. In addition i've also added a led component to the lib.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;I'm quite happy with the progress but you should judge by yourself.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Therfore i created two demo's to give you the chance to compare the Java Swing version to the HTML5 Canvas version.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;Attention:&lt;/span&gt; Switching between different designs may take some time on mobile devices because right now i completely reinitialize the complete component (improvements will follow in the near future).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Here's a little screenshot of the website...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-hobc104ijzA/TeDof9YYyqI/AAAAAAAAAck/vngJcEQnBG4/s1600/ishot-4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="412" src="http://3.bp.blogspot.com/-hobc104ijzA/TeDof9YYyqI/AAAAAAAAAck/vngJcEQnBG4/s640/ishot-4.png" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/Demo/Demo.html"&gt;&lt;span style="font-size: small;"&gt;Click me for a live demo...&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;and of the Java Swing version too...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-XSkhm8kWExM/TeDoQNmbELI/AAAAAAAAAcg/x5mJtD-Ru9g/s1600/ishot-3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="358" src="http://1.bp.blogspot.com/-XSkhm8kWExM/TeDoQNmbELI/AAAAAAAAAcg/x5mJtD-Ru9g/s640/ishot-3.png" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/Demo/demo.jnlp"&gt;&lt;span style="font-size: small;"&gt;Click me for a live demo...&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;To start the applications just click on the link below the images.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;So now you have the chance to compare and judge yourself but i'm sure you will agree that HTML5 Canvas gives you the chance to create real cross-platform applications (even if i also have to say that not everything is so easy to port to Canvas...but we are just at the beginning of the new HTML5 era).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Well that's all i have to say for today...so keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-3112951758112167513?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/3112951758112167513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/brothers-from-other-mothers.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3112951758112167513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3112951758112167513'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/brothers-from-other-mothers.html' title='Brothers from other mothers...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-hobc104ijzA/TeDof9YYyqI/AAAAAAAAAck/vngJcEQnBG4/s72-c/ishot-4.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-4389952232496975379</id><published>2011-05-27T12:13:00.018+02:00</published><updated>2011-11-10T20:32:13.492+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><title type='text'>Friday Fun Component VIII</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And it's friday again...yippeah...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This week i was on a trip to a customer in Grenoble (which is by the way a really nice place to be). It was related to my job and i did an installation and training for a customer.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The really best part of that trip was not the installation but my visit at the &lt;a href="http://www.canoo.com/"&gt;Canoo&lt;/a&gt; headquarter in Basel (CH). This company created a real nice product named &lt;a href="http://www.canoo.com/webexperts/products/ulc/"&gt;Canoo RIA Suite&lt;/a&gt; which is based on ULC (UltraLightClient). If you never heard of it you should definitly take a look at it, it's worth the time.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I was there to visit Andres Almiray (&lt;a href="http://www.jroller.com/aalmiray/"&gt;Blog&lt;/a&gt;, &lt;a href="http://twitter.com/aalmiray"&gt;Twitter&lt;/a&gt;) and gave a little presentation (which was a little chaotic because i was not really good prepared). During this presentation i figured out that people are interested in a little application that i wrote nearly 2 years ago for a talk at our local &lt;a href="http://www.jug-muenster.de/"&gt;JUG&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here is a little screenshot of the application...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-_R6-WeG_0t8/Td1PsDwoNyI/AAAAAAAAAcQ/EZwtb-8JIsk/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-_R6-WeG_0t8/Td1PsDwoNyI/AAAAAAAAAcQ/EZwtb-8JIsk/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The application itself should &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;not&lt;/span&gt; demonstrate how to create a good looking user interface but more it should show the possibilities that you have with good old legacy Java Swing. The icing on the cake was the panel with the bubbles on top of the window because i used this panel as a validator for the whole form.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well there's not much to explain...just 2 simple questions...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Do a form always have to look ugly and boring ???&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And do have validators always have to look ugly too ???&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I think you will be smart enough to give yourself the right answer...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After leaving Canoo i thought it might be interesting for others too and decided to split the BubblePanel of the old project and create a little component out of it that you could now download and use for yourself.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;But before i will give you the link to the file i will show you a screenshot of what you will get...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-F7kFE-X4BJI/Td1Pq8TW8CI/AAAAAAAAAcM/HkowARGu4ZM/s1600/ishot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-F7kFE-X4BJI/Td1Pq8TW8CI/AAAAAAAAAcM/HkowARGu4ZM/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And to get an even better impression of it you might want to see it live before you download the source...right...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So here is as a &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/FunValidation/funvalidation.jnlp"&gt;webstart app&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;...and&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;here is the &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/FunValidation/FridayFunVIII.zip"&gt;source&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;...as always a &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://www.netbeans.org/"&gt;Netbeans&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; project. The interesting part of the source is the BubblePanel, which simply extends a JPanel and produces bubbles in the background until you call setValidated(true). That means you could use it as a normal Swing container.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The main idea behind this bubble thing was to find other ways of visualization. In the original app the panel stays just on top of the form and does nothing but producing bubbles until one completes the form. So don't take the bubbles too serious but i hope i opened a door so you just have to make the next step and think different...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's it for today, i hope you got the idea...and as always...keep coding...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-4389952232496975379?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/4389952232496975379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/friday-fun-component-viii.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/4389952232496975379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/4389952232496975379'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/friday-fun-component-viii.html' title='Friday Fun Component VIII'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-_R6-WeG_0t8/Td1PsDwoNyI/AAAAAAAAAcQ/EZwtb-8JIsk/s72-c/ishot-2.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-6969203678904892615</id><published>2011-05-19T23:40:00.001+02:00</published><updated>2011-11-10T20:30:47.365+01:00</updated><title type='text'>Varying gradients...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Just a short post about varying gradients. If you take a bar for example that has a linear gradient from top to bottom and you would like to adjust the gradient with the horizontal size of the bar you have to calculate the colors for the gradient from the size of horizontal size of the bar.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I created a little drawing to visualize what i mean (i hope you could understand it)...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-TQ_TNgmh-7E/TdWD3py_tNI/AAAAAAAAAb8/4WABijf9a3o/s1600/drawing.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-TQ_TNgmh-7E/TdWD3py_tNI/AAAAAAAAAb8/4WABijf9a3o/s1600/drawing.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The horizontal bar in the center should vary it's gradient by it's horizontal size. To achieve this you need to calculate two gradients, one over the three colors on the top of the box (the dark colors) and one over the three colors on the bottom of the box (the bright colors).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I faced the problem when i created the battery component of the SteelSeries lib yesterday which looks like this...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-FydI99tA-nc/TdWEncWr-gI/AAAAAAAAAcA/9SbDYb8vQzI/s1600/battery.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-FydI99tA-nc/TdWEncWr-gI/AAAAAAAAAcA/9SbDYb8vQzI/s1600/battery.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Exactly for this kind of problem i created the LinearGradientPaint wrapper last week. For the example with the horizontal box you have to create two instances of the LinearGradient2 class that is also part of the SteelSeries lib. One for the three dark colors and the other for the three bright colors.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Then you create a LinearGradientPaint that fills the horizontal box from top to bottom with the colors that you get from the getColorAt(float fraction) method of the LinearGradientPaint2 class. Hmm...hard to put into words...maybe some code will help here...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="java" name="code"&gt;public class TestPanel extends javax.swing.JPanel&lt;br /&gt;{&lt;br /&gt;    public TestPanel()&lt;br /&gt;    {&lt;br /&gt;        super();&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    @Override&lt;br /&gt;    protected void paintComponent(java.awt.Graphics g)&lt;br /&gt;    {&lt;br /&gt;        super.paintComponent(g);&lt;br /&gt;        &lt;br /&gt;        java.awt.Graphics2D G2 = (java.awt.Graphics2D) g;&lt;br /&gt;        &lt;br /&gt;        G2.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_ON);&lt;br /&gt;        &lt;br /&gt;        // Define three boxes with the size of 100%, 66% and 33%&lt;br /&gt;        final Rectangle2D BOX100 = new Rectangle2D.Double(0, 0, 300, 50);&lt;br /&gt;        final Rectangle2D BOX66 = new Rectangle2D.Double(0, 100, 200, 50);&lt;br /&gt;        final Rectangle2D BOX33 = new Rectangle2D.Double(0, 200, 100, 50);&lt;br /&gt;        final Point2D START = new Point2D.Double();&lt;br /&gt;        final Point2D STOP = new Point2D.Double();&lt;br /&gt;        &lt;br /&gt;        // Define the fractions for the dark and bright gradient&lt;br /&gt;        final float[] FRACTIONS =&lt;br /&gt;        {&lt;br /&gt;            0.0f,&lt;br /&gt;            0.5f,&lt;br /&gt;            1.0f&lt;br /&gt;        };        &lt;br /&gt;        &lt;br /&gt;        // Define the dark colors (from top to top)&lt;br /&gt;        final Color[] DARK_COLORS =&lt;br /&gt;        {&lt;br /&gt;            Color.GREEN.darker(),&lt;br /&gt;            Color.YELLOW.darker(),&lt;br /&gt;            Color.RED.darker()&lt;br /&gt;        };&lt;br /&gt;        &lt;br /&gt;        // Define the bright colors (from bottom to bottom)&lt;br /&gt;        final Color[] BRIGHT_COLORS =&lt;br /&gt;        {&lt;br /&gt;            Color.GREEN.brighter(),&lt;br /&gt;            Color.YELLOW.brighter(),&lt;br /&gt;            Color.RED.brighter()&lt;br /&gt;        };&lt;br /&gt;        &lt;br /&gt;        // Define the two LinearGradientPaint2 instances&lt;br /&gt;        LinearGradientPaint2 DARK_GRADIENT = new LinearGradientPaint2(new Point2D.Double(0,0), new Point2D.Double(100,0), FRACTIONS, DARK_COLORS);&lt;br /&gt;        LinearGradientPaint2 BRIGHT_GRADIENT = new LinearGradientPaint2(new Point2D.Double(0,0), new Point2D.Double(100,0), FRACTIONS, BRIGHT_COLORS);&lt;br /&gt;                &lt;br /&gt;        // Define the fractions for the linear gradient of the horizontal box&lt;br /&gt;        final float[] BOX_FRACTIONS =&lt;br /&gt;        {&lt;br /&gt;            0.0f,&lt;br /&gt;            1.0f&lt;br /&gt;        };&lt;br /&gt;        &lt;br /&gt;        // Define the gradient for the 100% box and fill it with the right colors&lt;br /&gt;        START.setLocation(0, BOX100.getMinY());&lt;br /&gt;        STOP.setLocation(0, BOX100.getMaxY());                &lt;br /&gt;        Color[] boxColors =&lt;br /&gt;        {&lt;br /&gt;            DARK_GRADIENT.getColorAt((float) BOX100.getWidth() / 300f),&lt;br /&gt;            BRIGHT_GRADIENT.getColorAt((float) BOX100.getWidth() / 300f)&lt;br /&gt;        };        &lt;br /&gt;        LinearGradientPaint boxGradient = new LinearGradientPaint(START, STOP, BOX_FRACTIONS, boxColors);&lt;br /&gt;        G2.setPaint(boxGradient);&lt;br /&gt;        G2.fill(BOX100);&lt;br /&gt;        &lt;br /&gt;        // Define the gradient for the 66% box and fill it with the right colors&lt;br /&gt;        START.setLocation(0, BOX66.getMinY());&lt;br /&gt;        STOP.setLocation(0, BOX66.getMaxY());&lt;br /&gt;        boxColors = new Color[]&lt;br /&gt;        {&lt;br /&gt;            DARK_GRADIENT.getColorAt((float) BOX66.getWidth() / 300f),&lt;br /&gt;            BRIGHT_GRADIENT.getColorAt((float) BOX66.getWidth() / 300f)&lt;br /&gt;        };        &lt;br /&gt;        boxGradient = new LinearGradientPaint(START, STOP, BOX_FRACTIONS, boxColors);&lt;br /&gt;        G2.setPaint(boxGradient);&lt;br /&gt;        G2.fill(BOX66);&lt;br /&gt;&lt;br /&gt;        // Define the gradient for the 33% box and fill it with the right colors&lt;br /&gt;        START.setLocation(0, BOX33.getMinY());&lt;br /&gt;        STOP.setLocation(0, BOX33.getMaxY());&lt;br /&gt;        boxColors = new Color[]&lt;br /&gt;        {&lt;br /&gt;            DARK_GRADIENT.getColorAt((float) BOX33.getWidth() / 300f),&lt;br /&gt;            BRIGHT_GRADIENT.getColorAt((float) BOX33.getWidth() / 300f)&lt;br /&gt;        };        &lt;br /&gt;        boxGradient = new LinearGradientPaint(START, STOP, BOX_FRACTIONS, boxColors);&lt;br /&gt;        G2.setPaint(boxGradient);&lt;br /&gt;        G2.fill(BOX33);&lt;br /&gt;        &lt;br /&gt;        G2.dispose();&lt;br /&gt;    }&lt;br /&gt;}  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This is a JPanel which you could put into a JFrame and it will look like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-B1pAU4znE_c/TdWNeo4TgUI/AAAAAAAAAcE/noBVo1IJcxg/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-B1pAU4znE_c/TdWNeo4TgUI/AAAAAAAAAcE/noBVo1IJcxg/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Hopefully this post will explain better why something like the getColorAt(float fraction) method is really usefull and why i created the LinearGradientPaint2 class. &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It safes you a lot of code and gives you a lot of new ways to explore...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here's another example where i vary the colors of a linear gradient. If you click the link below the image the application will start via webstart...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-QlE9IMIV9jg/TdZOeKIKasI/AAAAAAAAAcI/I7j7vRFE-Vs/s1600/ishot-1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-QlE9IMIV9jg/TdZOeKIKasI/AAAAAAAAAcI/I7j7vRFE-Vs/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/DesignToCode/dtc.jnlp"&gt;Webstart link&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So enjoy the upcoming weekend and keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-6969203678904892615?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/6969203678904892615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/varying-gradients.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6969203678904892615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6969203678904892615'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/varying-gradients.html' title='Varying gradients...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-TQ_TNgmh-7E/TdWD3py_tNI/AAAAAAAAAb8/4WABijf9a3o/s72-c/drawing.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-6460570656486401202</id><published>2011-05-15T14:26:00.000+02:00</published><updated>2011-11-10T20:30:47.366+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.9.2 update...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This is just a small update of the steelseries library where i added four new backgrounds.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;PUNCHED_SHEET&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;CARBON&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;MUD&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;ANTHRACITE&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here is a screenshot that shows the new backgrounds...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-4Dhml1l8AEE/Tc_F4PM4FZI/AAAAAAAAAb4/1koLl9wU0ww/s1600/ishot-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="408" src="http://1.bp.blogspot.com/-4Dhml1l8AEE/Tc_F4PM4FZI/AAAAAAAAAb4/1koLl9wU0ww/s640/ishot-3.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In addition i made some modifications that make it possible to use the library also on headless systems.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well...that's all, just would like to let you know...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Enjoy the rest of the weekend...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-6460570656486401202?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/6460570656486401202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/steelseries-392-update.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6460570656486401202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6460570656486401202'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/steelseries-392-update.html' title='SteelSeries 3.9.2 update...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-4Dhml1l8AEE/Tc_F4PM4FZI/AAAAAAAAAb4/1koLl9wU0ww/s72-c/ishot-3.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-808757090967718933</id><published>2011-05-11T14:26:00.002+02:00</published><updated>2011-11-10T20:30:47.366+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>LinearGradientPaint wrapper...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This is just a short post about a little wrapper around the java.awt.LinearGradientPaint class that i created as a helper for the SteelSeries library.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well my problem was that i would like to create a gradient and after creating it i would like to get a color at a specific fraction. I might be wrong but as far as i know there's no method implemented in the LinearGradientPaint class that could help me here. So i created a little wrapper that wraps the LinearGradientPaint and also contains two additional methods, named getColorAt(float fraction) and getGradient().&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The getColorAt(float fraction) method returns the color of the given gradient at the given fraction.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;strike&gt;The getGradient() method simply returns the wrapped LinearGradientPaint so that you could set the paint in the Graphics content like: g.setPaint(LGP2.getGradient());&lt;/strike&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;UPDATE:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I implemented the java.awt.Paint interface so that you could use the wrapper like an gradient paint (thx for the comment).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The class contains all constructor methods from the original LinearGradientPaint so that you could create it in the same way as the original.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To give you an idea of what i'm talking about here, a little screenshot might help:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-HOnUL9m55ck/Tcp-anbJpQI/AAAAAAAAAb0/qc0ItcQlAhs/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-HOnUL9m55ck/Tcp-anbJpQI/AAAAAAAAAb0/qc0ItcQlAhs/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On the screenshot you could see a gradient that i created and i picked the color at the fraction = 0.61.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;There might be better solution like this but for me it does the job and if you could use it somewhere...here is the source...&lt;/span&gt;&lt;br /&gt;&lt;pre class="java" name="code"&gt;public class LinearGradientPaint2 implements java.awt.Paint&lt;br /&gt;{&lt;br /&gt;    private final java.awt.LinearGradientPaint GRADIENT;&lt;br /&gt;    private float[] fractions;&lt;br /&gt;    private java.awt.Color[] colors;&lt;br /&gt;    &lt;br /&gt;    public LinearGradientPaint2(float startX, float startY, float endX, float endY, float[] fractions, java.awt.Color[] colors)&lt;br /&gt;    {&lt;br /&gt;        GRADIENT = new java.awt.LinearGradientPaint(new java.awt.geom.Point2D.Float(startX, startY), new java.awt.geom.Point2D.Float(endX, endY), fractions, colors, java.awt.MultipleGradientPaint.CycleMethod.NO_CYCLE);&lt;br /&gt;        copyArrays(fractions, colors);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    public LinearGradientPaint2(float startX, float startY, float endX, float endY, float[] fractions, java.awt.Color[] colors, java.awt.MultipleGradientPaint.CycleMethod cycleMethod)&lt;br /&gt;    {&lt;br /&gt;        GRADIENT = new java.awt.LinearGradientPaint(new java.awt.geom.Point2D.Float(startX, startY), new java.awt.geom.Point2D.Float(endX, endY), fractions, colors, cycleMethod);&lt;br /&gt;        copyArrays(fractions, colors);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public LinearGradientPaint2(java.awt.geom.Point2D start, java.awt.geom.Point2D end, float[] fractions, java.awt.Color[] colors)&lt;br /&gt;    {&lt;br /&gt;        GRADIENT = new java.awt.LinearGradientPaint(start, end, fractions, colors, java.awt.MultipleGradientPaint.CycleMethod.NO_CYCLE);&lt;br /&gt;        copyArrays(fractions, colors);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    public LinearGradientPaint2(java.awt.geom.Point2D start, java.awt.geom.Point2D end, float[] fractions, java.awt.Color[] colors, java.awt.MultipleGradientPaint.CycleMethod cycleMethod)&lt;br /&gt;    {&lt;br /&gt;        GRADIENT = new java.awt.LinearGradientPaint(start, end, fractions, colors, cycleMethod, java.awt.MultipleGradientPaint.ColorSpaceType.SRGB, new java.awt.geom.AffineTransform());&lt;br /&gt;        copyArrays(fractions, colors);&lt;br /&gt;    }&lt;br /&gt;       &lt;br /&gt;    public LinearGradientPaint2(java.awt.geom.Point2D start, java.awt.geom.Point2D end, float[] fractions, java.awt.Color[] colors, java.awt.MultipleGradientPaint.CycleMethod cycleMethod,  java.awt.MultipleGradientPaint.ColorSpaceType colorSpace, java.awt.geom.AffineTransform gradientTransform)&lt;br /&gt;    {&lt;br /&gt;        GRADIENT = new java.awt.LinearGradientPaint(start, end, fractions, colors, cycleMethod, colorSpace, gradientTransform);&lt;br /&gt;        copyArrays(fractions, colors);&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    /**&lt;br /&gt;     * Returns the point where the wrapped java.awt.LinearGradientPaint will start&lt;br /&gt;     * @return the point where the wrapped java.awt.LinearGradientPaint will start&lt;br /&gt;     */&lt;br /&gt;    public java.awt.geom.Point2D getStartPoint()&lt;br /&gt;    {&lt;br /&gt;        return GRADIENT.getStartPoint();&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Returns the point where the wrapped java.awt.LinearGradientPaint will stop&lt;br /&gt;     * @return the point where the wrapped java.awt.LinearGradientPaint will stop&lt;br /&gt;     */&lt;br /&gt;    public java.awt.geom.Point2D getEndPoint()&lt;br /&gt;    {&lt;br /&gt;        return GRADIENT.getEndPoint();&lt;br /&gt;    }&lt;br /&gt;            &lt;br /&gt;    /**&lt;br /&gt;     * Returns the color that is defined by the given fraction in the linear gradient paint&lt;br /&gt;     * @param FRACTION&lt;br /&gt;     * @return the color that is defined by the given fraction in the linear gradient paint&lt;br /&gt;     */&lt;br /&gt;    public java.awt.Color getColorAt(final float FRACTION)&lt;br /&gt;    {&lt;br /&gt;        float fraction = FRACTION &amp;gt; 1 ? 1f : FRACTION;&lt;br /&gt;        fraction = FRACTION &amp;lt; 0 ? 0f : fraction;&lt;br /&gt;        float lowerLimit = 0f;        &lt;br /&gt;        int lowerIndex = 0;&lt;br /&gt;        float upperLimit = 1f;&lt;br /&gt;        int upperIndex = 1;&lt;br /&gt;        int index = 0;&lt;br /&gt;        &lt;br /&gt;        for (float currentFraction : fractions)&lt;br /&gt;        {&lt;br /&gt;            if (Float.compare(currentFraction, fraction) &amp;lt; 0)&lt;br /&gt;            {&lt;br /&gt;                lowerLimit = currentFraction;&lt;br /&gt;                lowerIndex = index;&lt;br /&gt;            }&lt;br /&gt;            if (Float.compare(currentFraction, fraction) == 0)&lt;br /&gt;            {&lt;br /&gt;                return colors[index];&lt;br /&gt;            }&lt;br /&gt;            if (Float.compare(currentFraction, fraction) &amp;gt; 0)&lt;br /&gt;            {&lt;br /&gt;                upperLimit = currentFraction;&lt;br /&gt;                upperIndex = index;&lt;br /&gt;                break;&lt;br /&gt;            }&lt;br /&gt;            index++;&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        float interpolationFraction = (fraction - lowerLimit) / (upperLimit - lowerLimit);&lt;br /&gt;        &lt;br /&gt;        return interpolateColor(colors[lowerIndex], colors[upperIndex], interpolationFraction);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Returns the wrapped java.awt.LinearGradientPaint&lt;br /&gt;     * @return the wrapped java.awt.LinearGradientPaint&lt;br /&gt;     */&lt;br /&gt;    public java.awt.LinearGradientPaint getGradient()&lt;br /&gt;    {&lt;br /&gt;        return GRADIENT;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    @Override&lt;br /&gt;    public java.awt.PaintContext createContext(final java.awt.image.ColorModel COLOR_MODEL, final java.awt.Rectangle DEVICE_BOUNDS, java.awt.geom.Rectangle2D USER_BOUNDS, java.awt.geom.AffineTransform X_FORM, java.awt.RenderingHints HINTS)&lt;br /&gt;    {&lt;br /&gt;        return GRADIENT.createContext(COLOR_MODEL, DEVICE_BOUNDS, USER_BOUNDS, X_FORM, HINTS);&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    @Override&lt;br /&gt;    public int getTransparency()&lt;br /&gt;    {&lt;br /&gt;        return GRADIENT.getTransparency();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Just create a local copy of the fractions and colors array&lt;br /&gt;     * @param fractions&lt;br /&gt;     * @param colors &lt;br /&gt;     */&lt;br /&gt;    private void copyArrays(final float[] fractions, final java.awt.Color[] colors)&lt;br /&gt;    {&lt;br /&gt;        this.fractions = new float[fractions.length]; &lt;br /&gt;        System.arraycopy( fractions, 0, this.fractions, 0, fractions.length );&lt;br /&gt;        this.colors = colors.clone();&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Returns the interpolated color that you get if you multiply the delta between&lt;br /&gt;     * color2 and color1 with the given fraction (for each channel) and interpolation. The fraction should&lt;br /&gt;     * be a value between 0 and 1.&lt;br /&gt;     * @param COLOR1 The first color as integer in the hex format 0xALPHA RED GREEN BLUE, e.g. 0xFF00FF00 for a pure green&lt;br /&gt;     * @param COLOR2 The second color as integer in the hex format 0xALPHA RED GREEN BLUE e.g. 0xFFFF0000 for a pure red&lt;br /&gt;     * @param FRACTION The fraction between those two colors that we would like to get e.g. 0.5f will result in the color 0xFF808000     &lt;br /&gt;     * @return the interpolated color between color1 and color2 calculated by the given fraction and interpolation&lt;br /&gt;     */&lt;br /&gt;    private java.awt.Color interpolateColor(final java.awt.Color COLOR1, final java.awt.Color COLOR2, final float FRACTION)&lt;br /&gt;    {&lt;br /&gt;        assert(Float.compare(FRACTION, 0f) &amp;gt;= 0 &amp;amp;&amp;amp; Float.compare(FRACTION, 1f) &amp;lt;= 0);&lt;br /&gt;        &lt;br /&gt;        final float INT_TO_FLOAT_CONST = 1f / 255f;&lt;br /&gt;        &lt;br /&gt;        final float RED1 = COLOR1.getRed() * INT_TO_FLOAT_CONST;&lt;br /&gt;        final float GREEN1 = COLOR1.getGreen() * INT_TO_FLOAT_CONST;&lt;br /&gt;        final float BLUE1 = COLOR1.getBlue() * INT_TO_FLOAT_CONST;&lt;br /&gt;        final float ALPHA1 = COLOR1.getAlpha() * INT_TO_FLOAT_CONST;&lt;br /&gt;        &lt;br /&gt;        final float RED2 = COLOR2.getRed() * INT_TO_FLOAT_CONST;&lt;br /&gt;        final float GREEN2 = COLOR2.getGreen() * INT_TO_FLOAT_CONST;&lt;br /&gt;        final float BLUE2 = COLOR2.getBlue() * INT_TO_FLOAT_CONST;&lt;br /&gt;        final float ALPHA2 = COLOR2.getAlpha() * INT_TO_FLOAT_CONST;&lt;br /&gt;        &lt;br /&gt;        final float DELTA_RED = RED2 - RED1;&lt;br /&gt;        final float DELTA_GREEN = GREEN2 - GREEN1;&lt;br /&gt;        final float DELTA_BLUE = BLUE2 - BLUE1;&lt;br /&gt;        final float DELTA_ALPHA = ALPHA2 - ALPHA1;&lt;br /&gt;        &lt;br /&gt;        float red = RED1 + (DELTA_RED * FRACTION);&lt;br /&gt;        float green = GREEN1 + (DELTA_GREEN * FRACTION);&lt;br /&gt;        float blue = BLUE1 + (DELTA_BLUE * FRACTION);&lt;br /&gt;        float alpha = ALPHA1 + (DELTA_ALPHA * FRACTION);&lt;br /&gt;        &lt;br /&gt;        red = red &amp;lt; 0f ? 0f : red;&lt;br /&gt;        red = red &amp;gt; 1f ? 1f : red;&lt;br /&gt;        green = green &amp;lt; 0f ? 0f : green;&lt;br /&gt;        green = green &amp;gt; 1f ? 1f : green;&lt;br /&gt;        blue = blue &amp;lt; 0f ? 0f : blue;&lt;br /&gt;        blue = blue &amp;gt; 1f ? 1f : blue;&lt;br /&gt;        alpha = alpha &amp;lt; 0f ? 0f : alpha;&lt;br /&gt;        alpha = alpha &amp;gt; 1f ? 1f : alpha;&lt;br /&gt;        &lt;br /&gt;        return new java.awt.Color(red, green, blue, alpha);        &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;     &lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To give you an idea on where i will use this helper class, let me explain an example.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If i have a linear gauge and the color of the column (which represents the current value of the gauge) should fade through different colors from the minimum to the maximum value it would be nice if i could create the underlying linear gradient once and pick the current color of the column dependent on the current value of the linear gauge.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's all for today (to be honest it was more a little reminder that i have to implement the feature i described above to the linear gauge).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-808757090967718933?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/808757090967718933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/lineargradientpaint-wrapper.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/808757090967718933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/808757090967718933'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/lineargradientpaint-wrapper.html' title='LinearGradientPaint wrapper...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-HOnUL9m55ck/Tcp-anbJpQI/AAAAAAAAAb0/qc0ItcQlAhs/s72-c/ishot-2.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-48264768808581944</id><published>2011-05-06T09:57:00.001+02:00</published><updated>2011-11-10T20:30:47.367+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Grinded steel plate effect</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On my way back from the &lt;a href="http://www.jax.de/"&gt;JAX conference&lt;/a&gt; in Mainz last tuesday i saw a stainless steel plate on the train that looked like on &lt;a href="http://sbc2.baumuster.ch/pDetail__Zapfenschliff_-_593/%3Fitid%3D3&amp;amp;usg=__HrZCBsPCbYMRLt4QVXCgK55Oarw=&amp;amp;h=750&amp;amp;w=750&amp;amp;sz=100&amp;amp;hl=de&amp;amp;start=19&amp;amp;sig2=n1fQwPs6L6WyDgwYJrUG7A&amp;amp;zoom=1&amp;amp;itbs=1&amp;amp;tbnid=sFez__sNepaDMM:&amp;amp;tbnh=141&amp;amp;tbnw=141&amp;amp;prev=/search%3Fq%3Dzapfenschliff%26start%3D18%26hl%3Dde%26sa%3DN%26ndsp%3D18%26biw%3D1386%26bih%3D875%26tbm%3Disch%26prmd%3Divns&amp;amp;ei=dp3DTdiGCsaR4gbu49GFBA"&gt;this image&lt;/a&gt; here. In german this treatment of metal has the name "Zapfenschliff" and is used to give the metal a nice design and a more robust surface.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Taking a closer look to the plate it reminds me on the conical gradient that i created a while ago and in fact it's just a simple pattern made out of many conical gradients.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well you know me...i have to reproduce it in swing and voila here's a little tutorial on how i realized it. So the principle approach is to create a texture and use this texture to fill some shape with it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now you could argue that i simply could take an exsting texture and use it to fill the shape but i like to create the stuff completely in 100% pure Java right...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So first of all we need to create a conical gradient like the following:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-b1G6OHdoCIA/TcOh3HYCyjI/AAAAAAAAAbg/JYi-vFIBZDs/s1600/SingleConicalGradient.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-b1G6OHdoCIA/TcOh3HYCyjI/AAAAAAAAAbg/JYi-vFIBZDs/s1600/SingleConicalGradient.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And here is the code you need to create a gradient like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="java" name="code"&gt;double diameter = 50;&lt;br /&gt;Ellipse2D circle = new Ellipse2D.Double(0, 0, diameter, diameter);&lt;br /&gt;Point2D center = new Point2D.Double(circle.getCenterX(), circle.getCenterY());&lt;br /&gt;float[] fractions =  &lt;br /&gt;{&lt;br /&gt;    0f,&lt;br /&gt;    0.03f,&lt;br /&gt;    0.10f,&lt;br /&gt;    0.14f,&lt;br /&gt;    0.24f,&lt;br /&gt;    0.33f,&lt;br /&gt;    0.38f,&lt;br /&gt;    0.5f,&lt;br /&gt;    0.62f,&lt;br /&gt;    0.67f,&lt;br /&gt;    0.76f,&lt;br /&gt;    0.81f,&lt;br /&gt;    0.85f,&lt;br /&gt;    0.97f,&lt;br /&gt;    1.0f &lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Color[] colors = &lt;br /&gt;{ &lt;br /&gt;    new Color(0xFDFDFD),&lt;br /&gt;    new Color(0xFDFDFD),&lt;br /&gt;    new Color(0xB2B2B4),&lt;br /&gt;    new Color(0xACACAE),&lt;br /&gt;    new Color(0xFDFDFD),&lt;br /&gt;    new Color(0x6E6E70),&lt;br /&gt;    new Color(0x6E6E70),&lt;br /&gt;    new Color(0xFDFDFD),&lt;br /&gt;    new Color(0x6E6E70),&lt;br /&gt;    new Color(0x6E6E70),&lt;br /&gt;    new Color(0xFDFDFD),&lt;br /&gt;    new Color(0xACACAE),&lt;br /&gt;    new Color(0xB2B2B4),&lt;br /&gt;    new Color(0xFDFDFD),&lt;br /&gt;    new Color(0xFDFDFD) &lt;br /&gt;};    &lt;br /&gt;ConicalGradientPaint gradient = new ConicalGradientPaint(false, center, -0.45f, fractions, colors);&lt;br /&gt;G2.setPaint(gradient);&lt;br /&gt;G2.fill(circle);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After this we need to create a texture that contains a repeatable pattern of the conical gradient. I created a little drawing to make it easier to understand... &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-uvjkOxxPJy0/TcOh3aydX6I/AAAAAAAAAbk/IGyANRk2OiE/s1600/Texture.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-uvjkOxxPJy0/TcOh3aydX6I/AAAAAAAAAbk/IGyANRk2OiE/s1600/Texture.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The texture (which will be represented by a BufferedImage object) should be a square rectangle with the given SIZE. In this case i used 2x the diameter of the conical gradient. As you can see we need 13 circles that have to be placed in a pattern where we place 3 circles in the first row, 2 circles in the second row, 3 circles in the third row and so on. The stepsize in x- and y-direction is half the size of the diameter and we start on the upper left corner at x=-stepsize, y=-stepsize.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here is the code for the creation of the texture...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="java" name="code"&gt;int amount = 3;&lt;br /&gt;double stepsize = diameter / 2.0;&lt;br /&gt;G2.translate(-stepsize, -stepsize);&lt;br /&gt;AffineTransform oldTransform = G2.getTransform();&lt;br /&gt;for (int y = 0 ; y &amp;lt; 5 ; y++)&lt;br /&gt;{            &lt;br /&gt;    if (y%2 == 0)&lt;br /&gt;    {&lt;br /&gt;        amount = 3;&lt;br /&gt;        G2.translate(0, stepsize * y);&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;        amount = 2;&lt;br /&gt;        G2.translate(stepsize, stepsize * y);&lt;br /&gt;    }&lt;br /&gt;                                                &lt;br /&gt;    for (int x = 0 ; x &amp;lt; amount ; x++)&lt;br /&gt;    {&lt;br /&gt;        G2.setPaint(gradient);&lt;br /&gt;        G2.fill(circle);&lt;br /&gt;        G2.translate(diameter, 0);                &lt;br /&gt;    }                                    &lt;br /&gt;    G2.setTransform(oldTransform);            &lt;br /&gt;}         &lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; &lt;/span&gt; &lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; &lt;/span&gt; &lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; &lt;/span&gt; &lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After we have create the BufferedImage object we can use it as a texture in the &lt;a href="http://download.oracle.com/javase/6/docs/api/java/awt/TexturePaint.html"&gt;java.awt.TexturePaint&lt;/a&gt; class to fill a shape. And the result could look like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-wBzZESiBv0E/TcOh30zUqYI/AAAAAAAAAbo/iBccGMYJ9U0/s1600/TexturePaint.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-wBzZESiBv0E/TcOh30zUqYI/AAAAAAAAAbo/iBccGMYJ9U0/s320/TexturePaint.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On this image we filled a square with four textures but the image was created in &lt;a href="http://www.adobe.com/products/fireworks.html"&gt;Adobe Fireworks&lt;/a&gt;, the Java Swing version would look like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-BOSAhdnk6xk/TcOoJpLH0ZI/AAAAAAAAAbw/XgGcxa5zErw/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://1.bp.blogspot.com/-BOSAhdnk6xk/TcOoJpLH0ZI/AAAAAAAAAbw/XgGcxa5zErw/s320/ishot-2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Fun isn't it ? Well the only problem with this texture is that it looks too perfect right but this is something i'll leave to you... &amp;nbsp; :-)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As always you will find the sourcecode for this little fun project as a &lt;a href="http://www.netbeans.org/"&gt;Netbeans&lt;/a&gt; project...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/SteelPaint/SteelPaint.zip"&gt;SteelPaint.zip&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Enjoy your weekend and keep coding...just for the fun of it...&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-48264768808581944?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/48264768808581944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/grinded-steel-plate-effect.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/48264768808581944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/48264768808581944'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/grinded-steel-plate-effect.html' title='Grinded steel plate effect'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-b1G6OHdoCIA/TcOh3HYCyjI/AAAAAAAAAbg/JYi-vFIBZDs/s72-c/SingleConicalGradient.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-5733961922508511267</id><published>2011-05-04T14:26:00.000+02:00</published><updated>2011-11-10T20:30:47.367+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.9</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It's time again for another release of the SteelSeries library.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;This release will break the compatibility to older versions !&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;First of all i switched the version of the animation library trident from version 1.2 (which was created by Kirill Grouchnikov) to trident 6.2 which is based on a fork of &lt;a href="http://shemnon.com/speling/2011/04/insubstantial-62-release.html"&gt;Danno Ferrin&lt;/a&gt;. I did this because Kirill stopped supporting the original files and Danno created an updated version which is also available on maven central. So this should lead to no problems but maybe some new features in the future...who knows.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The second modification which is the one that breaks the downwards compatibility is related the the tickmarks of the gauges. Right after starting the SteelSeries project i figured out that the method that created to draw the tickmarks of the gauges was not very flexible which leads to some strange effects sometimes. If the range of values was very small (0 - 1) or if you have fractional labels like 0.0, 0.25, 0.5, 0.75... or also very large values you could see what i mean. With the help of Thomas Steinbach i tweaked the method in a way that it was able to do the job (as good as possible). But at some point the whole method looked so ugly to me that i decided to create a new algorithm to solve the problems.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Fortunately there was already an algorithm that looked much better and is much more flexible so that i implemented it to the library. &lt;a href="http://www.trollop.org/2011/03/15/algorithm-for-optimal-scaling-on-a-chart-axis/"&gt;Steffen L. Norgren&lt;/a&gt; already converted this algorithm into Java code which made the transition much easier. Steffen also linked to two articles where you will find a more detailed explanation of the problems that you face when creating scale bars.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To give you an idea what i'm talking about here i made some screenshots:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-NdlwHj_Ag30/TcE8ydsk3sI/AAAAAAAAAbM/Hl3FwTLasxQ/s1600/ishot-12.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="248" src="http://4.bp.blogspot.com/-NdlwHj_Ag30/TcE8ydsk3sI/AAAAAAAAAbM/Hl3FwTLasxQ/s640/ishot-12.png" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Left: min = 0, max = 1.5 &amp;nbsp; Center: min = 0, max = 12000 &amp;nbsp; Right: min = 0, max = 12000&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-iCVWU0ODl9M/TcE8yGGeAtI/AAAAAAAAAbI/QNLEtTOGQRA/s1600/ishot-11.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="248" src="http://3.bp.blogspot.com/-iCVWU0ODl9M/TcE8yGGeAtI/AAAAAAAAAbI/QNLEtTOGQRA/s640/ishot-11.png" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Left: min = 0, max = 1.5 &amp;nbsp; Center: min = 0, max = 12000 &amp;nbsp; Right: min = 0, max = 12000&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you can see on the images above the old version (prior 3.9) was not able to handle small ranges and with large ranges you had the problem with large tickmark labels.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well the new version uses a complete different approach, now one could define how many major tickmarks and how many minor tickmarks one would like to use and a little routine will calculate nice values for the minimum, maximum and the ticklabels.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another thing which i added to the 3.9 release is the possibility to use different formats for the tickmark labels.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;AUTO&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;STANDARD&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;FRACTIONAL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;SCIENTIFIC&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;PERCENTAGE&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This makes it possible to also handle large numbers tickmark labels. The automatic mode tries to figure out the best number format but you could also select one manualy. Here is a screenshot of some examples:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-7dBNehOEA4w/TcE8wojBJYI/AAAAAAAAAa0/cG8mag6A-xo/s1600/ishot-5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-7dBNehOEA4w/TcE8wojBJYI/AAAAAAAAAa0/cG8mag6A-xo/s1600/ishot-5.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Due to a lack of time i was not able to add logarithmic scaling to this release but i'm definitly working on it.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another minor feature that i have added to this release is a new background named "STAINLESS". The idea was born when i blogged about &lt;a href="http://harmoniccode.blogspot.com/2010/10/short-note-about-custom-backgrounds.html"&gt;custom backgrounds in october 2010&lt;/a&gt; and used a ConicalGradient to visualize a stainless background. In the meantime &lt;a href="http://www.jidesoft.com/products/charts.htm"&gt;JIDE Software&lt;/a&gt; released a copy of that idea with their latest release of their components and so i thought fair to add it to the library too.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It might not be very useful but looks impressive doesn't it...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-DihBzG_r9qY/TcE8x41ZRwI/AAAAAAAAAbE/alL_qyYrDP0/s1600/ishot-10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="436" src="http://3.bp.blogspot.com/-DihBzG_r9qY/TcE8x41ZRwI/AAAAAAAAAbE/alL_qyYrDP0/s640/ishot-10.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;There are two other modifications that i made to existing components.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The Linear and LinearBargraph component does now support TickmarkSections which looks like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-OMBHNqSAzqw/TcE8xqC_u5I/AAAAAAAAAbA/6O-kAQESc6w/s1600/ishot-9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-OMBHNqSAzqw/TcE8xqC_u5I/AAAAAAAAAbA/6O-kAQESc6w/s1600/ishot-9.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In addition the Linear component is now also able to handle Sections. If one defines sections with different colors for each section the color of the bar will switch to the color that is defined in the active section.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-yoVbKkGNNy0/TcE8wyzGsOI/AAAAAAAAAa4/Pb_g83RhY8U/s1600/ishot-7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="468" src="http://1.bp.blogspot.com/-yoVbKkGNNy0/TcE8wyzGsOI/AAAAAAAAAa4/Pb_g83RhY8U/s640/ishot-7.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;But that's old stuff, let's talk about something new...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Fabian David Carmargo asked me for some components and could not withstand to implement them into the library, so here we go.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The first thing he asked me for was a rectangular LED and so i created one...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-n4HLQ5ga4XQ/TcE8v9RSCqI/AAAAAAAAAao/gJX-pnxYKA4/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-n4HLQ5ga4XQ/TcE8v9RSCqI/AAAAAAAAAao/gJX-pnxYKA4/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The LED component in the package eu.hansolo.steelseries.extras now has a property named "ledType" which could be ROUND, RECT_VERTICAL or RECT_HORIZONTAL. If you ask yourself why i named it RECT_VERTICAL and RECT_HORIZONTAL.....there might be more geometric shapes of led's in the future... :-)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The other thing Fabian asked me for was a set of components that he needs to visualize a cockpit of a car...which means lot's of symbols...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;First i was not sure if i really should add all this stuff to the library but after all...why not having some fun...so here it is the INDICATOR component with all it's different symbols...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-v7KAIhcpBEA/TcE8wGtAERI/AAAAAAAAAas/EiL3FV98-nU/s1600/ishot-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-v7KAIhcpBEA/TcE8wGtAERI/AAAAAAAAAas/EiL3FV98-nU/s1600/ishot-3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Doesn't look very spectacular right...but believe me it was a lot of work to create all these symbols. As you might have noticed the component uses the same background, frame, foreground property as the radial components and this is because it's derived from AbstractRadial. This means you could use the same design for the INDICATOR component as you use for the gauges. You could also use the given colors to visualize the symbols, here is an example of all available colors...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-iu8l7opcxSE/TcE8wWgqEZI/AAAAAAAAAaw/3XrHW3Kg-zk/s1600/ishot-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="219" src="http://2.bp.blogspot.com/-iu8l7opcxSE/TcE8wWgqEZI/AAAAAAAAAaw/3XrHW3Kg-zk/s320/ishot-4.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As always you could also use CUSTOM as onColor and define your own customOnColor. The same is possible for the offColor property of the INDICATOR component.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;For this release that's all i have to say but i have also created a little &lt;a href="http://idisk.mac.com/han.solo-Public/SteelSeries3/SteelSeries_in_Netbeans_palette.pdf"&gt;step-by-step-guide&lt;/a&gt;&amp;nbsp;on how to add the SteelSeries components to your Netbeans IDE component palette because i've got questions about how to do that.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well...that's it for today...keep coding and enjoy the upcoming summer...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-5733961922508511267?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/5733961922508511267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/steelseries-39.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5733961922508511267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5733961922508511267'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/05/steelseries-39.html' title='SteelSeries 3.9'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-NdlwHj_Ag30/TcE8ydsk3sI/AAAAAAAAAbM/Hl3FwTLasxQ/s72-c/ishot-12.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-1041823865673987530</id><published>2011-04-19T11:28:00.000+02:00</published><updated>2011-04-19T11:28:29.928+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><title type='text'>BiLinearGradient in HTML5 canvas...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This is just a short one for all HTML5 canvas lovers...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because it was not a big deal and might be usefull for one or the other i created also a javascript version of the bilinear gradient paint that one could use in HTML5 canvas. To make it possible i added one class that represents a color in the way that one could get the rgba values from a given color and a class that represents the bilinear gradient paint itself.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The result looks like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-fH5D5n7iX0k/Ta1Rr-gVhaI/AAAAAAAAAak/oX4pMaSJaM4/s1600/ishot-4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-fH5D5n7iX0k/Ta1Rr-gVhaI/AAAAAAAAAak/oX4pMaSJaM4/s1600/ishot-4.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/BiLinearGradient.html"&gt;click here to see it live...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To see it live you just have to click the link below the image. Here is a small example on how to use the BiLinearGradient in JavaScript:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="jscript" name="code"&gt;function init()&lt;br /&gt;{&lt;br /&gt;&lt;script src="js/BiLinearGradient.js" type="text/javascript"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="js/RGBAColor.js" type="text/javascript"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt; &lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;    function init()&lt;br /&gt;    {&lt;br /&gt;        var gradient = new BiLinearGradient(new RGBAColor(255, 0, 0, 1),     // red&lt;br /&gt;                                            new RGBAColor(255, 255, 0, 1),   // yellow&lt;br /&gt;                                            new RGBAColor(0, 0, 255, 1),     // blue&lt;br /&gt;                                            new RGBAColor(0, 255, 255, 1));  // cyan&lt;br /&gt;        // Get the canvas context and clear it&lt;br /&gt;        var ctx = document.getElementById('canvas').getContext('2d');&lt;br /&gt;        gradient.fill(ctx, 0, 0, ctx.canvas.width, ctx.canvas.height);&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;&lt;/script&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You have to place the above script in your html page &amp;lt;head&amp;gt; tag. If you don't know how to do that just take a look at the page sourcecode of the linked page below the image. &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here are the two files you need to create the bilinear color interpolation.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/js/RGBAColor.js"&gt;RGBAColor.js&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/js/BiLinearGradient.js"&gt;BiLinearGradient.js&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Enjoy coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-1041823865673987530?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/1041823865673987530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/04/bilineargradient-in-html5-canvas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1041823865673987530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1041823865673987530'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/04/bilineargradient-in-html5-canvas.html' title='BiLinearGradient in HTML5 canvas...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-fH5D5n7iX0k/Ta1Rr-gVhaI/AAAAAAAAAak/oX4pMaSJaM4/s72-c/ishot-4.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-6342597702697622501</id><published>2011-04-17T14:44:00.000+02:00</published><updated>2011-04-17T14:44:55.556+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Bilinear color interpolation</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Last week when i was surfing around the web i suddenly found this image...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-2e12QbThE40/TarMrs6flBI/AAAAAAAAAZ8/1xBRVjLFSW0/s1600/gradient_colormap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-2e12QbThE40/TarMrs6flBI/AAAAAAAAAZ8/1xBRVjLFSW0/s1600/gradient_colormap.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Even if i didn't need this kind of gradient i asked myself how to achieve this in Java Swing? Well to be honest this is really easy (if you know how to do it) and so i thought double your fun...share your knowledge with others...so here we go...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In principle there's only one little method which is responsible for the whole magic here. This method is able to fade from one color to another by a given fraction in the range from 0...1.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So start with a simple linear gradient that looks like this:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-e9tiFl-lOIg/TarOovcLuJI/AAAAAAAAAaE/EeuK28SQewc/s1600/LinearGradient.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-e9tiFl-lOIg/TarOovcLuJI/AAAAAAAAAaE/EeuK28SQewc/s1600/LinearGradient.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because we will work with floating point operations it makes sense to use also floating points to create your color objects.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If we now for example would like to get the color which is located at a fraction = 0.5f we simply have to build the difference between each color's red, green, blue and alpha values, multiply them with the fraction of 0.5f and add the result to the values of the start color...sounds to complicated ? Maybe some code makes it easier to understand...&lt;/span&gt;&lt;br /&gt;&lt;pre class="java" name="code"&gt;private java.awt.Color interpolateColor(final Color COLOR1, final Color COLOR2, float fraction)&lt;br /&gt;        {            &lt;br /&gt;            final float INT_TO_FLOAT_CONST = 1f / 255f;&lt;br /&gt;            fraction = Math.min(fraction, 1f);&lt;br /&gt;            fraction = Math.max(fraction, 0f);&lt;br /&gt;            &lt;br /&gt;            final float RED1 = COLOR1.getRed() * INT_TO_FLOAT_CONST;&lt;br /&gt;            final float GREEN1 = COLOR1.getGreen() * INT_TO_FLOAT_CONST;&lt;br /&gt;            final float BLUE1 = COLOR1.getBlue() * INT_TO_FLOAT_CONST;&lt;br /&gt;            final float ALPHA1 = COLOR1.getAlpha() * INT_TO_FLOAT_CONST;&lt;br /&gt;&lt;br /&gt;            final float RED2 = COLOR2.getRed() * INT_TO_FLOAT_CONST;&lt;br /&gt;            final float GREEN2 = COLOR2.getGreen() * INT_TO_FLOAT_CONST;&lt;br /&gt;            final float BLUE2 = COLOR2.getBlue() * INT_TO_FLOAT_CONST;&lt;br /&gt;            final float ALPHA2 = COLOR2.getAlpha() * INT_TO_FLOAT_CONST;&lt;br /&gt;&lt;br /&gt;            final float DELTA_RED = RED2 - RED1;&lt;br /&gt;            final float DELTA_GREEN = GREEN2 - GREEN1;&lt;br /&gt;            final float DELTA_BLUE = BLUE2 - BLUE1;&lt;br /&gt;            final float DELTA_ALPHA = ALPHA2 - ALPHA1;&lt;br /&gt;&lt;br /&gt;            float red = RED1 + (DELTA_RED * fraction);&lt;br /&gt;            float green = GREEN1 + (DELTA_GREEN * fraction);&lt;br /&gt;            float blue = BLUE1 + (DELTA_BLUE * fraction);&lt;br /&gt;            float alpha = ALPHA1 + (DELTA_ALPHA * fraction);&lt;br /&gt;&lt;br /&gt;            red = Math.min(red, 1f);&lt;br /&gt;            red = Math.max(red, 0f);&lt;br /&gt;            green = Math.min(green, 1f);&lt;br /&gt;            green = Math.max(green, 0f);&lt;br /&gt;            blue = Math.min(blue, 1f);&lt;br /&gt;            blue = Math.max(blue, 0f);&lt;br /&gt;            alpha = Math.min(alpha, 1f);&lt;br /&gt;            alpha = Math.max(alpha, 0f);&lt;br /&gt;&lt;br /&gt;            return new Color(red, green, blue, alpha);        &lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the method above i first split each color into it's red, green, blue and alpha values, than i build the difference between the stop- and the startcolor, multiply it with the fraction and create a new color from the resulting red, green, blue and alpha values. &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;With this method which represents a linear interpolation between two colors it's easy to create a bilinear interpolation too (because it means we simply have a combination of two linear interpolations).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;For example the bilinear gradient in the first image looks like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kgKg2kiBvD0/TarT8eoeV9I/AAAAAAAAAaI/-P36pCTG56s/s1600/BilinearGradient.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-kgKg2kiBvD0/TarT8eoeV9I/AAAAAAAAAaI/-P36pCTG56s/s1600/BilinearGradient.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you can see we have defined four colors (one for each corner) and we have also fractions in both directions (x and y). Now you need a method that is able to calculate the color between the four colors given by two fractions (one for the x-axis and one for the y-axis). Let's assume we would like to get the color at fraction_x = 0.25f and fraction_y = 0.75f.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-F66FkGVWoCA/TarXHu2k6AI/AAAAAAAAAaQ/SHBXjrrmsj0/s1600/BilinearGradient1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-F66FkGVWoCA/TarXHu2k6AI/AAAAAAAAAaQ/SHBXjrrmsj0/s1600/BilinearGradient1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To be able to calculate the color at the intersection of the two lines we first have to calculate the color between the upper left corner and the upper right corner at the fraction of 0.25f by using the linear interpolation method and save it for example as upperColorX.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the second step we calculate the color between the lower left corner and the lower right corner at the fraction of 0.25f and save it as lowerColorX.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now we have calculated the start- and stopcolor for the vertical linear gradient between the points P1, P2.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-urC1O_kkrj0/TarX6LKQKAI/AAAAAAAAAaU/U90v-4qptbQ/s1600/BilinearGradient2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-urC1O_kkrj0/TarX6LKQKAI/AAAAAAAAAaU/U90v-4qptbQ/s1600/BilinearGradient2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the third and last step we only have to calculate the color between P1 and P2 at the given fraction_y = 0.75f by using the linear interpolation one more time.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kV6vMUyomDA/TarZh_dLBKI/AAAAAAAAAaY/1mYTZwd22tg/s1600/BilinearGradient3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-kV6vMUyomDA/TarZh_dLBKI/AAAAAAAAAaY/1mYTZwd22tg/s1600/BilinearGradient3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now you know how to get the color of a point that is defined by two fractions between 0...1 which is placed in a square of four colors.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I have put the bilinear interpolation in another method which looks like this...&lt;/span&gt;&lt;br /&gt;&lt;pre class="java" name="code"&gt;private Color bilinearInterpolateColor(final Color COLOR_00, Color COLOR_10, final Color COLOR_01, final Color COLOR_11, final float FRACTION_X, final float FRACTION_Y)&lt;br /&gt;        {&lt;br /&gt;            final Color COLOR_X1 = interpolateColor(COLOR_00, COLOR_10, FRACTION_X);&lt;br /&gt;            final Color COLOR_X2 = interpolateColor(COLOR_01, COLOR_11, FRACTION_X);&lt;br /&gt;            return interpolateColor(COLOR_X1, COLOR_X2, FRACTION_Y);&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because i don't want to add these methods all the time i created a BiLinearGradientPaint.class that takes a java.awt.Shape, the colors of the four corners and the fractions in x- and y-direction.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To create the example gradient that i used above you could use the following code:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="java" name="code"&gt;import eu.hansolo.gradients.BiLinearGradientPaint;&lt;br /&gt;import java.awt.Color;&lt;br /&gt;import java.awt.Graphics2D;&lt;br /&gt;import java.awt.Rectangle;&lt;br /&gt;import java.awt.RenderingHints;&lt;br /&gt;&lt;br /&gt;public class BilinearPanel extends javax.swing.JPanel&lt;br /&gt;{&lt;br /&gt;    @Override&lt;br /&gt;    protected void paintComponent(java.awt.Graphics g)&lt;br /&gt;    {&lt;br /&gt;        super.paintComponent(g);&lt;br /&gt;        &lt;br /&gt;        final java.awt.Graphics2D G2 = (Graphics2D) g.create();&lt;br /&gt;        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);&lt;br /&gt;        &lt;br /&gt;        final Color UPPER_LEFT = new Color(1.0f, 0.0f, 0.0f, 1.0f);&lt;br /&gt;        final Color UPPER_RIGHT = new Color(1.0f, 1.0f, 0.0f, 1.0f);&lt;br /&gt;        final Color LOWER_LEFT = new Color(0.0f, 0.0f, 1.0f, 1.0f);&lt;br /&gt;        final Color LOWER_RIGHT = new Color(0.0f, 1.0f, 1.0f, 1.0f);&lt;br /&gt;        &lt;br /&gt;        final Rectangle RECT = new Rectangle(0, 0, 400, 400);&lt;br /&gt;        &lt;br /&gt;        eu.hansolo.gradients.BiLinearGradientPaint BILINEAR_GRADIENT = new eu.hansolo.gradients.BiLinearGradientPaint(RECT, UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT);&lt;br /&gt;        &lt;br /&gt;        G2.setPaint(BILINEAR_GRADIENT);&lt;br /&gt;        G2.fill(RECT);&lt;br /&gt;        &lt;br /&gt;        G2.dispose();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And here is the result one more time... &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Rl7V8zblKww/TareY2TQR0I/AAAAAAAAAag/fEuG0VZgyHs/s1600/ishot-7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Rl7V8zblKww/TareY2TQR0I/AAAAAAAAAag/fEuG0VZgyHs/s1600/ishot-7.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;With bilinear gradients one could create interesting things like the following... &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3L7wn6TOe0c/Tardw8LhoQI/AAAAAAAAAac/KiIM78mTocg/s1600/ishot-6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-3L7wn6TOe0c/Tardw8LhoQI/AAAAAAAAAac/KiIM78mTocg/s1600/ishot-6.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To create things like the image above you simply have to combine some rectangles which are filled with bilinear gradients, where the stop color of one rectangle is the start color of the next rectangle and so on.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I hope you enjoy this things like i do and if you would like to create some nice gradients too, you might want to use one of my gradients. I put the ConicalGradientPaint, the ContourGradientPaint and the BiLinearGradientPaint in an extra library that you could download here:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;binary distribution: &lt;a href="http://idisk.mac.com/han.solo-Public/gradients/Gradients.jar"&gt;Gradients.jar&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;source (netbeans): &lt;a href="http://idisk.mac.com/han.solo-Public/gradients/Gradients.zip"&gt;Gradients.zip&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So enjoy coding...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-6342597702697622501?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/6342597702697622501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/04/bilinear-color-interpolation.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6342597702697622501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6342597702697622501'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/04/bilinear-color-interpolation.html' title='Bilinear color interpolation'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-2e12QbThE40/TarMrs6flBI/AAAAAAAAAZ8/1xBRVjLFSW0/s72-c/gradient_colormap.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-8210876281249272087</id><published>2011-04-01T14:59:00.002+02:00</published><updated>2011-04-01T16:41:24.075+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><title type='text'>SteelSeries JavaScript edition</title><content type='html'>&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here we go again and it's again time for some canvas...&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Those of you who followed this blog know that i started to port some of the components of the steelseries java library to html5 canvas. Because i'm not a javascript coder i had no idea how to build a library from these components and so i started playing around, trying this and that...&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Finally i found a way that looks ok to me (but i might be wrong) and today i could present you the first version of the javascript version of the steelseries library (it only contains the Radial and RadialBargraph right now).&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I tried to implement most of the features of the java version but right now there are still some feature missing.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Here is a list of the features that are supported by the javascript version:&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;GaugeType:&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE1&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE2&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE3&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE4&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;PointerType:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE1&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE2&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE3&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE4&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE5&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE6&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE7&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TYPE8&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;FrameDesign:&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;BLACK_METAL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;METAL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;SHINY_METAL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;BRASS&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;STEEL&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;CHROME&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;GOLD&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;BackgroundColor:&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;DARK_GRAY&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;SATIN_GRAY&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LIGHT_GRAY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;WHITE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLACK&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BEIGE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BROWN&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;GREEN&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LcdColor:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BEIGE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORANGE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;YELLOW&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;WHITE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;GRAY&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLACK&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;GREEN&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE2&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE_BLACK&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE_DARKBLUE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE_GRAY&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;STANDARD&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE_BLUE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;REDDARKRED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LedColor:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RED_LED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;GREEN_LED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE_LED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORANGE_LED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;YELLOW_LED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CYAN_LED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;MAGENTA_LED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Color:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RED&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;GREEN&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLUE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;ORANGE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;YELLOW&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CYAN&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;MAGENTA&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;WHITE&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;GRAY&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;BLACK&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;RAITH&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;GREEN_LCD&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;JUG_GREEN&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The Radial component also supports sections and areas. So there's no track right now (but it will come).&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;&lt;u&gt;PREPARATION:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To make use of the library you have to add two files to your html page:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul style="font-family: Times;"&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;tween.js&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;steelseries.js&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So a typical html5 page header will look like this...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;e.g.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Times;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="xml" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&amp;lt;!DOCTYPE &lt;span class="Apple-style-span" style="color: blue;"&gt;html&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;html&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;lang&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;"en"&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;head&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;meta&lt;/span&gt; charset=&lt;span class="Apple-style-span" style="color: magenta;"&gt;"utf-8"&lt;/span&gt; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;title&lt;/span&gt;&amp;gt;Test&amp;lt;/&lt;span class="Apple-style-span" style="color: blue;"&gt;title&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;script&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;type&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'text/javascript'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;src&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'js/tween.js'&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="Apple-style-span" style="color: blue;"&gt;script&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;script&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;type&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'text/javascript'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;src&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'js/steelseries.js'&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="Apple-style-span" style="color: blue;"&gt;script&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="html" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;...&lt;/span&gt;&lt;/pre&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;&lt;u&gt;USAGE:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To use the library you need to add a &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;canvas&lt;/span&gt;&amp;gt; tag for each gauge to the &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;body&lt;/span&gt;&amp;gt; of the page.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Times; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-family: Times;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="xml" name="code" style="font-family: Verdana, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="xml" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;e.g.&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span"&gt;...&lt;br /&gt;&lt;/span&gt;&amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;body &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;onload&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;=&lt;/span&gt;&lt;span class="Apple-style-span" style="color: magenta;"&gt;'init()'&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;canvas&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;id&lt;/span&gt;='canvas1' &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;width&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'200'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;height&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'200'&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="xml" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;        No canvas in your browser...sorry...&lt;/span&gt;&lt;/pre&gt;&lt;pre class="xml" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;    &amp;lt;/&lt;span class="Apple-style-span" style="color: blue;"&gt;canvas&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;canvas&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;id&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'canvas2'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;width&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'200'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;height&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'200'&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="Apple-style-span" style="color: blue;"&gt;canvas&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;&lt;pre class="xml" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&amp;lt;&lt;span class="Apple-style-span" style="color: blue;"&gt;canvas&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;id&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'canvas3'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;width&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'200'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #cc0000;"&gt;height&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: magenta;"&gt;'200'&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="Apple-style-span" style="color: blue;"&gt;canvas&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;/span&gt;&amp;lt;/&lt;span class="Apple-style-span" style="color: blue;"&gt;body&lt;/span&gt;&amp;gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="html" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;pre class="html" name="code" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;...&lt;/pre&gt;&lt;/span&gt;&lt;div style="font-family: Verdana, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now we only have to add the init() method in the &amp;lt;head&amp;gt; of the page, where we create the canvas components.&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;&lt;b&gt;!!! OLD VERSION !!!&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class="jscript" name="code"&gt;function init()&lt;br /&gt;{&lt;br /&gt;  // Define some sections&lt;br /&gt;  var sections = Array(steelseries.Section(0, 25, 'rgba(0, 0, 220, 0.3)'),&lt;br /&gt;                       steelseries.Section(25, 50, 'rgba(0, 220, 0, 0.3)'), &lt;br /&gt;                       steelseries.Section(50, 75, 'rgba(220, 220, 0, 0.3)'));&lt;br /&gt;  &lt;br /&gt;  // Define one area&lt;br /&gt;  var areas = Array(steelseries.Section(75, 100, 'rgba(220, 0, 0, 0.3)'));&lt;br /&gt;            &lt;br /&gt;  // Create one radial gauge&lt;br /&gt;  var radial1 = new steelseries.Radial(&lt;br /&gt;                    'canvas1',                              // the canvas element&lt;br /&gt;                    steelseries.GaugeType.TYPE4,            // type of gauge&lt;br /&gt;                    200,                                    // size of gauge&lt;br /&gt;                    0,                                      // minimum value&lt;br /&gt;                    100,                                    // maximum value&lt;br /&gt;                    50,                                     // threshold&lt;br /&gt;                    sections,                               // sections&lt;br /&gt;                    areas,                                  // areas&lt;br /&gt;                    'Test',                                 // title string&lt;br /&gt;                    'Unit',                                 // unit string&lt;br /&gt;                    steelseries.FrameDesign.METAL,          // frame design&lt;br /&gt;                    steelseries.BackgroundColor.DARK_GRAY,  // background color&lt;br /&gt;                    steelseries.PointerType.TYPE8,          // pointer type&lt;br /&gt;                    steelseries.ColorDef.RED,               // pointer color&lt;br /&gt;                    steelseries.LcdColor.STANDARD,          // lcd color&lt;br /&gt;                    true,                                   // lcd visible&lt;br /&gt;                    steelseries.LedColor.RED_LED,           // led color&lt;br /&gt;                    true,                                   // led visible&lt;br /&gt;                    false);                                 // play audio&lt;br /&gt;  &lt;br /&gt;  // Create a second radial gauge&lt;br /&gt;  var radial2 = new steelseries.Radial(&lt;br /&gt;                    'canvas2', &lt;br /&gt;                    steelseries.GaugeType.TYPE2, &lt;br /&gt;                    200, &lt;br /&gt;                    0, &lt;br /&gt;                    50, &lt;br /&gt;                    40, &lt;br /&gt;                    Array(steelseries.Section(0, 40, 'rgba(0, 255, 0, 0.3)')),&lt;br /&gt;                    Array(steelseries.Section(40, 50, 'rgba(255, 0, 0, 0.5)')), &lt;br /&gt;                    'Test', &lt;br /&gt;                    'Unit', &lt;br /&gt;                    steelseries.FrameDesign.CHROME, &lt;br /&gt;                    steelseries.BackgroundColor.LIGHT_GRAY, &lt;br /&gt;                    steelseries.PointerType.TYPE2, &lt;br /&gt;                    steelseries.ColorDef.BLUE, &lt;br /&gt;                    steelseries.LcdColor.BLUE2, &lt;br /&gt;                    true, &lt;br /&gt;                    steelseries.LedColor.BLUE_LED, &lt;br /&gt;                    true, &lt;br /&gt;                    false);&lt;br /&gt;&lt;br /&gt;  // Create a radial bargraph gauge&lt;br /&gt;  var radial3 = new steelseries.RadialBargraph(&lt;br /&gt;                    'canvas3',                               // the canvas element&lt;br /&gt;                    steelseries.GaugeType.TYPE3,             // type of gauge&lt;br /&gt;                    200,                                     // size of gauge&lt;br /&gt;                    0,                                       // minimum value&lt;br /&gt;                    100,                                     // maximum value&lt;br /&gt;                    50,                                      // threshold&lt;br /&gt;                    null,                                    // sections (not supported)&lt;br /&gt;                    "Title",                                 // title string&lt;br /&gt;                    "Unit",                                  // unit string&lt;br /&gt;                    steelseries.FrameDesign.BLACK_METAL,     // frame design&lt;br /&gt;                    steelseries.BackgroundColor.LIGHT_GRAY,  // background color &lt;br /&gt;                    steelseries.ColorDef.YELLOW,             // color of the bargraph led's&lt;br /&gt;                    steelseries.LcdColor.YELLOW,             // lcd color&lt;br /&gt;                    true,                                    // lcd visible&lt;br /&gt;                    steelseries.LedColor.YELLOW_LED,         // led color&lt;br /&gt;                    true);                                   // led visible&lt;br /&gt;&lt;br /&gt;  // Let's set some values...&lt;br /&gt;  radial1.setValueAnimated(70);&lt;br /&gt;  radial2.setValueAnimated(41);&lt;br /&gt;  radial3.setValueAnimated(70);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;s&gt;As you can see the drawback of the current design are the long constructors. I'm still not sure how to make these nicer but i'm working on that...&lt;/s&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;&lt;u&gt;UPDATE:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Thanx to &lt;a href="http://twitter.com/aalmiray"&gt;Andres Almiray&lt;/a&gt; who pointed me in the right direction i modified the constructor of the Radial and RadialBargraph component in the way that it now takes a hash as a set of parameters. This means you don't have to put in all the default parameters anymore which makes the initialization of the components look like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;!!! NEW VERSION !!!&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="jscript" name="code"&gt;function init()&lt;br /&gt;{&lt;br /&gt;  // Define some sections&lt;br /&gt;  var sections = Array(steelseries.Section(0, 25, 'rgba(0, 0, 220, 0.3)'),&lt;br /&gt;                       steelseries.Section(25, 50, 'rgba(0, 220, 0, 0.3)'), &lt;br /&gt;                       steelseries.Section(50, 75, 'rgba(220, 220, 0, 0.3)'));&lt;br /&gt;  &lt;br /&gt;  // Define one area&lt;br /&gt;  var areas = Array(steelseries.Section(75, 100, 'rgba(220, 0, 0, 0.3)'));&lt;br /&gt;            &lt;br /&gt;  // Create one radial gauge&lt;br /&gt;  var radial1 = new steelseries.Radial(&lt;br /&gt;                    'canvas1', {&lt;br /&gt;                    section: sections,                      &lt;br /&gt;                    area: areas,                            &lt;br /&gt;                    titleString: 'Test',                    &lt;br /&gt;                    unitString: 'Unit',                     &lt;br /&gt;                    pointerType: steelseries.PointerType.TYPE8&lt;br /&gt;                    });                               &lt;br /&gt;&lt;br /&gt;// Create a second radial gauge&lt;br /&gt;  var radial2 = new steelseries.Radial(&lt;br /&gt;                    'canvas2', {&lt;br /&gt;                    gaugeType: steelseries.GaugeType.TYPE2,                     &lt;br /&gt;                    maxValue: 50, &lt;br /&gt;                    threshold: 40, &lt;br /&gt;                    section: Array(steelseries.Section(0,40,'rgba(0,255,0,0.3)')),&lt;br /&gt;                    area: Array(steelseries.Section(40,50,'rgba(255,0,0,0.5)')), &lt;br /&gt;                    titleString: 'Test', &lt;br /&gt;                    unitString: 'Unit', &lt;br /&gt;                    frameDesign: steelseries.FrameDesign.CHROME, &lt;br /&gt;                    backgroundColor: steelseries.BackgroundColor.LIGHT_GRAY, &lt;br /&gt;                    pointerType: steelseries.PointerType.TYPE2, &lt;br /&gt;                    pointerColor: steelseries.ColorDef.BLUE, &lt;br /&gt;                    lcdColor: steelseries.LcdColor.BLUE2,                     &lt;br /&gt;                    ledColor: steelseries.LedColor.BLUE_LED, &lt;br /&gt;                    });&lt;br /&gt;&lt;br /&gt;  // Create a radial bargraph gauge&lt;br /&gt;  var radial3 = new steelseries.RadialBargraph(&lt;br /&gt;                    'canvas3', {&lt;br /&gt;                    gaugeType: steelseries.GaugeType.TYPE3,&lt;br /&gt;                    titleString: "Title",                                &lt;br /&gt;                    unitString: "Unit",          &lt;br /&gt;                    frameDesign: steelseries.FrameDesign.BLACK_METAL,&lt;br /&gt;                    backgroundColor: steelseries.BackgroundColor.LIGHT_GRAY,&lt;br /&gt;                    valueColor: steelseries.ColorDef.YELLOW,&lt;br /&gt;                    lcdColor: steelseries.LcdColor.YELLOW,&lt;br /&gt;                    ledColor: steelseries.LedColor.YELLOW_LED,&lt;br /&gt;                    });                                   &lt;br /&gt;&lt;br /&gt;  // Let's set some values...&lt;br /&gt;  radial1.setValueAnimated(70);&lt;br /&gt;  radial2.setValueAnimated(41);&lt;br /&gt;  radial3.setValueAnimated(70);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Guess that looks much better than before... :-) &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you put all these things together in one html page you should see something like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-R9YndreczEQ/TZXJBIOJrWI/AAAAAAAAAZw/0dhZKJl9-GE/s1600/ishot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-R9YndreczEQ/TZXJBIOJrWI/AAAAAAAAAZw/0dhZKJl9-GE/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you are to lazy to play around you might want to click &lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/Test.html"&gt;here&lt;/a&gt; to see it in action...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;There are two versions of the library available right now, the uncompressed (101 kb) and compressed (61 kb) version. You could download the version clicking on one of the following links:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uncompressed version: &amp;nbsp; &amp;nbsp;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/js/steelseries.js"&gt;steelseries.js&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;compressed version: &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/js/steelseries-min.js"&gt;steelseries-min.js&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;animation library: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/js/tween.js"&gt;tween.js&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Keep in mind that this project is work in progress and things might change in the future...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Enjoy the upcoming weekend and keep coding...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-8210876281249272087?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/8210876281249272087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/04/steelseries-javascript-edition.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8210876281249272087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/8210876281249272087'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/04/steelseries-javascript-edition.html' title='SteelSeries JavaScript edition'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-R9YndreczEQ/TZXJBIOJrWI/AAAAAAAAAZw/0dhZKJl9-GE/s72-c/ishot-1.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-6977657955263257313</id><published>2011-03-24T12:18:00.001+01:00</published><updated>2011-11-10T20:30:47.367+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.8 (slim down release)</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Like i mentioned in my &lt;a href="http://harmoniccode.blogspot.com/2011/03/slim-down.html"&gt;last post&lt;/a&gt; there is a new release of the SteelSeries swing component library. I have to release another version of the library because i added two new components to it and made some modifications that i explained in my last post too.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Klaus Rheinwald asked me for an artificial horizon component that he needed and so i started adding one to the library. Fortunately i created one last year on my trip to &lt;a href="http://www.jfokus.se/jfokus/"&gt;JFokus&lt;/a&gt; and got some insider information of &lt;a href="http://twitter.com/mikaelgrev"&gt;Mikael Grev&lt;/a&gt; who is an active fighter pilot and a coder (you might know one of his projects called &lt;a href="http://www.miglayout.com/"&gt;MiGLayout&lt;/a&gt; which is a really nice Java Layout Manager).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So the result of this work looks like this...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-mZl2DWtDFMs/TYshVfjRj1I/AAAAAAAAAZk/TU7Iyt9-4X4/s1600/ishot-2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh6.googleusercontent.com/-mZl2DWtDFMs/TYshVfjRj1I/AAAAAAAAAZk/TU7Iyt9-4X4/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Horizon&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Horizon&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; component is located in the extras package of the SteelSeries and you could customize it by defining the color of the sky, the background and the indicator (&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;setPointerColor()&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;). You could define pitch and roll and the horizon will hopefully display the right view. There's only one little problem left which occurs if you have a pitch larger than 90°. A real artificial horizon will flip over by rotating around 180° but i was not able to implement it in a way that looks good enough. I will spend some time to this problem later on, so stay tuned...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Klaus Rheinwald also pointed me to the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Compass&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; component that's already in the SteelSeries library and he mentioned that on an airplane the compass looks different in the way that the "needle" is fixed and the scale is rotating...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Ok, that was a piece of cake because in principle this is the same behaviour as the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;RadialCounter&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; just with another pointer. Long story short, here is the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;AirCompass&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; component...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh3.googleusercontent.com/-SHTNkjuOJs4/TYshVPoP0ZI/AAAAAAAAAZg/Up6QQJtex-0/s1600/ishot-1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh3.googleusercontent.com/-SHTNkjuOJs4/TYshVPoP0ZI/AAAAAAAAAZg/Up6QQJtex-0/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;AirCompass&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The design was taken from a real aviation instrument and the whole creation time for this component was only around 2 hours. You could set the value in the range of 0 to 360 degrees and the scale will rotate around the airplane in the center. The color could be changed by the &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;pointerColor&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; property of the component.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the last release i forgot to mention that there was also a new &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;FrameDesign&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; and &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;BackgroundColor&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; that one could choose for the gauges and because i added another &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;FrameDesign&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; i will present both of it in this post...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-dKUGRiapQlQ/TYshWBPeErI/AAAAAAAAAZo/Vlr7bapSSbA/s1600/ishot-3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh6.googleusercontent.com/-dKUGRiapQlQ/TYshWBPeErI/AAAAAAAAAZo/Vlr7bapSSbA/s1600/ishot-3.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;Left:&lt;/b&gt; FrameDesign.GOLD, BackgroundColor.BROWN, PointerType.TYPE7&lt;/div&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;Right:&lt;/b&gt; FrameDesign.CHROME, KnobType.BIG_CHROME_KNOB, PointerType.TYPE7&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On the left gauge you see the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;FrameDesign.GOLD&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; with the new &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;BackgroundColor.BROWN&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; and on the right gauge you see the new &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;FrameDesign.CHROME&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;. In addition to the new FrameDesign you could see also another new &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;PointerType.TYPE7&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; in both gauges and a new &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;KnobType.BIG_CHROME_KNOB&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; (on the right gauge).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another user of the SteelSeries library asked me if it would be possible to get a square frame on the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Clock&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; component too...and of course this is possible...here we go...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-w_Hp70b0yjE/TYshWYANUBI/AAAAAAAAAZs/8tt8wC4eLww/s1600/ishot-4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh6.googleusercontent.com/-w_Hp70b0yjE/TYshWYANUBI/AAAAAAAAAZs/8tt8wC4eLww/s1600/ishot-4.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;Left:&lt;/b&gt; FrameType.ROUND&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;Right:&lt;/b&gt; FrameType.SQUARE&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another modification was the reduction of the memory footprint of the components. I mentioned this in my last post already, so it's not needed to repeat myself here. Nearly all components now make use of this combined layer technique.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The test application is now also updated to the 3.8 release of the library and is still available &lt;a href="http://idisk.mac.com/han.solo-Public/SteelSeries/test.jnlp"&gt;here&lt;/a&gt; as a webstart app.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;At least i fixed a memory leak that occurred when using the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setValueAnimated()&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method. After i made some long term tests over the last days the problem seems to be fixed now.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Like i said before, just let me know if you need some special component and i'll try to implement it if i'll find the time...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's it for today, enjoy the upcoming weekend and keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-6977657955263257313?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/6977657955263257313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/steelseries-38-slim-down-release.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6977657955263257313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6977657955263257313'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/steelseries-38-slim-down-release.html' title='SteelSeries 3.8 (slim down release)'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh6.googleusercontent.com/-mZl2DWtDFMs/TYshVfjRj1I/AAAAAAAAAZk/TU7Iyt9-4X4/s72-c/ishot-2.png' height='72' width='72'/><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-3244861114409346198</id><published>2011-03-23T11:09:00.000+01:00</published><updated>2011-11-10T20:30:47.368+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>Slim down...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Today i would like to talk about some experiments that i made to reduce the memory footprint of the steelseries components.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you could read in the &lt;a href="http://harmoniccode.blogspot.com/2010/08/java-swing-component-library.html"&gt;first post&lt;/a&gt; on this blog i mentioned the problem with the what i called "Layer Technique", where you split your component in different layers. With this technique you create an image for each layer of the component, in my case this means i create images for the frame, background, tickmarks, title, lcd background, pointer, knobs and foreground. The memory footprint of a typical image of a radial component in the steelseries could then be calculated as follows:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The default size of a radial component is 200x200 pixels and i'm using an alpha channel which results in a memory footprint of one image of:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;200 x 200 x 4 byte = 160 000 bytes&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;(4 byte = 1 byte for &lt;span class="Apple-style-span" style="background-color: red; color: white;"&gt;red&lt;/span&gt;, 1 byte for &lt;span class="Apple-style-span" style="background-color: #38761d; color: white;"&gt;green&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #999999;"&gt;,&lt;/span&gt; 1 byte for &lt;span class="Apple-style-span" style="background-color: blue; color: white;"&gt;blue&lt;/span&gt; and 1 byte for &lt;span class="Apple-style-span" style="background-color: black; color: white;"&gt;alpha&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This means that a standard radial component in it's default visualization (containing a frame, background, title, tickmarks, pointer, knobs and foreground) will have a memory footprint (only of the images) of:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;7 x 160 000 bytes = 1 120 000 bytes = 1.07 Mb&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That seems to be ok even if it's a lot of memory just for the visualization but in these days computers have lots of ram and powerful processors so it should not be a problem.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;But if you imagine a huge display showing 20 radial components of a size of 300x300 pixels it could get up to:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;20 x 300 x 300 x 4 byte x 7 = 50 400 000 bytes = 48.07 Mb&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You might want to say "&lt;i&gt;come on...it's only 50 megabytes, where is the problem&lt;/i&gt;" and you might be right but to me it looks too much...which means i had to slim down the memory footprint of the components.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I faced the same problem in the canvas version of the steelseries components and i used the same optimization in the swing version, i combine layers in as less images as possible.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This means i combine the frame, background, title, tickmarks and lcd background in one image and the knob and foreground in another image. Well it's not a huge improvement but it feels better. To give you an idea how i realized it let me show you some code...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Old version:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;BufferedImage &lt;span class="Apple-style-span" style="color: red;"&gt;create_FRAME_Image&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: blue;"&gt;int&lt;/span&gt; size)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;GraphicsConfiguration GFX_CONF = GraphicsEnvironment.&lt;span class="Apple-style-span" style="color: red;"&gt;getLocalGraphicsEnvironment&lt;/span&gt;().&lt;span class="Apple-style-span" style="color: red;"&gt;getDefaultScreenDevice&lt;/span&gt;().&lt;span class="Apple-style-span" style="color: red;"&gt;getDefaultConfiguration&lt;/span&gt;();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;BufferedImage image = GFX_CONF.&lt;span class="Apple-style-span" style="color: red;"&gt;createCompatibleImage&lt;/span&gt;(size, size, &lt;i&gt;TRANSLUCENT&lt;/i&gt;);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Graphics2D g2 = image.&lt;span class="Apple-style-span" style="color: red;"&gt;createGraphics&lt;/span&gt;();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;// Do some fancy drawing here&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;g2.&lt;span class="Apple-style-span" style="color: red;"&gt;dispose&lt;/span&gt;();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;return&lt;/span&gt; frameImage;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;New version:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;public&lt;/span&gt; BufferedImage &lt;span class="Apple-style-span" style="color: red;"&gt;create_Frame_Image&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: blue;"&gt;int&lt;/span&gt; size, BufferedImage image)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;if&lt;/span&gt; (image == &lt;span class="Apple-style-span" style="color: blue;"&gt;null&lt;/span&gt;)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GraphicsConfiguration GFX_CONF = GraphicsEnvironment.g&lt;span class="Apple-style-span" style="color: red;"&gt;etLocalGraphicsEnvironment&lt;/span&gt;().&lt;span class="Apple-style-span" style="color: red;"&gt;getDefaultScreenDevice&lt;/span&gt;().&lt;span class="Apple-style-span" style="color: red;"&gt;getDefaultConfiguration&lt;/span&gt;();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BufferedImage image = GFX_CONF.&lt;span class="Apple-style-span" style="color: red;"&gt;createCompatibleImage&lt;/span&gt;(size, size, &lt;i&gt;TRANSLUCENT&lt;/i&gt;);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Graphics2D g2 = image.&lt;span class="Apple-style-span" style="color: red;"&gt;createGraphics&lt;/span&gt;();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;// Do some fancy drawing here&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;...&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;g2.&lt;span class="Apple-style-span" style="color: red;"&gt;dispose&lt;/span&gt;();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;return&lt;/span&gt; image;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: x-small;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As you can see the new version takes an image as parameter and if this parameter is not null it will draw the fancy painting code on the given image and returns it again. With this technique you could create an image in the component and pass it to all methods that you would like to add to the image and you will end up with one image only, instead of many images.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The drawback of this method is that you have to create the whole background image each time you change one of the images (e.g. the backgroundcolor of the gauge) but it will reduce the memory footprint.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another modification i made was again located in the image creation methods. Because the image creation methods will be called at the time of initialization (before the component is really realized) with a size of 0 they have to return something. In the former release i returned an empty image of the default size which means 200 x 200 pixels. But this image was never used because once the component was realized, the image was created again with the default size and the old image was thrown away. By using &lt;a href="http://visualvm.java.net/"&gt;VisualVM&lt;/a&gt; i was able to see a peak in memory usage directly after initialization of the components which was huge. In the current release i return an empty image of the size 1 x 1 pixel which again reduced the memory footprint a bit.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Like i mentioned in my very first post there are more areas of potential "weight loss", e.g. the pointer image could be only of the size of the pointer instead of the full image size etc.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I'm not sure if this was the right approach but it works and i would love to hear other ideas on how to reduce the memory footprint...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The next release of the SteelSeries library (3.8) will contain all these modifications and will be available soon...so stay tuned and keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-3244861114409346198?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/3244861114409346198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/slim-down.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3244861114409346198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/3244861114409346198'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/slim-down.html' title='Slim down...'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-1807771937060632112</id><published>2011-03-11T12:20:00.005+01:00</published><updated>2011-11-10T20:32:40.144+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><title type='text'>Friday Fun Component VII</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;First of all i'll say thanx to &lt;a href="http://lqd.hybird.org/journal/"&gt;Rémy Rakic&lt;/a&gt;, who pointed me to the idea to create todays component. It's all about a design clock that was created by &lt;a href="http://www.biegertfunk.com/"&gt;Biegert&amp;amp;Funk&lt;/a&gt; and which name is &lt;a href="http://www.qlocktwo.com/"&gt;QlockTwo&lt;/a&gt;. This clock displays the current time in steps of five minutes in words.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This design clock is awsome and definitly something i'll buy in the future (if i'll find some money for it). The original clock is available in lots of languages whereas my version does only support the following&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;german&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;english&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;french (that's for you Rémy)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;dutch (that's for you Tom)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To make sure to avoid problems with copyrights etc. i won't show any original image here but you will find a lot of images if you search for QlockTwo in google.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;My version does support all colors of the original one (even the stainless steel one) and is fully scalable as usual.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To give you an impression how it looks like here are some screenshots...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh4.googleusercontent.com/-Ht7OHH3-k9w/TXZJ77_SZfI/AAAAAAAAAY4/j_olDKGQX-E/s1600/ishot-1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh4.googleusercontent.com/-Ht7OHH3-k9w/TXZJ77_SZfI/AAAAAAAAAY4/j_olDKGQX-E/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Black Ice Tea&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-RATLgHI_wok/TXZJ8Oxz-eI/AAAAAAAAAY8/lRS5kVWtP0w/s1600/ishot-2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh6.googleusercontent.com/-RATLgHI_wok/TXZJ8Oxz-eI/AAAAAAAAAY8/lRS5kVWtP0w/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Cherry Cake&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh5.googleusercontent.com/-iJ04rRhQYxs/TXZJ8XHdLtI/AAAAAAAAAZA/5dzAGKnd0r0/s1600/ishot-3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh5.googleusercontent.com/-iJ04rRhQYxs/TXZJ8XHdLtI/AAAAAAAAAZA/5dzAGKnd0r0/s1600/ishot-3.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Lime Juice&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh4.googleusercontent.com/-pALgzozZ7Cg/TXZJ8x12iTI/AAAAAAAAAZE/TjhdsyzwMl4/s1600/ishot-4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh4.googleusercontent.com/-pALgzozZ7Cg/TXZJ8x12iTI/AAAAAAAAAZE/TjhdsyzwMl4/s1600/ishot-4.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Frozen Blackberry&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh3.googleusercontent.com/-qCJRJI5Sodk/TXZJ9H0YDBI/AAAAAAAAAZI/LwV7xxPP5XE/s1600/ishot-5.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh3.googleusercontent.com/-qCJRJI5Sodk/TXZJ9H0YDBI/AAAAAAAAAZI/LwV7xxPP5XE/s1600/ishot-5.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Vanilla Sugar&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh4.googleusercontent.com/-FSIp-irS_D0/TXZL4N3FvlI/AAAAAAAAAZQ/GAhSnZP8QWI/s1600/ishot-7.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh4.googleusercontent.com/-FSIp-irS_D0/TXZL4N3FvlI/AAAAAAAAAZQ/GAhSnZP8QWI/s1600/ishot-7.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Stainless Steel&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The original clock has a light sensor which is used to adjust the brightness of the light of the characters. To get the same behaviour one could use the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setBrightness()&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method of the QlockTwo component which takes values from 0.25f - 1.0f (default). If you would like to change the color you could use the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setColor()&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method or if you would like to customize the component you might want to set the color property to CUSTOM and use the methods &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setCustomBackground(java.awt.Paint)&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;, &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setCustomOn(java.awt.Color)&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; and &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;setCustomOff(java.awt.Color)&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; to give the clock your own style.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Changing the language can be done by using &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;setLanguage()&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;There's also a method to enable/disable the visibility of the highlight effect named &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setHighlightVisible(boolean)&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You might ask yourself how the clock displays values that doesn't fit in the 5 minutes scheme...well that's easy...on each corner of the clock you will find a dot which has the following meaning...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Dots will be switched ON:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;upper left dot &amp;nbsp;: &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;if (currentMinute %5 == 1 || currentMinute %5 == 6)&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;upper right dot: &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;if (currentMinute %5 == 2 || currentMinute %5 == 7)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;lower right dot: &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;if (currentMinute %5 == 3 || currentMinute %5 == 8)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;lower left dot &amp;nbsp;: &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;if (currentMinute %5 == 4 || currentMinute %5 == 9)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Dots will be switched OFF:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;all dots: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;if (currentMinute %5 == 0)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As an example please take a look at the following image...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh5.googleusercontent.com/-aAIdsw3555w/TXddb_kKAEI/AAAAAAAAAZU/PI-xpkkHQcQ/s1600/ishot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh5.googleusercontent.com/-aAIdsw3555w/TXddb_kKAEI/AAAAAAAAAZU/PI-xpkkHQcQ/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;INFO:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I asked Biegert&amp;amp;Funk for permission to release a Java component of their QlockTwo but unfortunately i did not get any response to my question...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To avoid problems with their copyright i won't add a download link to this blog entry until i will get the permission &lt;s&gt;but if you are interested in this clock you might want to drop me a mail and we could see what is possible&lt;/s&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;UPDATE:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;b&gt;This evening Biegert&amp;amp;Funk contacted me and told me that i'm not allowed to publish the component (which was no surprise to me) and i totally understand this. That means if you would like to have a clock component like mine you have to create it by yourself...which is a good reason to have some fun ;-)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you like the real Biegert&amp;amp;Funk QlockTwo you might want to buy one &lt;a href="http://store.biegertfunk.com/"&gt;here&lt;/a&gt;&amp;nbsp;but you have to know that quality has it's price.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So keep coding... &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-1807771937060632112?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/1807771937060632112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/friday-fun-component-vii.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1807771937060632112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/1807771937060632112'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/friday-fun-component-vii.html' title='Friday Fun Component VII'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh4.googleusercontent.com/-Ht7OHH3-k9w/TXZJ77_SZfI/AAAAAAAAAY4/j_olDKGQX-E/s72-c/ishot-1.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-257020540783343441</id><published>2011-03-10T10:32:00.000+01:00</published><updated>2011-11-10T20:30:47.369+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><title type='text'>SteelSeries 3.7.2</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And another one...&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;nearly two weeks ago Andreas Ehlert contacted me and asked me if i could create some component that he would like to use to visualize the wind direction on a ship. An example of such a gauge could be found &lt;a href="http://www.weathershop.com/nassau_m52appwinddir.htm"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;He sent me some images and i started creating a version of this gauge for the SteelSeries library. Here is an image of the new component...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-YgPwTYWET04/TWvF2geMwSI/AAAAAAAAAYw/AFV1aa3YxnQ/s1600/ishot-5.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh6.googleusercontent.com/-YgPwTYWET04/TWvF2geMwSI/AAAAAAAAAYw/AFV1aa3YxnQ/s1600/ishot-5.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;WindDirection&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This gauge has two pointers where one pointer shows the measured direction from where the wind is coming from and the second pointer shows the real direction from where the wind is coming. The second pointer only has a &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setValue2()&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method but no &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;s&gt;setValue2Animated()&lt;/s&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method. The second pointer could have a all other properties that the standard pointer has like pointerType, pointerColor etc.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The lcd display in the component is not coupled to the pointer value but will show the windspeed in knots which has to be set by using &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setLcdValue()&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In addition to this new gauge i made some modifications to the existing ones in the library. First i added a lcd display to the altimeter gauge which should it make more easy to directly read the visualized value, here is a little screenshot...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh5.googleusercontent.com/-sQtRZ0Buc8o/TWvF2OmtRDI/AAAAAAAAAYo/weSVnBFPlR4/s1600/ishot-3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh5.googleusercontent.com/-sQtRZ0Buc8o/TWvF2OmtRDI/AAAAAAAAAYo/weSVnBFPlR4/s1600/ishot-3.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Altimeter incl. LCD&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The other component i modified is the RadialCounter. I made some minor graphical modifications that hopefuly improves the look of the component a bit because i was not satisfied with it. On the left you see the new version and on the right you see the old version.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh5.googleusercontent.com/-UzY1vMKWbHE/TWyyB0g5isI/AAAAAAAAAY0/hhlus1mTzZw/s1600/ishot-5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh5.googleusercontent.com/-UzY1vMKWbHE/TWyyB0g5isI/AAAAAAAAAY0/hhlus1mTzZw/s1600/ishot-5.png" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; color: black;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="https://lh3.googleusercontent.com/-a7LpU--hKbA/TWvF1xYEIfI/AAAAAAAAAYk/p1La3acaJpc/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh3.googleusercontent.com/-a7LpU--hKbA/TWvF1xYEIfI/AAAAAAAAAYk/p1La3acaJpc/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To be honest i'm still not sure if the new version will be finished forever but at the moment it seems to be better than the old one. The biggest problem with the old one was that you never saw the real value of the gauge which was the reason for the lcd display. Now one could set the value for example to 20 which will rotate the tickmarks two times and the lcd will show the value increasing up to 20.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In addition to the modifications above i also added another pointer type which is called TYPE6 and looks like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh3.googleusercontent.com/-3Zsum8b2c1A/TXiEMcfNZ8I/AAAAAAAAAZY/iNsJ0KW4p1Q/s1600/ishot-1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh3.googleusercontent.com/-3Zsum8b2c1A/TXiEMcfNZ8I/AAAAAAAAAZY/iNsJ0KW4p1Q/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;PointerType.TYPE6&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Another small modification is the ability to select different shapes for the tickmarks. There are three types of tickmarks:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;MiniTickmarks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;MinorTickmarks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;MajorTickmarks&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;which could get a shape of &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;eu.hansolo.steelseries.tools.TickmarkType&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The available types are &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;LINE&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;CIRCLE&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;TRIANGLE&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;SQUARE&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In this release only LINE and CIRCLE are supported but i'll try to implement also TRIANGLE and SQUARE in a future release of the library.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The CIRCLE type on the major tickmarks will look like this...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh3.googleusercontent.com/-uc3MYJUzW3Q/TXiFud-JMnI/AAAAAAAAAZc/OLvdUBAQLSI/s1600/ishot-2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh3.googleusercontent.com/-uc3MYJUzW3Q/TXiFud-JMnI/AAAAAAAAAZc/OLvdUBAQLSI/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;TickmarkType.CIRCLE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;In the last version there have still been problems with some components like the lcd etc. when drag'n drop it to a panel in a visual design editor like Matisse in Netbeans. The initial size after the component was dropped to the container was wrong. This is fixed now.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you like the components in the library but miss a specific one that you could need...just let me know and i'll try to add it to the lib. One component on my list is for example an artificial horizon that i created 1.5 years ago and would like to add to the library in the future.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So that's it for today...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-257020540783343441?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/257020540783343441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/steelseries-372.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/257020540783343441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/257020540783343441'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/03/steelseries-372.html' title='SteelSeries 3.7.2'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh6.googleusercontent.com/-YgPwTYWET04/TWvF2geMwSI/AAAAAAAAAYw/AFV1aa3YxnQ/s72-c/ishot-5.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-6909730474581975519</id><published>2011-02-25T18:06:00.000+01:00</published><updated>2011-02-25T18:06:04.451+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><title type='text'>Canvas vs. SVG...?</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Hi again,&lt;/span&gt;&lt;script language="javascript"&gt;dp.SyntaxHighlighter.BloggerMode();dp.SyntaxHighlighter.HighlightAll('code');&lt;/script&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;today i would like to share some thoughts about HTML5 canvas and svg with you. It seems that not everybody understand that the new capabilities of HTML5 support for canvas and svg does not mean that we have to decide which is the better technology in general. You just have to choose the right tool for your job...if you have to handle a lot of dead bitmaps without any or just a few interactions you should take a look at canvas and if you need the full dom accessibility and living dom objects you should take svg.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I played around with svg around 2004 and at this time the support was bad (unfortunately). But with todays browser support for svg i thought about combining canvas with svg.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The idea is to use images that has been generated in canvas and use them as background images for svg animations. In this specific case i asked myself if it would make sense to create the static drawing parts of a gauge (like the background and the foreground) in canvas and put an animated svg pointer in between these images and let svg do the animation instead of a javascript. So the question was how to get a canvas as an image and the easy answer is you have to use the&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;toDataURL("image/png")&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method on a canvas element. This will create a base64 encoded image in png format that one could use in an svg &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;lt;image&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; element.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So i added two functions to the canvas component that returns the backgroundimage and the foregroundimage by using the &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;toDataURL()&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #6aa84f; font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;// Return a base64 encoded image of the background for svg use&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;this&lt;/span&gt;.getBackgroundImage = &lt;span class="Apple-style-span" style="color: blue;"&gt;function&lt;/span&gt;()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;{&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;init();&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;return&lt;/span&gt; BACKGROUND_Buffer.toDataURL(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"image/png"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;When this was done i just have to add the image via javascript to the svg element in my html body and the images will be painted by svg instead of canvas.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #6aa84f; font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;// Add the canvas as backgroundimage to the svg container&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;var&lt;/span&gt; backgroundImage_dataurl = compass.getBackgroundImage();&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #6aa84f; font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;// Create a new &amp;lt;image&amp;gt; tag in the svg element with the canvas as a source image&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;var&lt;/span&gt; svg_BackgroundImage = document.createElementNS(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"image"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_BackgroundImage.setAttributeNS(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"http://www.w3.org/1999/xlink"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"xlink:href"&lt;/span&gt;, backgroundImage_dataurl);&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_BackgroundImage.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"id"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"background"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_BackgroundImage.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"width"&lt;/span&gt;, IMAGE_WIDTH);&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_BackgroundImage.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"height"&lt;/span&gt;, IMAGE_HEIGHT);&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg.appendChild(svg_BackgroundImage); &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now i had to add the pointer to the svg element between the background image and the foreground image via javascript which could be done by using the svg &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;lt;path&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; element.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;// Add the svg pointer ontop of the image&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;var&lt;/span&gt; northPointer = document.createElementNS("&lt;span class="Apple-style-span" style="color: magenta;"&gt;http://www.w3.org/2000/svg"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"path"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;northPointer.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"id"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"northpointer"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;northPointer.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"width"&lt;/span&gt;, IMAGE_WIDTH);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;northPointer.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"height"&lt;/span&gt;, IMAGE_HEIGHT);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;var&lt;/span&gt; northPath = &lt;span class="Apple-style-span" style="color: magenta;"&gt;"M"&lt;/span&gt; + IMAGE_WIDTH * 0.5 + &lt;span class="Apple-style-span" style="color: magenta;"&gt;" "&lt;/span&gt; + IMAGE_HEIGHT * 0.4953271028037383 +&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: magenta;"&gt;"L"&lt;/span&gt; + IMAGE_WIDTH * 0.5280373831775701 + &lt;span class="Apple-style-span" style="color: magenta;"&gt;" "&lt;/span&gt; + IMAGE_HEIGHT * 0.4953271028037383 +&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: magenta;"&gt;"L"&lt;/span&gt; + IMAGE_WIDTH * 0.5 + &lt;span class="Apple-style-span" style="color: magenta;"&gt;" "&lt;/span&gt; + IMAGE_HEIGHT * 0.14953271028037382 +&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: magenta;"&gt;"L"&lt;/span&gt; + IMAGE_WIDTH * 0.4719626168224299 + &lt;span class="Apple-style-span" style="color: magenta;"&gt;" "&lt;/span&gt; + IMAGE_HEIGHT * 0.4953271028037383 +&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: magenta;"&gt;"L"&lt;/span&gt; + IMAGE_WIDTH * 0.5 + &lt;span class="Apple-style-span" style="color: magenta;"&gt;" "&lt;/span&gt; + IMAGE_HEIGHT * 0.4953271028037383 +&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: magenta;"&gt;"Z"&lt;/span&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt; &amp;nbsp;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;northPointer.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"d"&lt;/span&gt;, northPath);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;northPointer.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"stroke"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"darkred"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;northPointer.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"fill"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"red"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg.appendChild(northPointer);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To add an animation (in this case from 0 to -360 deg in an infinite loop) to the pointer i decided to use the &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;lt;animateTransform&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; element of svg and added it to the svg element via javascript.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #6aa84f; font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;// Animate NorthPointer&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;var svg_animateNorth = document.createElementNS(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"animateTransform"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttributeNS(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"http://www.w3.org/1999/xlink"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"xlink:href"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"#northpointer"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"id"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"animatenorth"&lt;/span&gt;);&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"attributeName"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"transform"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"begin"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"0s"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"dur"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"3s"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute("&lt;span class="Apple-style-span" style="color: magenta;"&gt;type"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"rotate"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"from"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"0 100 100"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"to"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"-360 100 100"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg_animateNorth.setAttribute(&lt;span class="Apple-style-span" style="color: magenta;"&gt;"repeatCount"&lt;/span&gt;, &lt;span class="Apple-style-span" style="color: magenta;"&gt;"indefinite"&lt;/span&gt;);&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;svg.appendChild(svg_animateNorth); &amp;nbsp; &lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-tab-span" style="font-family: Verdana, sans-serif; white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And that's it, now i could compare pure javascript canvas animation with svg animation...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To see the page in action please click on the link below the image.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-clwn4Le9bMA/TWfgKd5zmpI/AAAAAAAAAYg/1YfJkk04mc0/s1600/ishot-1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-clwn4Le9bMA/TWfgKd5zmpI/AAAAAAAAAYg/1YfJkk04mc0/s1600/ishot-1.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/SvgCanvas.html"&gt;Click to see it in action...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The canvas animation will work in nearly all non ie browsers but the svg animation seems to have problems with webkit based browsers which means you won't see the right side moving in Chrome and Safari. But it will work in FireFox 4.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So keep coding...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-6909730474581975519?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/6909730474581975519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/02/canvas-vs-svg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6909730474581975519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/6909730474581975519'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/02/canvas-vs-svg.html' title='Canvas vs. SVG...?'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-clwn4Le9bMA/TWfgKd5zmpI/AAAAAAAAAYg/1YfJkk04mc0/s72-c/ishot-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-5695198633344829367</id><published>2011-02-18T09:46:00.001+01:00</published><updated>2011-11-10T20:32:40.145+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='steelseries'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><title type='text'>Friday Fun (Canvas) Component VI</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Back from JFokus (which was great by the way) i have some more fun to share with you today. This time it's related to HTML5 canvas (what else ;-)).&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Sitting in a talk at JFokus i've got the idea to convert the compass component of the SteelSeries Swing library to canvas to use it in conjunction with the HTML5 geolocation api (e.g. position.coordinates.heading).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It tooks me several talks and coffee breaks to complete the conversion and here is the result...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-qPp4deTuPPw/TV4vMn59IbI/AAAAAAAAAYU/TEB0YczAbfM/s1600/ishot-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-qPp4deTuPPw/TV4vMn59IbI/AAAAAAAAAYU/TEB0YczAbfM/s1600/ishot-3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Because it's part of the steelseries canvas version one could define things like frameDesign, backgroundColor and pointerColor.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Unfortunately the geolocation api did not work out as well which was the reason to convert another component from the SteelSeries Swing library.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I'm talking about the level component. I read that there is a deviceorientation api in the html5 spec (draft) which i might use also on my macbook pro so here is the result of the level component...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-4vw94-kqVuE/TV4upiW2mFI/AAAAAAAAAYQ/vWLsTOMmhhs/s1600/ishot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-4vw94-kqVuE/TV4upiW2mFI/AAAAAAAAAYQ/vWLsTOMmhhs/s1600/ishot-2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;And again you could set the frameDesign, backgroundColor and pointerColor of the component in the constructor of the component.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well looking at a static image is fine...but better is to see it in action. To get there, please click at the link below the following image...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-yv0RC-YLaLw/TV4wWSQvSRI/AAAAAAAAAYY/gPR7UjkzH1k/s1600/ishot-4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="515" src="http://4.bp.blogspot.com/-yv0RC-YLaLw/TV4wWSQvSRI/AAAAAAAAAYY/gPR7UjkzH1k/s640/ishot-4.png" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/Radial.html"&gt;Click to see it in action...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Well that's better right...? But only driven by some setInterval() calls to a method that creates random values. Would it not be nice to get a direct response of an inbuild sensor...YES !!!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So for all running on windows, linux, android....sorry guys, the following link will only show you a static components. But if you are running a device like a Macbook, Macbook Pro, &lt;s&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;iPad (iOS 4.2)&lt;/span&gt;&lt;/s&gt;, iPhone4 (iOS 4.2) or &lt;s&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;iPhone 3Gs (iOS 4.2)&lt;/span&gt;&lt;/s&gt; you should see &amp;nbsp;the level component rotating if you rotate your device. I only had the chance to test it on my Macbook Pro and it works if you tilt the Macbook Pro to the left or right.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Just test it by clicking on the link below the following image...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-PFdLTUJPzeo/TV4xecKHWSI/AAAAAAAAAYc/l3VpXXsbd-A/s1600/ishot-5.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-PFdLTUJPzeo/TV4xecKHWSI/AAAAAAAAAYc/l3VpXXsbd-A/s1600/ishot-5.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://idisk.mac.com/han.solo-Public/Canvas/SteelSeries/LevelTest.html"&gt;Click to see it in action...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;That's it for today and even if it's not Java related i hope it will be fun for one or the other...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Cheers and keep coding...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #cc0000; font-family: Verdana, sans-serif;"&gt;&lt;b&gt;Update:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;As i learned today, the device needs a gyroscope to fire onDeviceOrientation events which excludes iPads and iPhones 3Gs from the list. That means you could only see the level component on an Macbook, Macbook Pro and iPhone4. I extended the page by a compass and a speed gauge that will show the direction and the speed when you move with your device (e.g. in a car). In this case it will work also on Android devices with os version &amp;gt;= 2.2.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6885067460687713893-5695198633344829367?l=harmoniccode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://harmoniccode.blogspot.com/feeds/5695198633344829367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harmoniccode.blogspot.com/2011/02/friday-fun-canvas-component-vi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5695198633344829367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6885067460687713893/posts/default/5695198633344829367'/><link rel='alternate' type='text/html' href='http://harmoniccode.blogspot.com/2011/02/friday-fun-canvas-component-vi.html' title='Friday Fun (Canvas) Component VI'/><author><name>Han.Solo</name><uri>http://www.blogger.com/profile/12574196875988408685</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_dP6rRrwb7Ng/TGEUTx3aJ7I/AAAAAAAAAD0/L1hYdY-pi9c/S220/Gerrit+Grunwald.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-qPp4deTuPPw/TV4vMn59IbI/AAAAAAAAAYU/TEB0YczAbfM/s72-c/ishot-3.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6885067460687713893.post-4103830232582751652</id><published>2011-02-11T09:32:00.001+01:00</published><updated>2011-11-10T20:32:40.145+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fridayfun'/><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='swing'/><title type='text'>Friday Fun Component V</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;It's friday again...which means it's time for some fun...&lt;/span&gt;&lt;script language="javascript"&gt;dp.SyntaxHighlighter.BloggerMode();dp.SyntaxHighlighter.HighlightAll('code');&lt;/script&gt;  &lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Last wednesday at the Java Roundup of the &lt;a href="http://www.jug-muenster.de/"&gt;Java User Group Muenster&lt;/a&gt; i decided to create a little fun component again.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Every morning on my way to the office i see one of the following traffic signs and what should i say...i like it somehow...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-muNxSKkmYgY/TVTmoKU8JMI/AAAAAAAAAXw/ugp5lTJeYqw/s1600/Schild1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-muNxSKkmYgY/TVTmoKU8JMI/AAAAAAAAAXw/ugp5lTJeYqw/s1600/Schild1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;So i asked myself if it would be hard to create something like this in Swing.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The first idea was to only create this single sign but after a few more days passing by the traffic sign the idea came to my mind that it would be fun to load some image, scale it to the number of led's in the sign and create the led's with the appropriate color of the image pixels.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;But let me give you a more detailed description of what i've done...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;These are the steps it takes to create the component:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Create a panel of 250x250 px&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Fill the panel with led components of a fixed size (10x10 px) with a rasterStep of 6 px (this is the distance between each led in x and y direction).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Now you could load an image into the component via the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;setSymbol(fileName)&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; method.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;The image file will be loaded, scaled to the size of the raster (no. of led's in x and y direction).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Get the color of each pixel in the image and set the related led in the raster to the same color.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If the brightness of the pixel is smaller than 50% the color of the led will be set to black and it will be switched off.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Draw all the led's in a buffered ima&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;ge and draw the image to the panel.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;To create a traffic sign like the one on the image above i created a little png file that looks like this...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-xzuUoRbTfMU/TVTq9pU9jZI/AAAAAAAAAX0/pNXZU6Xiens/s1600/80.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-xzuUoRbTfMU/TVTq9pU9jZI/AAAAAAAAAX0/pNXZU6Xiens/s1600/80.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;This image has the size of 41 x 41 px which is exactly the number of led's that i have in the default raster (ImageWidth / rasterStep =&amp;gt; 250px / 6px = 41.666 =&amp;gt; 41). I do not use antialiasing in the image because every pixel in the image should be represented by one led in the raster later on. You could vary the &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;rasterStep&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt; variable&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;(distance between the led's)&lt;/span&gt;&lt;span class="Apple-style-span" style="
