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

<channel>
	<title>vectomatic</title>
	<atom:link href="http://www.vectomatic.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vectomatic.org</link>
	<description>standard dynamic 2D graphics in web browsers</description>
	<lastBuildDate>Fri, 02 Jul 2010 22:00:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>July release</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/july-release</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/july-release#comments</comments>
		<pubDate>Fri, 02 Jul 2010 21:57:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=480</guid>
		<description><![CDATA[<p>There are many new versions of GWT appearing these days: 2.0.4, 2.1.0M1 and an upcoming 2.1.0M2. Because lib-gwt-svg integration with UiBinder uses internal GWT classes (alas there is no public API for extending UiBinder parsers yet), it needs to follow these changes very closely to remain compatible. I have issued a number of versions myself to [...]]]></description>
			<content:encoded><![CDATA[<p>There are many new versions of GWT appearing these days: 2.0.4, 2.1.0M1 and an upcoming 2.1.0M2. Because lib-gwt-svg integration with UiBinder uses internal GWT classes (alas there is no public API for extending UiBinder parsers yet), it needs to follow these changes very closely to remain compatible. I have issued a number of versions myself to keep up, and the following table explains which version of lib-gwt-svg you should use which a given GWT version. Functionally, the lib-gwt-svg versions are all equivalent.</p>
<table border="0">
<tbody>
<tr>
<th>GWT version</th>
<th>lib-gwt-svg version</th>
</tr>
<tr>
<td>2.0.3</td>
<td>0.4.6</td>
</tr>
<tr>
<td>2.0.4</td>
<td>0.4.7</td>
</tr>
<tr>
<td>2.1.0M1</td>
<td>0.4.8</td>
</tr>
</tbody>
</table>
<p>You can obtain these versions from the maven repository (<a href="http://www.vectomatic.org/mvn/org/vectomatic/lib-gwt-svg/">http://www.vectomatic.org/mvn/org/vectomatic/lib-gwt-svg/</a>) or from the SVN repository (<a href="http://code.google.com/p/vectomatic/source/browse/">http://code.google.com/p/vectomatic/source/browse/</a>)</p>
<p>I have also fixed a bug I introduced in the previous version of the <a href="../lib-gwt-svg-edu/connect-the-dots">Connect the dots</a> game and which rendered the first level of the game unplayable.</p>
<p>Lukas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/july-release/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>June news</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/june-news</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/june-news#comments</comments>
		<pubDate>Wed, 09 Jun 2010 17:13:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=428</guid>
		<description><![CDATA[<p>This posts gives an overview of the new developments which have been made available today</p>
1. lib-gwt-svg
<p>I am releasing a new version of lib-gwt-svg (version 0.4.6). As can be seen in the release notes, the emphasis is mostly on fixing bugs and making the API easier to use. Here is a high level view of the main [...]]]></description>
			<content:encoded><![CDATA[<p>This posts gives an overview of the new developments which have been made available today</p>
<h2>1. <a href="../lib-gwt-svg">lib-gwt-svg</a></h2>
<p>I am releasing a new version of <a href="../lib-gwt-svg">lib-gwt-svg</a> (version 0.4.6). As can be seen in the <a href="../lib-gwt-svg/release-notes">release notes</a>, the emphasis is mostly on fixing bugs and making the API easier to use. Here is a high level view of the main changes:</p>
<h3>Generics</h3>
<p>I have finally bitten the bullet, read the excellent <a href="http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf">tutorial on Java Generics</a> by G. Bracha and generified the API.</p>
<h3>Collections</h3>
<p>I have changed the implementation of the SVG collection classes. They have been promoted from pure overlay types to wrapper types (see my post on <a href="./lib-gwt-svg/lib-gwt-svg-goals-and-design">goals and design</a> for more explanations of what I mean by that). They now implement java.lang.Iterable, so you can write code like this:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OMSVGDocument document <span style="color: #339933;">=</span> OMSVGParser.<span style="color: #006633;">currentDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
OMNodeList<span style="color: #339933;">&lt;</span>OMSVGRectElement<span style="color: #339933;">&gt;</span> rectList <span style="color: #339933;">=</span> document.<span style="color: #006633;">getElementsByTagNameNS</span><span style="color: #009900;">&#40;</span>SVGConstants.<span style="color: #006633;">SVG_NAMESPACE_URI</span>, SVGConstants.<span style="color: #006633;">SVG_RECT_TAG</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>OMSVGRectElement rect <span style="color: #339933;">:</span> rectList<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
...<br />
<span style="color: #009900;">&#125;</span></div></div>
<h3>GWT <a title="XPath specification" href="http://www.w3.org/TR/xpath/">XPath</a> expressions</h3>
<p><a href="../lib-gwt-svg">lib-gwt-svg</a> now offers a new <a href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/utils/DOMHelper.html#evaluateXPath(org.vectomatic.dom.svg.OMSVGElement, java.lang.String, org.vectomatic.dom.svg.utils.XPathPrefixResolver)">DOMHelper.evaluateXPath()</a> <a title="XPath specification" href="http://www.w3.org/TR/xpath/">XPath</a> evaluation function, which lets you do really powerful computations with little code. Imagine you have an SVG drawing containing many circles and you want to increase their radii by 10%. Here you go:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OMSVGSVGElement svg <span style="color: #339933;">=</span> OMSVGParser.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span>...<span style="color: #006633;">someURL</span>...<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
Iterator<span style="color: #339933;">&lt;</span>OMSVGCircleElement<span style="color: #339933;">&gt;</span> iterator <span style="color: #339933;">=</span> DOMHelper.<span style="color: #006633;">evaluateXPath</span><span style="color: #009900;">&#40;</span>svg, <span style="color: #0000ff;">&quot;.//svg:circle&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> SVGPrefixResolver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; OMSVGLength radius <span style="color: #339933;">=</span> iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getR</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getBaseVal</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; radius.<span style="color: #006633;">setValue</span><span style="color: #009900;">&#40;</span>1.1f <span style="color: #339933;">*</span> radius.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Another problem I find <a title="XPath specification" href="http://www.w3.org/TR/xpath/">XPath</a> very good at is to replace <a href="..//mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMDocument.html#getElementById(java.lang.String)">getElementById()</a>. <a href="..//mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMDocument.html#getElementById(java.lang.String)">getElementById</a> does not work in all circumstances. If called too early (before the node is inserted in the DOM structure), it will fail. You can easily devise an XPath which will do the same thing and work is all circumstances. One area where I think this pattern should be applied is UiBinder HTML binding. UiBinder currently relies upon adding temporary &#8220;id&#8221; attributes to the elements you want to bind to, then removing it before it gives control back to you. However UiBinder will fail if the HTML node you want to bind to already has an id: it is either ui:field or &#8216;id&#8217;. If XPath where used instead, their less intrusive nature would let one use both ui:field and &#8216;id&#8217; in the same DOM node. This is the way <a href="../lib-gwt-svg/uibinder-integration-with-lib-gwt-svg">lib-gwt-svg UiBinder integration</a> works.</p>
<p>One final note on <a title="XPath specification" href="http://www.w3.org/TR/xpath/">XPath</a>: they seem to work very well on all browsers: Webkit based, Firefox and Opera.</p>
<h3>Events</h3>
<p>As explained in the <a href="./lib-gwt-svg/lib-gwt-svg-goals-and-design">goals and design</a> post, <a href="../lib-gwt-svg">lib-gwt-svg</a> uses overlay types internally. These overlay types are then embedded in wrapper types which provide a more java-friendly view of the SVG types and lets them implement interfaces, notably GWT event registration interfaces. Though it is straightforward to go from the wrapper type to the underlying overlay type, the other conversion is more costly: you need to instantiate a new wrapper and wrap the overlay type in it. Up to version 0.4.5 included, the wrapper type also carried the HandlerManager which stores event registration information. Thus, the wrapper was not truly hollow and you could end up with event registration information for the same overlay type contained in several instances of HandlerManager owned by several wrappers. With version 0.4.6, there is just one HandlerManager per SVG object, and it is carried by the overlay type itself.</p>
<h2>2. <a href="../lib-gwt-svg-samples">lib-gwt-svg-samples</a></h2>
<p>The samples work correctly with all SVG enabled browsers (except the SMIL animation sample, which works only in Opera and FF3.7 alpha4).<br />
The samples can now be resized, as should every SVG application.</p>
<h2>3. <a href="../lib-gwt-svg-edu">lib-gwt-svg-edu</a></h2>
<p>I am releasing two new puzzle games, which leverage the same SVG feature: the ability to create arbitrary clip path. This is very convenient to cut one image into several pieces and layout the pieces in arbitrary order. If you want to explore the possibilities of this pattern, here is a trick which is not available from the UI: try to launch the game with the following parameters added to the URL: ?connector=SQUARE and ?connector=NONE.</p>
<p>I have also reorganized the program so that navigation works better: going back to the main menu no longer requires the game to restart. I am just swapping DOM elements to achieve the same result.</p>
<p>The program was originally developed and tested with FF3.x and works really well on this platform (except a minor bug in the display of the &#8220;push-push&#8221; game title, fixed by FF3.7a4). With this release, I have also tested it on Opera: there are no bugs I am aware of on this platform. I tried to do the same with Webkit-based browsers (Safari and Chrome) but there a currently several bugs and missing features and  these browsers quickly crash when running the games. So I was faced with two possible choices: either recode the games to bypass these bugs and missing features, or file bug reports help these browser improve. As you guess, I chose the &#8220;lazy&#8221; path for the moment and went for the second option. You can check the <a href="../lib-gwt-svg/browser-svg-bugs">browser bugs</a> page for the list of bugs I have filed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/june-news/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Group</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/google-group</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/google-group#comments</comments>
		<pubDate>Mon, 26 Apr 2010 19:59:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://www.vectomatic.org/?p=420</guid>
		<description><![CDATA[<p>I am starting a Google Group to answer questions about lib-gwt-svg and discuss issues and possible uses of the library. The URL is: https://groups.google.com/group/lib-gwt-svg. Feel free to ask your questions there, I will do my best to answer them as quickly [...]]]></description>
			<content:encoded><![CDATA[<p>I am starting a Google Group to answer questions about lib-gwt-svg and discuss issues and possible uses of the library. The URL is: <a title="Google group URL" href="https://groups.google.com/group/lib-gwt-svg">https://groups.google.com/group/lib-gwt-svg</a>. Feel free to ask your questions there, I will do my best to answer them as quickly as possible</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/google-group/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>April news</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/april-news</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/april-news#comments</comments>
		<pubDate>Wed, 21 Apr 2010 19:45:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[HTML 5 canvas]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=403</guid>
		<description><![CDATA[<p>Many new exciting new features have been released today</p>
<p>A new version of lib-gwt-svg (version 0.4.5) has been released. It provides:</p>

support for SVG push buttons and toggle buttons. The widgets tab of lib-gwt-svg-samples has been upgraded to demonstrate these.
UiBinder integration of SVG push buttons and toggle buttons. The article on UiBinder integration has been upgraded to explain [...]]]></description>
			<content:encoded><![CDATA[<p>Many new exciting new features have been released today</p>
<p>A new version of lib-gwt-svg (version 0.4.5) has been released. It provides:</p>
<ul>
<li>support for SVG push buttons and toggle buttons. The <strong>widgets</strong> tab of <a href="../lib-gwt-svg-samples" title="lib-gwt-svg-samples">lib-gwt-svg-samples</a> has been upgraded to demonstrate these.</li>
<li>UiBinder integration of SVG push buttons and toggle buttons. The <a href="../lib-gwt-svg/uibinder-integration-with-lib-gwt-svg" title="SVG, GWT and UiBinder">article on UiBinder integration</a> has been upgraded to explain how to create SVG buttons declaratively. You can also look at the <strong>widgets</strong> tab of <a href="../lib-gwt-svg-samples" title="lib-gwt-svg-samples">lib-gwt-svg-samples</a> which uses UiBinder to create the sample buttons.</li>
<li>support for external SVG resources in client bundles. The <strong>parser</strong> tab of <a href="../lib-gwt-svg-samples" title="lib-gwt-svg-samples">lib-gwt-svg-samples</a> has been upgraded to use external resources</li>
<li>A new sample has been added to <a href="../lib-gwt-svg-samples" title="lib-gwt-svg-samples">lib-gwt-svg-samples</a> to demonstrate SMIL animations. Currently the sample only works on browsers which support SMIL animation (Opera and FF3.7a4)</li>
</ul>
<p><a href="../lib-gwt-svg-edu">Lib-gwt-svg-edu</a> has its share of improvements too. The program takes advantage of GWT code splitting for better modularity. A brand new <a href="../lib-gwt-svg-edu/labyrinth">labyrinth game</a> has been added, featuring:</p>
<ul>
<li>DFS base algorithm and clean OO data structure to create labyrinths of arbitrary complexity.</li>
<li>SVG rendering of the labyrinth</li>
<li>Use of HTML5 canvas to rasterize the labyrinth to arbitrary shapes</li>
<li>Beautiful artwork, courtesy of the <a href="http://www.openclipart.org" title="Open Clip Art Project">Open Clip Art</a> project</li>
<li>SVG buttons</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/april-news/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More March Updates</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/more-march-updates</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/more-march-updates#comments</comments>
		<pubDate>Sun, 28 Mar 2010 14:38:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=387</guid>
		<description><![CDATA[<p>This post summarizes many new features and changes which have just been released today with an emphasis on ease of use.</p>
<p>GWT client bundle integration</p>
<p>A new SVGResource interface has been added for SVG resource. This lets developers embed their SVG images in the bulk of the GWT application code.</p>
<p>SVG Widgets and UiBinder integration</p>
<p>A new package has been [...]]]></description>
			<content:encoded><![CDATA[<p>This post summarizes many new features and changes which have just been released today with an emphasis on ease of use.</p>
<p><span style="text-decoration: underline;">GWT client bundle integration</span></p>
<p>A new <a href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/ui/SVGResource.html" title="SVGResource">SVGResource</a> interface has been added for SVG resource. This lets developers embed their SVG images in the bulk of the GWT application code.</p>
<p><span style="text-decoration: underline;">SVG Widgets and UiBinder integration</span></p>
<p>A new package has been created to group SVG widgets. Currently there is just a <a href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/ui/SVGImage.html" title="SVGImage">SVGImage</a> widget class. This class provides very good integration with UiBinder, and lets developers specify their SVG as a resource or directly by embedding it into the UiBinder template. In the latter case, this makes it possible to bind GWT variables to arbitrary SVG elements, add event handlers declaratively to arbitrary SVG elements, localize SVG, use obfuscated CSS with SVG&#8230; The <a title="lib-gwt-svg-samples demo" href="../gwt/lib-gwt-svg-samples/lib-gwt-svg-samples.html">lib-gwt-svg-samples</a> has been revamped to demonstrate these new features. It has been migrated from Java2Html to JHighlight and nows displays the UiBinder source code along with the Java Source code</p>
<p><span style="text-decoration: underline;">Documentation</span></p>
<p>Three new articles are now available</p>
<dl>
<dt><a title="svg tag to gwt class mapping" href="../lib-gwt-svg/svg-tag-to-gwt-class-mapping">svg tag to gwt class mapping</a></dt>
<dd>Shows how to svg tags map to lib-gwt-svg classes. Useful to know which type to use for your variables when writing UiBinder templates</dd>
<dt><a title="uibinder integration with lib gwt svg" href="../lib-gwt-svg//uibinder-integration-with-lib-gwt-svg">uibinder integration with lib gwt svg</a></dt>
<dd>A tutorial on how to use UiBinder with lib-gwt-svg</dd>
<dt><a title="svg event mapping" href="../lib-gwt-svg/svg-event-mapping">svg event mapping</a></dt>
<dd>Shows how svg events map to lib-gwt-svg classes</dd>
<dl></dl>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/more-march-updates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>March updates</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/march-updates</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/march-updates#comments</comments>
		<pubDate>Tue, 09 Mar 2010 19:56:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=305</guid>
		<description><![CDATA[<p>This post summarizes many new features and changes which have just been released today.</p>
<p>Dependency cleanup and standardization</p>
<p>All projects now depend on GWT 2.0.3 (instead of a 2.x trunk snapshot), including vectomatic which has migrated from 1.7.1 to 2.0.3</p>
<p>New features</p>
<p>lib-gwt-svg has upgraded to version 0.3 and provides better event handling, helper methods to make the code more [...]]]></description>
			<content:encoded><![CDATA[<p>This post summarizes many new features and changes which have just been released today.</p>
<p><span style="text-decoration: underline;">Dependency cleanup and standardization</span></p>
<p>All projects now depend on GWT 2.0.3 (instead of a 2.x trunk snapshot), including <a title="vectomatic" href="./vectomatic">vectomatic</a> which has migrated from 1.7.1 to 2.0.3</p>
<p><span style="text-decoration: underline;">New features</span></p>
<p><a title="lib-gwt-svg" href="./lib-gwt-svg">lib-gwt-svg</a> has upgraded to version 0.3 and provides better event handling, helper methods to make the code more concise, the capability to serialize SVG from the DOM tree, and of course bug fixes. All SVG dependent projects now use this later version and have been migrated to take advantage of them</p>
<p>A new subproject called <a title="lib-gwt-svg-edu" href="./lib-gwt-svg-edu">lib-gwt-svg-edu</a> is introduced. The goal is to build educational games for your children, functionally equivalent to what exists sometimes in Flash, but using nothing but standard techniques (SVG + javascript)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/march-updates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lib-gwt-svg goals and design</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/lib-gwt-svg-goals-and-design</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/lib-gwt-svg-goals-and-design#comments</comments>
		<pubDate>Sat, 06 Feb 2010 17:45:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=248</guid>
		<description><![CDATA[Library goals
<p>lib-gwt-svg tries to reach the following goals:</p>

Provide a clean, GWT-friendly API
Hide the  idiosyncrasies of vendor SVG implementations
Reuse existing GWT  features wherever possible to eliminate code duplication and impedance  mismatch
Stick to the W3C standard, unless it duplicates an  existing GWT feature or the GWT feature is too incomplete

Compatibility with SVG, W3C standards [...]]]></description>
			<content:encoded><![CDATA[<h2>Library goals</h2>
<p>lib-gwt-svg tries to reach the following goals:</p>
<ul>
<li>Provide a clean, GWT-friendly API</li>
<li>Hide the  idiosyncrasies of vendor SVG implementations</li>
<li>Reuse existing GWT  features wherever possible to eliminate code duplication and impedance  mismatch</li>
<li>Stick to the W3C standard, unless it duplicates an  existing GWT feature or the GWT feature is too incomplete</li>
</ul>
<h2>Compatibility with SVG, W3C standards and exitsing GWT APIs</h2>
<p>The <a href="http://www.w3.org/TR/SVG11/">SVG 1.1 specification</a> is  built on top of several other specifications. The following table lists  each specification, explains whether GWT already has an API addressing  it, and whether lib-gwt-svg chooses to reuse it or not. The following  subsections provide a more elaborate view of each table row.</p>
<table>
<tbody>
<tr>
<th> W3C  Standard</th>
<th> Goal</th>
<th> Pre-existing GWT APIs</th>
<th> Reuse  in lib-gwt-svg</th>
</tr>
<tr>
<td><a href="http://www.w3.org/TR/DOM-Level-2-Core/">DOM Level 2</a></td>
<td>Define  the base model to access the documents displayed by a browser</td>
<td><a title="com.google.gwt.dom.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/dom/client/package-summary.html">com.google.gwt.dom.client</a> defines overlay classes for low-level DOM programming.  <a title="com.google.gwt.user.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/package-summary.html">com.google.gwt.user.client</a> defines fundamental user-interface classes and also has an Element  class.</td>
<td>Mostly.</td>
</tr>
<tr>
<td><a href="http://www.w3.org/TR/DOM-Level-2-Views/">DOM Level 2 views</a></td>
<td>Provide  support for multiple views on the same document</td>
<td>No API</td>
<td>Not  supported currently</td>
</tr>
<tr>
<td><a href="http://www.w3.org/TR/DOM-Level-2-Events/">DOM Level 2 events</a></td>
<td>Define  the events occurring as one interacts with a browser document.</td>
<td>GWT  already has one low-level event model (<a title="DOM javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/DOM.html">com.google.gwt.user.client.DOM</a>)  and two high-level models: <a title="com.google.gwt.user.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/package-summary.html">com.google.gwt.user.client</a> (deprecated) and <a title="com.google.gwt.event.dom.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/event/dom/client/package-summary.html">com.google.gwt.event.dom.client</a></td>
<td>Mostly.</td>
</tr>
<tr>
<td><a href="http://www.w3.org/TR/REC-smil/">SMIL</a></td>
<td>Provide  support for animation and integration of multimedia content in DOM  document</td>
<td>GWT offers <a title="com.google.gwt.animation.client  javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/animation/client/package-summary.html">com.google.gwt.animation.client</a>.</td>
<td>No.</td>
</tr>
<tr>
<td><a href="http://www.w3.org/Style/CSS/">CSS</a></td>
<td>Define  the graphical styles used to render elements</td>
<td><a title="Style javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/dom/client/Style.html">com.google.gwt.dom.client.Style</a> provides Css style support.</td>
<td>Mostly.</td>
</tr>
<tr>
<td><a href="http://www.w3.org/TR/xlink/">XLink</a></td>
<td>Defines  linking between documents</td>
<td>GWT provides a <a title="Hyperlink javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/Hyperlink.html">com.google.gwt.user.client.ui.Hyperlink</a> which provides integration with History.</td>
<td>Not yet. Planned  History integration</td>
</tr>
</tbody>
</table>
<h3 id="HDOMLevel2">DOM  Level 2</h3>
<p>GWT has two hierarchies. The low-level class  hierarchy in <a title="com.google.gwt.dom.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/dom/client/package-summary.html">com.google.gwt.dom.client</a> consists mostly  in overlay types for HTML elements. The high-level class hierarchy in <a title="com.google.gwt.user.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/package-summary.html">com.google.gwt.user.client</a> consists in higher level widgets classes which wrap types of the first  hierarchy.</p>
<p>lib-gwt-svg uses a similar architecture. The types in <a title="org.vectomatic.dom.svg javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/package-summary.html">org.vectomatic.dom.svg.impl</a> forms the low-level implementation based on overlay types. You should  never have to use these types directly. The types in <a title="org.vectomatic.dom.svg.impl javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/impl/package-summary.html">org.vectomatic.dom.svg.impl</a> form the high level implementation which end-users manipulate.</p>
<p>End-users  only need to care about DOM Level 2 in the following scenarios:</p>
<ul>
<li>when  they need to insert their DOM tree in the HTML tree: lib-gwt-svg  automatically imports the node in the main document and  <a title="getElement javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMElement.html#getElement()">OMElement.getElement()</a> will return a GWT compatible class</li>
<li>when  they need to manipulate the DOM structure: the wrapper types provide  DOM-like methods to manipulate the DOM tree (<a title="appendChild javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMNode.html#appendChild(org.vectomatic.dom.svg.OMNode)">appendChild</a>, <a title="removeChild javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMNode.html#removeChild(org.vectomatic.dom.svg.OMNode)">removeChild</a>, <a title="insertBefore javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMNode.html#insertBefore(org.vectomatic.dom.svg.OMNode, org.vectomatic.dom.svg.OMNode)"> insertBefore</a>, &#8230;). Users should be careful when they use methods to  navigate the DOM tree (<a title="getNextSibling javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMNode.html#getNextSibling()">getNextSibling</a>, <a title="getElementById javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMDocument.html#getElementById(java.lang.String)">getElementById</a>, &#8230;). These  methods automatically build a wrapper type from the underlying overlay  type. While convenient, these method build a new wrapper every time they  are called. Thus end-users should either store the returned reference  for later use, or do their navigation on the overlay types and convert  to wrapper types when needed using OMNode.convert</li>
</ul>
<h3 id="HDOMLevel2events">DOM Level 2 events</h3>
<p>The GWT  event model is roughly structured like this: a low-level model registers  handlers and channels events through a central dispatcher. The  dispatcher sends events to a new and extensible event model. The new  event level is capable of emulating the deprecated event model.  lib-gwt-svg cannot reuse low-level model: it is indeed not extensible and  SVG has several events which are specific (onzoom, onrepeat,  onfocusin&#8230;). Thus this part is re-developed, and you should not try to  use event-related methods of <a title="DOM javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/DOM.html">com.google.gwt.user.client.DOM</a>.  lib-gwt-svg channels events to a central disptacher. The dispatcher sends  events to the GWT new event model. This provides compatibilty with  existing GWT APIs (notably, mouse event handlers are the same).  lib-gwt-svg extends the GWT event model with new classes corresponding to  new event types. No effort is made towards compatibility with the  deprecated GWT event model.</p>
<h3 id="HSMIL">SMIL</h3>
<p>GWT  offers <a title="com.google.gwt.animation.client  javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/animation/client/package-summary.html">com.google.gwt.animation.client</a>. It consists  mostly in timer management and is orthogonal to SMIL. Indeed, SVG SMIL  provides support for declarative animation, using animation elements  derived from ElementTimeControl. lib-gwt-svg integrates SMIL by providing  animation specific events integrated in the GWT event model. However  currently only Opera seems to implement them. lib-gwt-svg does not  preclude using <a title="com.google.gwt.animation.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/animation/client/package-summary.html">com.google.gwt.animation.client</a> to  update an SVG scene at periodic intervals. Actually, this seems like the  only approach to SVG animation today given the limitations of current  SVG implementations, Opera excepted.</p>
<h3 id="HCSS">CSS</h3>
<p>SVG  low-level class hierarchy in <a title="com.google.gwt.dom.client javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/dom/client/package-summary.html">com.google.gwt.dom.client</a> provide support for manipulating both the &#8216;style&#8217; and the &#8216;className&#8217;  CSS attributes. These mechanisms can be reused, but only up to a certain  point. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=374216">Bug 374216</a> is Firefox breaks the Style.getProperty() and Style.setProperty() on  SVG elements. The SVG model itself makes the className an<a title="OMSVGAnimatedString javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMSVGAnimatedString.html"> OMSVGAnimatedString</a> instead of a mere String. lib-gwt-svg defines an <a title="OMSVGStyle javadoc" href="..//mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMSVGStyle.html"> OMSVGStyle</a> overlay type derived from Style. It provides a pair of   getSVGProperty() and setSVGProperty() to bypass <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=374216">Bug 374216</a>.  lib-gwt-svg also defines a <a title="ISVGStylable javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/itf/ISVGStylable.html">IStylable</a> interface, which provides methods  equivalent to GWT for classname manipulation, but adapted to the  constraints of an <a title="OMSVGAnimatedString javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMSVGAnimatedString.html">OMSVGAnimatedString</a>.</p>
<h3 id="HXLink">XLink</h3>
<p>GWT  provides a <a title="Hyperlink javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/Hyperlink.html">com.google.gwt.user.client.ui.Hyperlink</a> which provides integration with History. This class cannot be reused,  but the same principles will be implemented in a future version to  provide integration between <a title="OMSVGAElement javadoc" href="../mvn-sites/lib-gwt-svg/apidocs/org/vectomatic/dom/svg/OMSVGAElement.html">OMSVGAlement</a> and <a title="History javadoc" href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/index.html?overview-summary.html">com.google.gwt.user.client.History</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/lib-gwt-svg-goals-and-design/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Vectomatic current state and future directions</title>
		<link>http://www.vectomatic.org/svg/vectomatic-current-state-and-future-directions</link>
		<comments>http://www.vectomatic.org/svg/vectomatic-current-state-and-future-directions#comments</comments>
		<pubDate>Wed, 02 Dec 2009 08:41:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML 5 canvas]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=94</guid>
		<description><![CDATA[<p>Vectomatic is a 2D vector graphics editor based on GWT and HTML 5 canvas. At the moment it is more of a demonstrator than a truly useful application.</p>
<p>What lessons did I learn from this first prototype ?</p>
<p>On the bright side, browsers are now quite fast and I think that a full featured editor is truly feasible. [...]]]></description>
			<content:encoded><![CDATA[<p>Vectomatic is a 2D vector graphics editor based on <a title="GWT home page" href="http://code.google.com/webtoolkit/">GWT</a> and <a title="HTML5 canvas spec" href="http://dev.w3.org/html5/spec/Overview.html#the-canvas-element">HTML 5 canvas</a>. At the moment it is more of a demonstrator than a truly useful application.</p>
<p>What lessons did I learn from this first prototype ?</p>
<p>On the bright side, browsers are now quite fast and I think that a full featured editor is truly feasible. Browsers can even provide the basis for advances in the UI for this kind of programs: for instance, in vectomatic, the compass-like widget enables working on documents from any orientation ; transparency effects keep the drawing visible when one moves elements around. Developing such an application within a browser enables leveraging the browser native  2D functionalities and reduces the amount of code which has to be written. Newer GWT technologies like <a title="code splitting" href="http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting">code splitting</a> enable the application to grow in size and load incrementally.</p>
<p>Regarding things which ought to be done differently, I see mostly two. <em>Lesson 1</em>: canvas is not the best technology for this kind of program, SVG makes much more sense in this area. SVG offers features which are  more advanced than canvas: things like pick correlation, gradients with an orientation, clipping, dashed lines, even animation; the persistence format is no longer an issue since SVG IS the format; it comes with a rich ecosystem of resources, libraries, tools and knowledgeable people. <em>Lesson 2:</em> GWT native library of widgets is the framework&#8217;s weak spot at the moment: there are not enough widgets and they are not good or customizable enough ; thus you need to rewrite a lot of code on your own (things like sliders or spinners); on the plus side, it now has the <a title="UiBinder" href="http://code.google.com/p/google-web-toolkit-incubator/wiki/UiBinder">UiBinder</a>, which does things the right way (like <a title="IB" href="http://fr.wikipedia.org/wiki/Interface_Builder">InterfaceBuilder</a> on NeXT, but with open formats). I see a parallel between GWT widgets library and AWT in the Java world. To get started on a large scale project, a more powerful widget library is needed. At the moment <a title="GXT home" href="http://www.extjs.com/products/gxt/">GXT</a> seems the more complete, but it comes with strings attached. I hope the GWT team comes up with a Swing or SWT of their own quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/svg/vectomatic-current-state-and-future-directions/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A chess engine in JavaScript: performance issues</title>
		<link>http://www.vectomatic.org/google-web-toolkit/a-chess-engine-in-javascript-performance-issues</link>
		<comments>http://www.vectomatic.org/google-web-toolkit/a-chess-engine-in-javascript-performance-issues#comments</comments>
		<pubDate>Tue, 01 Dec 2009 21:54:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>

		<guid isPermaLink="false">http://localhost/vectomatic/?p=95</guid>
		<description><![CDATA[<p>lib-gwt-svg-chess was originally developed as a demonstrator for lib-gwt-svg. I began by looking for a chess engine with the following requirements: java-based, maven project if possible, minimum dependencies on non GWT-compatible libs, clean design to allow refactoring if needed. There were several possible contenders (chessbox port of GNU-chess, chesspresso), but only Carballo matched all my criteria.</p>
<p>My [...]]]></description>
			<content:encoded><![CDATA[<p><a title="lib-gwt-svg-chess" href="../lib-gwt-svg-chess">lib-gwt-svg-chess</a> was originally developed as a demonstrator for <a title="lib-gwt-svg" href="../lib-gwt-svg">lib-gwt-svg</a>. I began by looking for a chess engine with the following requirements: java-based, maven project if possible, minimum dependencies on non GWT-compatible libs, clean design to allow refactoring if needed. There were several possible contenders (<a title="chessbox home" href="http://www.forthgo.com/chessbox/">chessbox</a> port of <a title="GNU chess home" href="http://www.gnu.org/software/chess/">GNU-chess</a>, <a title="chesspresso home" href="http://www.chesspresso.org/">chesspresso</a>), but only <a title="carballo home" href="http://www.alonsoruibal.com/dev/chess/">Carballo</a> matched all my criteria.</p>
<p>My first step was to refactor the code so as to extract all the non-GWT compatible parts to an external project (applet UI mostly, configuration, opening book reader). I added extra hooks to let me provide alternative implementations for the parts which could not work in a GWT context (opening book, configuration). The alternative refactored version has number  0.3.1, though it does not have any extra functionality compared to the original 0.3 version.</p>
<p>I wrote my UI and started my debugging in developer mode. Everything went fine and I thought I was almost done. Then I tried production mode and discovered the program did not even start.</p>
<p>It turns out that the problem was mostly a performance problem. For all the competition occurring between JavaScript engines, JavaScript performance is still considerably slower than Java. <a title="carballo home" href="http://www.alonsoruibal.com/dev/chess/">Carballo</a> starts by initializing what it calls &#8220;attack tables&#8221; (basically, a 100 000 element array of longs which represent chessboard configurations). In Java, this takes 0.5 seconds. If JavaScript, which lacks native longs and uses an emulation library, this step took 120 seconds. So I tried to trade time for space and decided to precompute the table as a large JSON structure which gets parsed at the beginning of the program. Contrary to the interpreters, the browsers javascript parsers are quite fast and I was down to 3 seconds for this part. However now the end user has to download a 3mb file full of longs just to initializa the program. Activating <a title="apache mod_deflate" href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html">mod_deflate</a> enables gaining some of this space back.</p>
<p>Another not yet solved issue is the issue of liveness. When the computer is thinking, one would like the UI to remain responsive. There are no threads in JavaScript, but the new <a title="web workers an MDC" href="https://developer.mozilla.org/En/Using_web_workers">web workers API</a> introduced in HTML5 could theoretically do the trick. Maybe that could work with extra hacking, but not out of the box, since GWT requires <a title=" On the topic of GWT intialization" href="../lib-gwt-svg/on-the-topic-of-gwt-intialization">special initialization code</a> which is not compatible with web workers (my biggest complaint about GWT at the moment)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/google-web-toolkit/a-chess-engine-in-javascript-performance-issues/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On the topic of GWT initialization</title>
		<link>http://www.vectomatic.org/lib-gwt-svg/on-the-topic-of-gwt-intialization</link>
		<comments>http://www.vectomatic.org/lib-gwt-svg/on-the-topic-of-gwt-intialization#comments</comments>
		<pubDate>Tue, 01 Dec 2009 08:44:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[lib-gwt-svg]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=60</guid>
		<description><![CDATA[<p>Ideally SVG ought to be embedded as a subtree inside an xhtml document, or be linked in an html document through an &#60;a href=&#8221;my.svg&#8221;&#62; tag. GWT would provide the logic to make these graphics dynamic&#8230;</p>
<p>However GWT initialization today is tightly linked to HTML and depends on a  procedure involving iframes to bootstrap the process. This means [...]]]></description>
			<content:encoded><![CDATA[<p>Ideally SVG ought to be embedded as a subtree inside an <a title="XHTML specification" href="http://www.w3.org/TR/xhtml1/">xhtml</a> document, or be linked in an html document through an <a title="HTML links" href="http://www.w3.org/TR/html401/struct/links.html">&lt;a href=&#8221;my.svg&#8221;&gt;</a> tag. GWT would provide the logic to make these graphics dynamic&#8230;</p>
<p>However GWT initialization today is tightly linked to HTML and depends on a  procedure involving iframes to bootstrap the process. This means you cannot currently use GWT code in another container than html. Too bad. If GWT code could live in other, javascript enabled containers (xhtml, svg, <a title="web workers specification" href="http://www.whatwg.org/specs/web-workers/current-work/">web workers</a>), it would greatly broaden its potential.</p>
<p>The most <a title="GWT post on GWT bootstrap" href="http://groups.google.com/group/google-web-toolkit-contributors/browse_thread/thread/1ccbfd663663e540/68b3b2a9b722d3c9?q=GWT+SVG#68b3b2a9b722d3c9">thorough analysis</a> (and even prototyping) of a generalized and open bootstrap process has been made by <a title="archie cobbs projects" href="http://code.google.com/u/archie.cobbs/">Archie Cobbs</a> but alas it has not seemed to raise all the attention it deserves from the GWT team. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.vectomatic.org/lib-gwt-svg/on-the-topic-of-gwt-intialization/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
