geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1341757 [9/10] - in /geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo: dijit/nls/ dijit/nls/ar/ dijit/nls/ca/ dijit/nls/cs/ dijit/nls/da/ dijit/nls/de/ dijit/nls/el/ dijit/nls/es/ dijit/nls/fi/ d...
Date Wed, 23 May 2012 06:24:37 GMT
Added: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/resources/svg2gfx.xsl
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/resources/svg2gfx.xsl?rev=1341757&view=auto
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/resources/svg2gfx.xsl (added)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/resources/svg2gfx.xsl Wed May 23 06:24:33 2012
@@ -0,0 +1,1085 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY SupportedElements "svg:a|svg:circle|svg:ellipse|svg:g|svg:image|svg:line|svg:path|svg:polygon|svg:polyline|svg:rect|svg:text|svg:textPath|svg:use">
+]>
+<!-- This is a complete rewrite of the original svg2gfx.xslt used for testing. -->
+<!--
+This version supports polygons, polylines, circles, ellipses, rectangles,
+lines, images, text, patterns, linear gradients, radial gradients, transforms
+(although gradient transforms are limited), and more in addition to the
+paths, strokes, groups, and constant fills supported by the original.  It
+even handles little niceties like the SVG use element.  All that being said,
+It does not even come close to supporting all of the features found in SVG,
+but should hopefully be a fairly useful subset.
+
+Caveats: Completely ignores many SVG features (such as named views, filters,
+object bounding box in gradient transforms, etc.).  Now requires properly
+formed SVG (that is, SVG using the appropriate SVG namespace) which most
+editors create by default these days anyhow (the old version required that
+namespaces be stripped off).  Can't convert to GFX constructs that cannot
+be reconstructed from JSON (such as textpath or using vector fonts).
+Requires EXSLT for many transforms. Handles nested styles in a simple way
+that is usually right but sometimes wrong.
+
+Questions / comments / bug reports can be sent to Feneric (on Twitter, IRC,
+GMail, etc.) or Eric (Saugus.net, ShellTown, etc.)
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+        xmlns:svg="http://www.w3.org/2000/svg"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:math="http://exslt.org/math"
+	xmlns:exsl="http://exslt.org/common"
+	xmlns:saxon="http://icl.com/saxon"
+	xmlns:xalan="http://xml.apache.org/Xalan"
+	extension-element-prefixes="math exsl saxon xalan">
+	<xsl:output method="text" version="1.0" encoding="UTF-8"/>
+	<xsl:strip-space elements="*"/>
+
+	<!-- We currently need this constant for some transformation calculations. -->
+	<!-- GFX enhancements could obviate it in the future. -->
+	<xsl:variable name="degressInRadian" select="57.295779513082322"/>
+	
+	<!-- The following templates process little bits of things that can often occur in multiple contexts -->
+	
+	<xsl:template name="kill-extra-spaces" mode="kill-extra-spaces">
+		<xsl:param name="string"/>
+		<!-- Some don't feel that SVG is verbose enough and thus add extra spaces, which when -->
+		<!-- untreated can look exactly like delimiters in point sets. -->
+		<xsl:choose>
+			<!-- Hopefully most cases won't have the extra spaces -->
+			<xsl:when test="not(contains($string,', '))">
+				<xsl:value-of select="$string"/>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- We split at comma / space pairs and recursively chop spaces -->
+				<xsl:call-template name="kill-extra-spaces">
+					<xsl:with-param name="string" select="substring-before($string,', ')"/>
+				</xsl:call-template>
+				<xsl:text>,</xsl:text>
+				<xsl:call-template name="kill-extra-spaces">
+					<xsl:with-param name="string" select="substring-after($string,', ')"/>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="arg-processor" mode="arg-processor">
+		<xsl:param name="values"/>
+		<xsl:param name="labels"/>
+		<!-- Recursively chew through the arguments in a traditional CAR / CDR pattern -->
+		<xsl:variable name="valuesCdr" select="substring-after($values,',')"/>
+		<!-- We're going "backwards" here to take advantage of tail recursion -->
+		<xsl:choose>
+			<xsl:when test="not($valuesCdr)">
+				<!-- handle the final argument -->
+				<xsl:value-of select="$labels"/>
+				<xsl:text>:</xsl:text>
+				<xsl:value-of select="$values"/>
+				<!-- This last trailing comma is needed in the (odd) case of multiple transforms -->
+				<xsl:text>,</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- handle the current argument -->
+				<xsl:value-of select="substring-before($labels,',')"/>
+				<xsl:text>:</xsl:text>
+				<xsl:value-of select="substring-before($values,',')"/>
+				<xsl:text>,</xsl:text>
+				<xsl:call-template name="arg-processor">
+					<xsl:with-param name="values" select="$valuesCdr"/>
+					<xsl:with-param name="labels" select="substring-after($labels,',')"/>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="background-processor" mode="background-processor">
+		<xsl:param name="background"/>
+		<xsl:choose>
+			<xsl:when test="starts-with($background,'url')">
+				<!-- Check if we have a URL (for a gradient or pattern) -->
+				<xsl:variable name="arguments" select="translate(normalize-space(substring-before(substring-after($background,'('),')')),' ',',')"/>
+				<xsl:call-template name="url-processor">
+					<xsl:with-param name="url" select="$arguments"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- We probably have a solid color. -->
+				<xsl:call-template name="color-processor">
+					<xsl:with-param name="color" select="$background"/>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="color-processor">
+		<xsl:param name="color"/>
+		<xsl:choose>
+			<xsl:when test="starts-with($color,'rgb')">
+				<!-- Check if we have an RGB triple -->
+				<xsl:variable name="arguments" select="normalize-space(substring-before(substring-after($color,'('),')'))"/>
+				<xsl:call-template name="rgb-triple-processor">
+					<xsl:with-param name="triple" select="$arguments"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="$color='none'">
+				<!-- Check if we have a literal 'none' -->
+				<!-- Literal nones seem to actually map to black in practice -->
+				<xsl:text>"#000000",</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- This color could either be by name or value.  Either way, we -->
+				<!-- have to ensure that there are no bogus semi-colons. -->
+				<xsl:text>"</xsl:text>
+				<xsl:value-of select="normalize-space(translate($color,';',' '))"/>
+				<xsl:text>",</xsl:text>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="point-processor" mode="point-processor">
+		<xsl:param name="points"/>
+		<!-- Recursively process points in a traditional CAR / CDR pattern -->
+		<xsl:variable name="pointsCdr" select="normalize-space(substring-after($points,' '))"/>
+		<!-- We're going "backwards" here to take advantage of tail recursion -->
+		<xsl:choose>
+			<xsl:when test="not($pointsCdr)">
+				<!-- handle the final argument -->
+				<xsl:text>{x:</xsl:text>
+				<xsl:value-of select="substring-before($points,',')"/>
+				<xsl:text>,y:</xsl:text>
+				<xsl:value-of select="substring-after($points,',')"/>
+				<xsl:text>},</xsl:text>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- handle the current argument -->
+				<xsl:variable name="pointsCar" select="substring-before($points,' ')"/>
+				<xsl:text>{x:</xsl:text>
+				<xsl:value-of select="substring-before($pointsCar,',')"/>
+				<xsl:text>,y:</xsl:text>
+				<xsl:value-of select="substring-after($pointsCar,',')"/>
+				<xsl:text>},</xsl:text>
+				<xsl:call-template name="point-processor">
+					<xsl:with-param name="points" select="$pointsCdr"/>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	
+	<xsl:template name="rgb-triple-processor" mode="rgb-triple-processor">
+		<xsl:param name="triple"/>
+		<!-- Note that as SVG triples cannot contain alpha values, we hardcode it to be fully opaque -->
+		<!-- This could theoretically be better handled by watching for fill-opacity -->
+		<xsl:variable name="red" select="substring-before($triple,',')"/>
+		<xsl:variable name="green" select="substring-before(substring-after($triple,concat($red,',')),',')"/>
+		<xsl:variable name="blue" select="substring-after($triple,concat($red,',',$green,','))"/>
+		<xsl:text>{"r":</xsl:text>
+		<xsl:value-of select="normalize-space($red)"/>
+		<xsl:text>,"g":</xsl:text>
+		<xsl:value-of select="normalize-space($green)"/>
+		<xsl:text>,"b":</xsl:text>
+		<xsl:value-of select="normalize-space($blue)"/>
+		<xsl:text>,"a":1},</xsl:text>
+	</xsl:template>
+	
+	<xsl:template name="styles-processor" mode="styles-processor">
+		<xsl:param name="styles"/>
+		<!-- Recursively chew through the styles in a traditional CAR / CDR pattern -->
+		<xsl:variable name="stylesCdr" select="substring-after($styles,';')"/>
+		<!-- We're going "backwards" here to take advantage of tail recursion -->
+		<xsl:choose>
+			<xsl:when test="not($stylesCdr)">
+				<!-- handle the final style -->
+				<xsl:attribute name="{normalize-space(substring-before($styles,':'))}">
+					<xsl:value-of select="normalize-space(substring-after($styles,':'))"/>
+				</xsl:attribute>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- handle the current style -->
+				<xsl:variable name="stylesCar" select="substring-before($styles,';')"/>
+				<xsl:attribute name="{normalize-space(substring-before($stylesCar,':'))}">
+					<xsl:value-of select="normalize-space(substring-after($stylesCar,':'))"/>
+				</xsl:attribute>
+				<xsl:call-template name="styles-processor">
+					<xsl:with-param name="styles" select="$stylesCdr"/>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template name="transform-processor" mode="transform-processor">
+		<xsl:param name="transforms"/>
+		<!-- Recursively chew through the transforms in a traditional CAR / CDR pattern -->
+		<xsl:variable name="transformsCdr" select="normalize-space(substring-after($transforms,')'))"/>
+		<xsl:variable name="arguments" select="translate(normalize-space(substring-before(substring-after($transforms,'('),')')),' ',',')"/>
+		<xsl:choose>
+			<!-- We only handle simple (i.e. nonoverlapping) chained transforms. -->
+			<!-- This covers most real-world cases, and exceptions are generally -->
+			<!-- hand-generated and can likewise be hand fixed. -->
+			<xsl:when test="starts-with($transforms,'matrix')">
+				<xsl:call-template name="arg-processor">
+					<xsl:with-param name="values" select="$arguments"/>
+					<xsl:with-param name="labels" select="string('xx,yx,xy,yy,dx,dy')"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="starts-with($transforms,'translate')">
+				<!-- If only one argument is provided, it's assumed for both -->
+				<xsl:choose>
+					<xsl:when test="contains($arguments,',')">
+						<xsl:call-template name="arg-processor">
+							<xsl:with-param name="values" select="$arguments"/>
+							<xsl:with-param name="labels" select="string('dx,dy')"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="arg-processor">
+							<xsl:with-param name="values" select="concat($arguments,',',$arguments)"/>
+							<xsl:with-param name="labels" select="string('dx,dy')"/>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="starts-with($transforms,'scale')">
+				<!-- If only one argument is provided, it's assumed for both -->
+				<xsl:choose>
+					<xsl:when test="contains($arguments,',')">
+						<xsl:call-template name="arg-processor">
+							<xsl:with-param name="values" select="$arguments"/>
+							<xsl:with-param name="labels" select="string('xx,yy')"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="arg-processor">
+							<xsl:with-param name="values" select="concat($arguments,',',$arguments)"/>
+							<xsl:with-param name="labels" select="string('xx,yy')"/>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="starts-with($transforms,'rotate')">
+				<!-- Kluge alert - we're redoing a function GFX aleady provides here because -->
+				<!-- GFX doesn't yet expose it to JSON input. It requires XSLT extensions, too. -->
+				<!-- If you don't have the extensions, comment the following out (bye bye rotate). -->
+				<xsl:choose>
+					<xsl:when test="function-available('math:sin') and function-available('math:cos')">
+						<xsl:variable name="sinOfAngle" select="math:sin($arguments div $degressInRadian)"/>
+						<xsl:variable name="cosOfAngle" select="math:cos($arguments div $degressInRadian)"/>
+						<xsl:variable name="subarguments" select="concat($cosOfAngle,',',-$sinOfAngle,',',$sinOfAngle,',',$cosOfAngle)"/>
+						<xsl:call-template name="arg-processor">
+							<xsl:with-param name="values" select="$subarguments"/>
+							<xsl:with-param name="labels" select="string('xx,yx,xy,yy')"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:message>
+							<xsl:text>exslt:sin and exslt:cos must be supported for a rotation.</xsl:text>
+						</xsl:message>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="starts-with($transforms,'skewX')">
+				<!-- Kluge alert - we're redoing a function GFX aleady provides here because -->
+				<!-- GFX doesn't yet expose it to JSON input. It requires XSLT extensions, too. -->
+				<!-- If you don't have the extensions, comment the following out (bye bye skewX). -->
+				<xsl:choose>
+					<xsl:when test="function-available('math:tan')">
+						<xsl:variable name="tanOfAngle" select="math:tan($arguments div $degressInRadian)"/>
+						<xsl:call-template name="arg-processor">
+							<xsl:with-param name="values" select="$tanOfAngle"/>
+							<xsl:with-param name="labels" select="string('xy')"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:message>
+							<xsl:text>exslt:tan must be supported for a skewX.</xsl:text>
+						</xsl:message>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="starts-with($transforms,'skewY')">
+				<!-- Kluge alert - we're redoing a function GFX aleady provides here because -->
+				<!-- GFX doesn't yet expose it to JSON input. It requires XSLT extensions, too. -->
+				<!-- If you don't have the extensions, comment the following out (bye bye skewY). -->
+				<xsl:choose>
+					<xsl:when test="function-available('math:tan')">
+						<xsl:variable name="tanOfAngle" select="math:tan($arguments div $degressInRadian)"/>
+						<xsl:call-template name="arg-processor">
+							<xsl:with-param name="values" select="$tanOfAngle"/>
+							<xsl:with-param name="labels" select="string('yx')"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:message>
+							<xsl:text>exslt:tan must be supported for a skewY.</xsl:text>
+						</xsl:message>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+		</xsl:choose>
+		<xsl:if test="$transformsCdr">
+			<!-- handle the other transforms -->
+			<xsl:call-template name="transform-processor">
+				<xsl:with-param name="transforms" select="$transformsCdr"/>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template name="url-processor" mode="url-processor">
+		<xsl:param name="url"/>
+		<xsl:param name="groupAttrs" select="''"/>
+		<!-- We can only handle local references; that's probably all we should get anyway -->
+		<xsl:if test="starts-with($url,'#')">
+			<xsl:apply-templates select="id(substring-after($url,'#'))">
+				<xsl:with-param name="groupAttrs" select="$groupAttrs"/>
+			</xsl:apply-templates>
+		</xsl:if>
+	</xsl:template>
+
+	<!-- The following templates help with gradient transforms -->
+
+	<!-- We're temporarily supporting a few SVG features that GFX does not currently support. -->
+	<!-- The biggest of these is gradient transforms; when GFX natively supports it all the -->
+	<!-- kluges made to support it here (including all the following code) should be removed. -->
+	
+	<xsl:template name="gradient-transform-helper" mode="gradient-transform-helper">
+		<!-- This nasty little routine helps gradient adjuster and can be -->
+		<!-- removed when GFX gets gradientTransform support. -->
+		<xsl:param name="cxa"/>
+		<xsl:param name="cya"/>
+		<xsl:param name="x1a"/>
+		<xsl:param name="y1a"/>
+		<xsl:param name="x2a"/>
+		<xsl:param name="y2a"/>
+		<xsl:param name="xx"/>
+		<xsl:param name="xy"/>
+		<xsl:param name="yx"/>
+		<xsl:param name="yy"/>
+		<xsl:param name="dx"/>
+		<xsl:param name="dy"/>
+		<xsl:choose>
+			<xsl:when test="local-name()='radialGradient'">
+				<xsl:variable name="cx" select="$xx*$cxa+$xy*$cya+$dx"/>
+				<xsl:text>cx:</xsl:text>
+				<xsl:value-of select="$cx"/>
+				<xsl:text>,</xsl:text>
+				<xsl:variable name="cy" select="$yx*$cxa+$yy*$cya+$dy"/>
+				<xsl:text>cy:</xsl:text>
+				<xsl:value-of select="$cy"/>
+				<xsl:text>,</xsl:text>
+				<!-- The results for r here are going to just be approximate -->
+				<xsl:variable name="r" select="($cx+$cy) div 2"/>
+				<xsl:text>r:</xsl:text>
+				<xsl:value-of select="$r"/>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:variable name="x1" select="$xx*$x1a+$xy*$y1a+$dx"/>
+				<xsl:text>x1:</xsl:text>
+				<xsl:value-of select="$x1"/>
+				<xsl:text>,</xsl:text>
+				<xsl:variable name="y1" select="$yx*$x1a+$yy*$y1a+$dy"/>
+				<xsl:text>y1:</xsl:text>
+				<xsl:value-of select="$y1"/>
+				<xsl:text>,</xsl:text>
+				<xsl:variable name="x2" select="$xx*$x2a+$xy*$y2a+$dx"/>
+				<xsl:text>x2:</xsl:text>
+				<xsl:value-of select="$x2"/>
+				<xsl:text>,</xsl:text>
+				<xsl:variable name="y2" select="$yx*$x2a+$yy*$y2a+$dy"/>
+				<xsl:text>y2:</xsl:text>
+				<xsl:value-of select="$y2"/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	
+	<xsl:template name="gradient-adjuster" mode="gradient-adjuster">
+		<xsl:param name="node"/>
+		<!-- This code is awful and only meant to serve until GFX gets gradientTransform support. -->
+		<!-- Once GFX does gradientTransforms, the following should be destroyed and forgotten. -->
+		<!-- While this support is better than nothing, it cannot 100% reproduce the effects -->
+		<!-- that true gradientTransform support in GFX could provide. -->
+		<xsl:choose>
+			<xsl:when test="starts-with($node/@gradientTransform,'matrix')">
+				<xsl:variable name="args" select="normalize-space(substring-before(substring-after($node/@gradientTransform,'matrix('),')'))"/>
+				<xsl:variable name="xx" select="substring-before($args,' ')"/>
+				<xsl:variable name="yx" select="substring-before(substring-after($args,' '),' ')"/>
+				<xsl:variable name="xy" select="substring-before(substring-after($args,concat($xx,' ',$yx,' ')),' ')"/>
+				<xsl:variable name="yy" select="substring-before(substring-after($args,concat($xx,' ',$yx,' ',$xy,' ')),' ')"/>
+				<xsl:variable name="dx" select="substring-before(substring-after($args,concat($xx,' ',$yx,' ',$xy,' ',$yy,' ')),' ')"/>
+				<xsl:variable name="dy" select="substring-after($args,concat($xx,' ',$yx,' ',$xy,' ',$yy,' ',$dx,' '))"/>
+				<xsl:call-template name="gradient-transform-helper">
+					<xsl:with-param name="cxa" select="$node/@cx"/>
+					<xsl:with-param name="cya" select="$node/@cy"/>
+					<xsl:with-param name="x1a" select="$node/@x1"/>
+					<xsl:with-param name="y1a" select="$node/@y1"/>
+					<xsl:with-param name="x2a" select="$node/@x2"/>
+					<xsl:with-param name="y2a" select="$node/@y2"/>
+					<xsl:with-param name="xx" select="$xx"/>
+					<xsl:with-param name="yx" select="$yx"/>
+					<xsl:with-param name="xy" select="$xy"/>
+					<xsl:with-param name="yy" select="$yy"/>
+					<xsl:with-param name="dx" select="$dx"/>
+					<xsl:with-param name="dy" select="$dy"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="starts-with($node/@gradientTransform,'translate')">
+				<xsl:variable name="args" select="normalize-space(substring-before(substring-after($node/@gradientTransform,'translate('),')'))"/>
+				<!-- If only one argument is provided, it's assumed for both -->
+				<xsl:choose>
+					<xsl:when test="contains($args,',')">
+						<xsl:call-template name="gradient-transform-helper">
+							<xsl:with-param name="cxa" select="$node/@cx"/>
+							<xsl:with-param name="cya" select="$node/@cy"/>
+							<xsl:with-param name="x1a" select="$node/@x1"/>
+							<xsl:with-param name="y1a" select="$node/@y1"/>
+							<xsl:with-param name="x2a" select="$node/@x2"/>
+							<xsl:with-param name="y2a" select="$node/@y2"/>
+							<xsl:with-param name="xx" select="1"/>
+							<xsl:with-param name="yx" select="0"/>
+							<xsl:with-param name="xy" select="1"/>
+							<xsl:with-param name="yy" select="0"/>
+							<xsl:with-param name="dx" select="substring-before($args,' ')"/>
+							<xsl:with-param name="dy" select="substring-after($args,' ')"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="gradient-transform-helper">
+							<xsl:with-param name="cxa" select="$node/@cx"/>
+							<xsl:with-param name="cya" select="$node/@cy"/>
+							<xsl:with-param name="x1a" select="$node/@x1"/>
+							<xsl:with-param name="y1a" select="$node/@y1"/>
+							<xsl:with-param name="x2a" select="$node/@x2"/>
+							<xsl:with-param name="y2a" select="$node/@y2"/>
+							<xsl:with-param name="xx" select="1"/>
+							<xsl:with-param name="yx" select="0"/>
+							<xsl:with-param name="xy" select="1"/>
+							<xsl:with-param name="yy" select="0"/>
+							<xsl:with-param name="dx" select="$args"/>
+							<xsl:with-param name="dy" select="$args"/>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:when test="starts-with($node/@gradientTransform,'scale')">
+				<xsl:variable name="args" select="normalize-space(substring-before(substring-after($node/@gradientTransform,'scale('),')'))"/>
+				<!-- If only one argument is provided, it's assumed for both -->
+				<xsl:choose>
+					<xsl:when test="contains($args,',')">
+						<xsl:call-template name="gradient-transform-helper">
+							<xsl:with-param name="cxa" select="$node/@cx"/>
+							<xsl:with-param name="cya" select="$node/@cy"/>
+							<xsl:with-param name="x1a" select="$node/@x1"/>
+							<xsl:with-param name="y1a" select="$node/@y1"/>
+							<xsl:with-param name="x2a" select="$node/@x2"/>
+							<xsl:with-param name="y2a" select="$node/@y2"/>
+							<xsl:with-param name="xx" select="substring-before($args,' ')"/>
+							<xsl:with-param name="yx" select="0"/>
+							<xsl:with-param name="xy" select="substring-after($args,' ')"/>
+							<xsl:with-param name="yy" select="0"/>
+							<xsl:with-param name="dx" select="0"/>
+							<xsl:with-param name="dy" select="0"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:call-template name="gradient-transform-helper">
+							<xsl:with-param name="cxa" select="$node/@cx"/>
+							<xsl:with-param name="cya" select="$node/@cy"/>
+							<xsl:with-param name="x1a" select="$node/@x1"/>
+							<xsl:with-param name="y1a" select="$node/@y1"/>
+							<xsl:with-param name="x2a" select="$node/@x2"/>
+							<xsl:with-param name="y2a" select="$node/@y2"/>
+							<xsl:with-param name="xx" select="$args"/>
+							<xsl:with-param name="yx" select="0"/>
+							<xsl:with-param name="xy" select="$args"/>
+							<xsl:with-param name="yy" select="0"/>
+							<xsl:with-param name="dx" select="0"/>
+							<xsl:with-param name="dy" select="0"/>
+						</xsl:call-template>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>	<!-- Otherwise it's got to be a rotation -->
+				<xsl:variable name="args" select="normalize-space(substring-before(substring-after($node/@gradientTransform,'rotate('),')'))"/>
+				<xsl:choose>
+					<xsl:when test="function-available('math:sin') and function-available('math:cos')">
+						<xsl:variable name="sinOfAngle" select="math:sin($args div $degressInRadian)"/>
+						<xsl:variable name="cosOfAngle" select="math:cos($args div $degressInRadian)"/>
+						<xsl:call-template name="gradient-transform-helper">
+							<xsl:with-param name="cxa" select="$node/@cx"/>
+							<xsl:with-param name="cya" select="$node/@cy"/>
+							<xsl:with-param name="x1a" select="$node/@x1"/>
+							<xsl:with-param name="y1a" select="$node/@y1"/>
+							<xsl:with-param name="x2a" select="$node/@x2"/>
+							<xsl:with-param name="y2a" select="$node/@y2"/>
+							<xsl:with-param name="xx" select="$cosOfAngle"/>
+							<xsl:with-param name="yx" select="-$sinOfAngle"/>
+							<xsl:with-param name="xy" select="$sinOfAngle"/>
+							<xsl:with-param name="yy" select="$cosOfAngle"/>
+							<xsl:with-param name="dy" select="0"/>
+							<xsl:with-param name="dy" select="0"/>
+						</xsl:call-template>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:message>
+							<xsl:text>exslt:sin and exslt:cos must be supported for a gradient rotation.</xsl:text>
+						</xsl:message>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>,</xsl:text>
+	</xsl:template>
+	
+	<!-- The following templates handle related batches of attributes -->
+	
+	<xsl:template name="font">
+		<xsl:param name="node"/>
+		<!-- Only include if we have at least some font properties defined -->
+		<xsl:if test="$node/@font-style or $node/@font-variant or $node/@font-weight or $node/@font-size or $node/@font-family">
+			<xsl:text>font:{ type:"font",</xsl:text>
+			<xsl:if test="$node/@font-style">
+				<xsl:text>style:"</xsl:text>
+				<xsl:value-of select="$node/@font-style"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:if test="$node/@font-variant">
+				<xsl:text>variant:"</xsl:text>
+				<xsl:value-of select="$node/@font-variant"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:if test="$node/@font-weight">
+				<xsl:text>weight:"</xsl:text>
+				<xsl:value-of select="$node/@font-weight"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:if test="$node/@font-size">
+				<xsl:text>size:"</xsl:text>
+				<xsl:value-of select="$node/@font-size"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:if test="$node/@font-family">
+				<xsl:text>family:"</xsl:text>
+				<xsl:value-of select="$node/@font-family"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:text>},</xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template name="stroke">
+		<xsl:param name="node"/>
+		<!-- Only include if we have at least some stroke properties defined -->
+		<xsl:if test="$node/@stroke or $node/@stroke-width or $node/@stroke-linecap or $node/@stroke-linejoin">
+			<xsl:text>stroke:{</xsl:text>
+			<!-- We don't currently handle stroke-dasharray or stroke-dashoffset -->
+			<!-- Note that while we'll pass stroke background info, GFX won't yet use it. -->
+			<xsl:if test="$node/@stroke">
+				<xsl:text>color:</xsl:text>
+				<xsl:call-template name="background-processor">
+					<xsl:with-param name="background" select="$node/@stroke"/>
+				</xsl:call-template>
+			</xsl:if>
+			<xsl:if test="$node/@stroke-width">
+				<xsl:text>width:"</xsl:text>
+				<xsl:value-of select="$node/@stroke-width"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:if test="$node/@stroke-linecap">
+				<xsl:text>cap:"</xsl:text>
+				<xsl:value-of select="$node/@stroke-linecap"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:if test="$node/@stroke-linejoin">
+				<xsl:text>join:"</xsl:text>
+				<xsl:value-of select="$node/@stroke-linejoin"/>
+				<xsl:text>",</xsl:text>
+			</xsl:if>
+			<xsl:choose>
+				<!-- This is really cheesy but better than nothing. -->
+				<!-- We probably ought to match a few specific cases when we can. %FIX% -->
+				<xsl:when test="$node/@stroke-dasharray">
+					<xsl:text>style:"Dash",</xsl:text>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:text>style:"Solid",</xsl:text>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:text>},</xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template name="common-attributes">
+		<xsl:param name="node"/>
+		<!-- Pretty much every shape has to handle this same batch of attributes. -->
+		<xsl:apply-templates select="$node/@style"/>
+		<!-- Note that we make no effort to guard against overlapping styles. -->
+		<xsl:apply-templates select="$node/@fill"/>
+		<xsl:call-template name="stroke">
+			<xsl:with-param name="node" select="$node"/>
+		</xsl:call-template>
+		<xsl:apply-templates select="$node/@transform"/>
+		<!-- Fonts are actually illegal in most shapes, but including them here doesn't -->
+		<!-- really slow things down much and does clean up code a bit for the shapes -->
+		<!-- that do allow them. -->
+		<xsl:call-template name="font">
+			<xsl:with-param name="node" select="$node"/>
+		</xsl:call-template>
+		<!-- Ditto for stop-colors. -->
+		<xsl:apply-templates select="$node/@stop-color"/>
+	</xsl:template>
+
+	<!-- SVG Attribute Handling -->
+	
+	<xsl:template match="@id">
+		<xsl:text>name:"</xsl:text>
+		<xsl:apply-templates/>
+		<xsl:text>",</xsl:text>
+	</xsl:template>
+	
+	<xsl:template match="@x|@y|@x1|@x2|@y1|@y2|@cx|@cy|@r|@rx|@ry|@fx|@fy|@width|@height|@offset">
+		<!-- Generic attribute followed by comma -->
+		<xsl:value-of select="local-name()"/>
+		<xsl:text>:</xsl:text>
+		<xsl:value-of select="."/>
+		<xsl:text>,</xsl:text>
+	</xsl:template>
+	
+	<xsl:template match="@d">
+		<!-- Used only by path objects; often has tons of extra whitespace -->
+		<xsl:text>path:"</xsl:text>
+		<xsl:value-of select="normalize-space(.)"/>
+		<xsl:text>",</xsl:text>
+	</xsl:template>
+	
+	<xsl:template match="@fill">
+		<!-- Used by most shapes and can have a URL, a solid color, or "none" -->
+		<xsl:if test=". != 'none'">
+			<xsl:text>fill:</xsl:text>
+			<xsl:call-template name="background-processor">
+				<xsl:with-param name="background" select="."/>
+			</xsl:call-template>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="@stop-color">
+		<xsl:call-template name="color-processor">
+			<xsl:with-param name="color" select="."/>
+		</xsl:call-template>
+	</xsl:template>
+
+	<xsl:template match="@style">
+		<!-- A style property is really a bunch of other properties crammed together. -->
+		<!-- We therefore make a dummy element and process it as normal. -->
+		<xsl:variable name="dummy">
+			<dummy>
+				<xsl:call-template name="styles-processor">
+					<xsl:with-param name="styles" select="."/>
+				</xsl:call-template>
+			</dummy>
+		</xsl:variable>
+		<xsl:choose>
+			<!-- Using a dummy element requires node-set capability. Straight XSLT 1.0 -->
+			<!-- lacks this, but pretty much every XSLT processor offers it as an extension. -->
+			<xsl:when test="function-available('exsl:node-set')">
+				<xsl:call-template name="common-attributes">
+					<xsl:with-param name="node" select="exsl:node-set($dummy)/dummy"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="function-available('saxon:node-set')">
+				<xsl:call-template name="common-attributes">
+					<xsl:with-param name="node" select="saxon:node-set($dummy)"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="function-available('xalan:nodeSet')">
+				<xsl:call-template name="common-attributes">
+					<xsl:with-param name="node" select="xalan:nodeSet($dummy)"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:message>
+					<xsl:text>exslt:node-set is required for processing the style attribute.</xsl:text>
+				</xsl:message>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+	<xsl:template match="@transform|@gradientTransform">
+		<!-- Several transform types are supported -->
+		<xsl:text>transform:{</xsl:text>
+		<xsl:call-template name="transform-processor">
+			<xsl:with-param name="transforms" select="."/>
+		</xsl:call-template>
+		<xsl:text>}</xsl:text>		
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<!-- SVG Element Handling -->
+	
+	<xsl:template match="svg:a">
+		<xsl:param name="groupAttrs" select="''"/>
+		<!-- Anchors are actually meaningless to us, but their contents should usually be processed. -->
+		<xsl:variable name="newGroupAttrs">
+			<xsl:value-of select="$groupAttrs"/>
+			<xsl:apply-templates select="@style"/>
+			<!-- Note that we make no effort to guard against overlapping styles; we just order -->
+			<!-- them to be consistent.  This naive approach will usually, but not always, work. -->
+			<xsl:apply-templates select="@fill"/>
+			<xsl:call-template name="stroke">
+				<xsl:with-param name="node" select="."/>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:apply-templates select="&SupportedElements;">
+			<xsl:with-param name="groupAttrs" select="$newGroupAttrs"/>
+		</xsl:apply-templates>
+	</xsl:template>
+
+	<xsl:template match="svg:circle">
+		<xsl:param name="groupAttrs" select="''"/>
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@id"/>
+		<xsl:text>shape:{type:"circle",</xsl:text>
+		<xsl:apply-templates select="@cx|@cy|@r"/>
+		<xsl:text>},</xsl:text>
+		<xsl:value-of select="$groupAttrs"/>
+		<xsl:call-template name="common-attributes">
+			<xsl:with-param name="node" select="."/>
+		</xsl:call-template>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:ellipse">
+		<xsl:param name="groupAttrs" select="''"/>
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@id"/>
+		<xsl:text>shape:{type:"ellipse",</xsl:text>
+		<xsl:apply-templates select="@cx|@cy|@rx|@ry"/>
+		<xsl:text>}</xsl:text>
+		<xsl:value-of select="$groupAttrs"/>
+		<xsl:call-template name="common-attributes">
+			<xsl:with-param name="node" select="."/>
+		</xsl:call-template>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:g">
+		<xsl:param name="groupAttrs" select="''"/>
+		<!-- The basic grouping type can contain shapes, other groups, and have a transform -->
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@id"/>
+		<xsl:text>children:[</xsl:text>
+		<!-- Note that GFX does not yet support fills etc. on a group, even though SVG does. -->
+		<!-- It's a planned enhancement though, so when GFX gets the ability to handle these, -->
+		<!-- remove the following ten lines and stop propagating groupAttrs. -->
+		<xsl:variable name="newGroupAttrs">
+			<xsl:value-of select="$groupAttrs"/>
+			<xsl:apply-templates select="@style"/>
+			<!-- Note that we make no effort to guard against overlapping styles; we just order -->
+			<!-- them to be consistent.  This naive approach will usually, but not always, work. -->
+			<xsl:apply-templates select="@fill"/>
+			<xsl:call-template name="stroke">
+				<xsl:with-param name="node" select="."/>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:apply-templates select="&SupportedElements;">
+			<xsl:with-param name="groupAttrs" select="$newGroupAttrs"/>
+		</xsl:apply-templates>
+		<xsl:text>]</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+		<!-- When GFX gets group fills etc., remove the following line and uncomment the ones below. -->
+		<xsl:apply-templates select="@transform"/>
+		<!--<xsl:call-template name="common-attributes">-->
+		<!--	<xsl:with-param name="node" select="."/>-->
+		<!--</xsl:call-template>-->
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:image">
+		<xsl:param name="groupAttrs" select="''"/>
+		<!-- Note that images must be GIF, JPEG, or PNG. -->
+		<xsl:if test="not(parent::pattern)">
+			<!-- When being used as a background pattern we don't want type info. -->
+			<xsl:text>{</xsl:text>
+			<xsl:apply-templates select="@id"/>
+			<xsl:text>shape:{type:"image",</xsl:text>
+		</xsl:if>
+		<xsl:apply-templates select="@x|@y|@width|@height"/>
+		<xsl:text>src:"</xsl:text>
+		<xsl:value-of select="@xlink:href"/>
+		<xsl:text>",</xsl:text>
+		<xsl:if test="not(parent::pattern)">
+			<xsl:text>},</xsl:text>
+			<xsl:value-of select="$groupAttrs"/>
+			<xsl:call-template name="common-attributes">
+				<xsl:with-param name="node" select="."/>
+			</xsl:call-template>
+			<xsl:text>},</xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:line">
+		<xsl:param name="groupAttrs" select="''"/>
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@id"/>
+		<xsl:text>shape:{type:"line",</xsl:text>
+		<xsl:apply-templates select="@x1|@y1|@x2|@y2"/>
+		<xsl:text>},</xsl:text>
+		<xsl:value-of select="$groupAttrs"/>
+		<xsl:call-template name="common-attributes">
+			<xsl:with-param name="node" select="."/>
+		</xsl:call-template>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:linearGradient">
+		<xsl:text>{type:"linear",</xsl:text>
+		<!-- Kluge alert - GFX doesn't handle gradientTransforms. We can help in -->
+		<!-- the common case of matrix transforms in user space. Other cases we ignore. -->
+		<!-- Even for this one case the results aren't anywhere near as good as real support in GFX. -->
+		<xsl:choose>
+			<!-- Kluge alert - this code is only meant to serve until GFX gets gradientTransform support. -->
+			<!-- Once GFX does gradientTransforms, only the straight apply-templates should be kept. -->
+			<xsl:when test="starts-with(@gradientTransform,'matrix') and @gradientUnits='userSpaceOnUse'">
+				<xsl:call-template name="gradient-adjuster">
+					<xsl:with-param name="node" select="."/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="@x1|@x2|@y1|@y2"/>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>colors:[</xsl:text>
+		<xsl:apply-templates select="svg:stop"/>
+		<!-- Unfortunately GFX doesn't do gradientTransforms. -->
+		<!-- Uncommenting the following would support it here. -->
+		<!-- <xsl:apply-templates select="@x1|@x2|@y1|@y2"/> -->
+		<!-- <xsl:apply-templates select="@gradientTransform"/> -->
+		<xsl:text>]}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:path">
+		<xsl:param name="groupAttrs" select="''"/>
+		<xsl:if test="not(parent::textpath)">
+			<!-- When being used within a textpath we don't want type info. -->
+			<xsl:text>{</xsl:text>
+			<xsl:apply-templates select="@id"/>
+			<xsl:text>shape:{type:"path",</xsl:text>
+		</xsl:if>
+		<xsl:apply-templates select="@d"/>
+		<xsl:if test="not(parent::textpath)">
+			<xsl:text>},</xsl:text>
+			<xsl:value-of select="$groupAttrs"/>
+			<xsl:call-template name="common-attributes">
+				<xsl:with-param name="node" select="."/>
+			</xsl:call-template>
+			<xsl:text>},</xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:pattern">
+		<!-- GFX only seems to handle image pattern type fills, so that's all we do -->
+		<xsl:text>{type:"pattern",</xsl:text>
+		<xsl:apply-templates select="@width|@height|@xlink:href"/>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:polygon|svg:polyline">
+		<xsl:param name="groupAttrs" select="''"/>
+		<!-- Polygons are mostly treated as polylines -->
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@id"/>
+		<xsl:text>shape:{type:"polyline",points:[</xsl:text>
+		<!-- We just have to ensure that endpoints match for a polygon; it's assumed in SVG -->
+		<xsl:variable name="seminormalizedPoints" select="normalize-space(@points)"/>
+		<xsl:variable name="normalizedPoints">
+			<xsl:call-template name="kill-extra-spaces">
+				<xsl:with-param name="string" select="$seminormalizedPoints"/>
+			</xsl:call-template>
+		</xsl:variable>
+		<xsl:variable name="firstPoint" select="substring-before($normalizedPoints,' ')"/>
+		<xsl:choose>
+			<xsl:when test="contains(local-name(),'polygon') and
+				$firstPoint!=substring($normalizedPoints,string-length($normalizedPoints)-string-length($firstPoint)+1)">
+				<xsl:call-template name="point-processor">
+					<xsl:with-param name="points" select="concat($normalizedPoints,' ',$firstPoint)"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:call-template name="point-processor">
+					<xsl:with-param name="points" select="$normalizedPoints"/>
+				</xsl:call-template>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>]},</xsl:text>
+		<xsl:value-of select="$groupAttrs"/>
+		<xsl:call-template name="common-attributes">
+			<xsl:with-param name="node" select="."/>
+		</xsl:call-template>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:radialGradient">
+		<xsl:text>{type:"radial",</xsl:text>
+		<!-- Kluge alert - GFX doesn't handle gradientTransforms. We can help in -->
+		<!-- the common case of matrix transforms in user space. Other cases we ignore. -->
+		<!-- Even for this one case the results aren't anywhere near as good as real support in GFX. -->
+		<xsl:choose>
+			<!-- Kluge alert - this code is only meant to serve until GFX gets gradientTransform support. -->
+			<!-- Once GFX does gradientTransforms, only the straight apply-templates should be kept. -->
+			<xsl:when test="starts-with(@gradientTransform,'matrix') and @gradientUnits='userSpaceOnUse'">
+				<xsl:call-template name="gradient-adjuster">
+					<xsl:with-param name="node" select="."/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="@cx|@cy|@r"/>
+			</xsl:otherwise>
+		</xsl:choose>
+		<!-- GFX doesn't currently support fx & fy -->
+		<!-- Uncommenting the following would support it here. -->
+		<!-- <xsl:apply-templates select="@fx|@fy"/> -->
+		<xsl:text>colors:[</xsl:text>
+		<xsl:apply-templates select="svg:stop"/>
+		<!-- Unfortunately GFX doesn't do gradientTransforms. -->
+		<!-- Uncommenting the following would support it here. -->
+		<!-- <xsl:apply-templates select="@cx|@cy|@r"/> -->
+		<!-- <xsl:apply-templates select="@gradientTransform"/> -->
+		<xsl:text>]}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:rect">
+		<xsl:param name="groupAttrs" select="''"/>
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@id"/>
+		<xsl:text>shape:{type:"rect",</xsl:text>
+		<xsl:apply-templates select="@x|@y|@width|@height"/>
+		<xsl:if test="@rx and @ry">
+			<!-- Do approximate rounded corners if both an rx and ry are present. -->
+			<xsl:variable name="r" select="(@rx+@ry) div 2"/>
+			<xsl:text>r:</xsl:text>
+			<xsl:value-of select="$r"/>
+		</xsl:if>
+		<xsl:text>},</xsl:text>
+		<xsl:value-of select="$groupAttrs"/>
+		<xsl:call-template name="common-attributes">
+			<xsl:with-param name="node" select="."/>
+		</xsl:call-template>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:stop">
+		<!-- Both gradient types use the same sort of stops -->
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@offset"/>
+		<xsl:text>color:</xsl:text>
+		<xsl:apply-templates select="@style"/>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+
+	<xsl:template match="svg:text|svg:textPath">
+		<xsl:param name="groupAttrs" select="''"/>
+		<!-- Support for textPath is not functional as GFX doesn't seem to have a -->
+		<!-- complete serialized form at this time. %FIX% -->
+		<xsl:text>{</xsl:text>
+		<xsl:apply-templates select="@id"/>
+		<xsl:choose>
+			<xsl:when test="contains(local-name(),'textpath')">
+				<xsl:text>shape:{type:"textpath",text:"</xsl:text>
+				<xsl:apply-templates/>
+				<xsl:text>",</xsl:text>
+				<xsl:variable name="arguments" select="translate(normalize-space(substring-before(substring-after(@xlink:href,'('),')')),' ',',')"/>
+				<xsl:call-template name="url-processor">
+					<xsl:with-param name="url" select="$arguments"/>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:otherwise>
+				<!-- Regular text has slightly different attributes -->
+				<xsl:choose>
+					<!-- It's possible for a text element to contain a textpath element. -->
+					<xsl:when test="not(textpath)">
+						<xsl:text>shape:{type:"text",text:"</xsl:text>
+						<xsl:apply-templates/>
+						<xsl:text>",</xsl:text>
+						<xsl:apply-templates select="@x|@y"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates/>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:text>},</xsl:text>
+		<!-- Kluge alert - if no fill is defined, GFX won't display anything -->
+		<!-- Our quick fix here is to force a fill of some sort. -->
+		<xsl:if test="not(@fill)">
+			<xsl:text>fill:"#000000",</xsl:text>
+		</xsl:if>
+		<xsl:value-of select="$groupAttrs"/>
+		<xsl:call-template name="common-attributes">
+			<xsl:with-param name="node" select="."/>
+		</xsl:call-template>
+		<xsl:text>}</xsl:text>
+		<xsl:if test="not(position()=last())"> 
+			<xsl:text >,</xsl:text> 
+		</xsl:if>
+	</xsl:template>
+	
+	<xsl:template match="svg:use">
+		<xsl:param name="groupAttrs" select="''"/>
+		<!-- Use just refers to an existing element, essentially duplicating it. -->
+		<xsl:variable name="newGroupAttrs">
+			<xsl:value-of select="$groupAttrs"/>
+			<xsl:apply-templates select="@style"/>
+			<!-- Note that we make no effort to guard against overlapping styles; we just order -->
+			<!-- them to be consistent.  This naive approach will usually, but not always, work. -->
+			<xsl:apply-templates select="@fill"/>
+			<xsl:call-template name="stroke">
+				<xsl:with-param name="node" select="."/>
+			</xsl:call-template>
+			<xsl:apply-templates select="@transform"/>
+		</xsl:variable>
+		<xsl:call-template name="url-processor">
+			<xsl:with-param name="url" select="normalize-space(@xlink:href)"/>
+			<xsl:with-param name="groupAttrs" select="$newGroupAttrs"/>
+		</xsl:call-template>
+	</xsl:template>
+
+	<!-- The main SVG element itself -->
+	
+	<xsl:template match="/svg:svg">
+		<xsl:text>[</xsl:text>
+		<xsl:apply-templates select="&SupportedElements;"/>
+		<xsl:text>]</xsl:text>
+	</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/resources/svg2gfx.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/resources/svg2gfx.xsl
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/resources/svg2gfx.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/shape.js
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/shape.js?rev=1341757&view=auto
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/shape.js (added)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/shape.js Wed May 23 06:24:33 2012
@@ -0,0 +1,8 @@
+/*
+	Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
+	Available via Academic Free License >= 2.1 OR the modified BSD license.
+	see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.gfx.shape"]){dojo._hasResource["dojox.gfx.shape"]=true;dojo.provide("dojox.gfx.shape");dojo.require("dojox.gfx._base");dojo.declare("dojox.gfx.Shape",null,{constructor:function(){this.rawNode=null;this.shape=null;this.matrix=null;this.fillStyle=null;this.strokeStyle=null;this.bbox=null;this.parent=null;this.parentMatrix=null;},getNode:function(){return this.rawNode;},getShape:function(){return this.shape;},getTransform:function(){return this.matrix;},getFill:function(){return this.fillStyle;},getStroke:function(){return this.strokeStyle;},getParent:function(){return this.parent;},getBoundingBox:function(){return this.bbox;},getTransformedBoundingBox:function(){var b=this.getBoundingBox();if(!b){return null;}var m=this._getRealMatrix();gm=dojox.gfx.matrix;return [gm.multiplyPoint(m,b.x,b.y),gm.multiplyPoint(m,b.x+b.width,b.y),gm.multiplyPoint(m,b.x+b.width,b.y+b.height),gm.multiplyPoint(m,b.x,b.y+b.height)];},getEventSource:function(){return this.
 rawNode;},setShape:function(_1){this.shape=dojox.gfx.makeParameters(this.shape,_1);this.bbox=null;return this;},setFill:function(_2){if(!_2){this.fillStyle=null;return this;}var f=null;if(typeof (_2)=="object"&&"type" in _2){switch(_2.type){case "linear":f=dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient,_2);break;case "radial":f=dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient,_2);break;case "pattern":f=dojox.gfx.makeParameters(dojox.gfx.defaultPattern,_2);break;}}else{f=dojox.gfx.normalizeColor(_2);}this.fillStyle=f;return this;},setStroke:function(_3){if(!_3){this.strokeStyle=null;return this;}if(typeof _3=="string"||dojo.isArray(_3)||_3 instanceof dojo.Color){_3={color:_3};}var s=this.strokeStyle=dojox.gfx.makeParameters(dojox.gfx.defaultStroke,_3);s.color=dojox.gfx.normalizeColor(s.color);return this;},setTransform:function(_4){this.matrix=dojox.gfx.matrix.clone(_4?dojox.gfx.matrix.normalize(_4):dojox.gfx.matrix.identity);return this._applyTransform();},
 _applyTransform:function(){return this;},moveToFront:function(){var p=this.getParent();if(p){p._moveChildToFront(this);this._moveToFront();}return this;},moveToBack:function(){var p=this.getParent();if(p){p._moveChildToBack(this);this._moveToBack();}return this;},_moveToFront:function(){},_moveToBack:function(){},applyRightTransform:function(_5){return _5?this.setTransform([this.matrix,_5]):this;},applyLeftTransform:function(_6){return _6?this.setTransform([_6,this.matrix]):this;},applyTransform:function(_7){return _7?this.setTransform([this.matrix,_7]):this;},removeShape:function(_8){if(this.parent){this.parent.remove(this,_8);}return this;},_setParent:function(_9,_a){this.parent=_9;return this._updateParentMatrix(_a);},_updateParentMatrix:function(_b){this.parentMatrix=_b?dojox.gfx.matrix.clone(_b):null;return this._applyTransform();},_getRealMatrix:function(){var m=this.matrix;var p=this.parent;while(p){if(p.matrix){m=dojox.gfx.matrix.multiply(p.matrix,m);}p=p.parent;}ret
 urn m;}});dojox.gfx.shape._eventsProcessing={connect:function(_c,_d,_e){return arguments.length>2?dojo.connect(this.getEventSource(),_c,_d,_e):dojo.connect(this.getEventSource(),_c,_d);},disconnect:function(_f){dojo.disconnect(_f);}};dojo.extend(dojox.gfx.Shape,dojox.gfx.shape._eventsProcessing);dojox.gfx.shape.Container={_init:function(){this.children=[];},openBatch:function(){},closeBatch:function(){},add:function(_10){var _11=_10.getParent();if(_11){_11.remove(_10,true);}this.children.push(_10);return _10._setParent(this,this._getRealMatrix());},remove:function(_12,_13){for(var i=0;i<this.children.length;++i){if(this.children[i]==_12){if(_13){}else{_12.parent=null;_12.parentMatrix=null;}this.children.splice(i,1);break;}}return this;},clear:function(){this.children=[];return this;},_moveChildToFront:function(_14){for(var i=0;i<this.children.length;++i){if(this.children[i]==_14){this.children.splice(i,1);this.children.push(_14);break;}}return this;},_moveChildToBack:functio
 n(_15){for(var i=0;i<this.children.length;++i){if(this.children[i]==_15){this.children.splice(i,1);this.children.unshift(_15);break;}}return this;}};dojo.declare("dojox.gfx.shape.Surface",null,{constructor:function(){this.rawNode=null;this._parent=null;this._nodes=[];this._events=[];},destroy:function(){dojo.forEach(this._nodes,dojo.destroy);this._nodes=[];dojo.forEach(this._events,dojo.disconnect);this._events=[];this.rawNode=null;if(dojo.isIE){while(this._parent.lastChild){dojo.destroy(this._parent.lastChild);}}else{this._parent.innerHTML="";}this._parent=null;},getEventSource:function(){return this.rawNode;},_getRealMatrix:function(){return null;},isLoaded:true,onLoad:function(_16){},whenLoaded:function(_17,_18){var f=dojo.hitch(_17,_18);if(this.isLoaded){f(this);}else{var h=dojo.connect(this,"onLoad",function(_19){dojo.disconnect(h);f(_19);});}}});dojo.extend(dojox.gfx.shape.Surface,dojox.gfx.shape._eventsProcessing);dojo.declare("dojox.gfx.Point",null,{});dojo.declare("
 dojox.gfx.Rectangle",null,{});dojo.declare("dojox.gfx.shape.Rect",dojox.gfx.Shape,{constructor:function(_1a){this.shape=dojox.gfx.getDefault("Rect");this.rawNode=_1a;},getBoundingBox:function(){return this.shape;}});dojo.declare("dojox.gfx.shape.Ellipse",dojox.gfx.Shape,{constructor:function(_1b){this.shape=dojox.gfx.getDefault("Ellipse");this.rawNode=_1b;},getBoundingBox:function(){if(!this.bbox){var _1c=this.shape;this.bbox={x:_1c.cx-_1c.rx,y:_1c.cy-_1c.ry,width:2*_1c.rx,height:2*_1c.ry};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Circle",dojox.gfx.Shape,{constructor:function(_1d){this.shape=dojox.gfx.getDefault("Circle");this.rawNode=_1d;},getBoundingBox:function(){if(!this.bbox){var _1e=this.shape;this.bbox={x:_1e.cx-_1e.r,y:_1e.cy-_1e.r,width:2*_1e.r,height:2*_1e.r};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Line",dojox.gfx.Shape,{constructor:function(_1f){this.shape=dojox.gfx.getDefault("Line");this.rawNode=_1f;},getBoundingBox:function(){if(!this.bbox
 ){var _20=this.shape;this.bbox={x:Math.min(_20.x1,_20.x2),y:Math.min(_20.y1,_20.y2),width:Math.abs(_20.x2-_20.x1),height:Math.abs(_20.y2-_20.y1)};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Polyline",dojox.gfx.Shape,{constructor:function(_21){this.shape=dojox.gfx.getDefault("Polyline");this.rawNode=_21;},setShape:function(_22,_23){if(_22&&_22 instanceof Array){dojox.gfx.Shape.prototype.setShape.call(this,{points:_22});if(_23&&this.shape.points.length){this.shape.points.push(this.shape.points[0]);}}else{dojox.gfx.Shape.prototype.setShape.call(this,_22);}return this;},_normalizePoints:function(){var p=this.shape.points,l=p&&p.length;if(l&&typeof p[0]=="number"){var _24=[];for(var i=0;i<l;i+=2){_24.push({x:p[i],y:p[i+1]});}this.shape.points=_24;}},getBoundingBox:function(){if(!this.bbox&&this.shape.points.length){var p=this.shape.points;var l=p.length;var t=p[0];var _25={l:t.x,t:t.y,r:t.x,b:t.y};for(var i=1;i<l;++i){t=p[i];if(_25.l>t.x){_25.l=t.x;}if(_25.r<t.x){_25.r=t.
 x;}if(_25.t>t.y){_25.t=t.y;}if(_25.b<t.y){_25.b=t.y;}}this.bbox={x:_25.l,y:_25.t,width:_25.r-_25.l,height:_25.b-_25.t};}return this.bbox;}});dojo.declare("dojox.gfx.shape.Image",dojox.gfx.Shape,{constructor:function(_26){this.shape=dojox.gfx.getDefault("Image");this.rawNode=_26;},getBoundingBox:function(){return this.shape;},setStroke:function(){return this;},setFill:function(){return this;}});dojo.declare("dojox.gfx.shape.Text",dojox.gfx.Shape,{constructor:function(_27){this.fontStyle=null;this.shape=dojox.gfx.getDefault("Text");this.rawNode=_27;},getFont:function(){return this.fontStyle;},setFont:function(_28){this.fontStyle=typeof _28=="string"?dojox.gfx.splitFontString(_28):dojox.gfx.makeParameters(dojox.gfx.defaultFont,_28);this._setFont();return this;}});dojox.gfx.shape.Creator={createShape:function(_29){var gfx=dojox.gfx;switch(_29.type){case gfx.defaultPath.type:return this.createPath(_29);case gfx.defaultRect.type:return this.createRect(_29);case gfx.defaultCircle.t
 ype:return this.createCircle(_29);case gfx.defaultEllipse.type:return this.createEllipse(_29);case gfx.defaultLine.type:return this.createLine(_29);case gfx.defaultPolyline.type:return this.createPolyline(_29);case gfx.defaultImage.type:return this.createImage(_29);case gfx.defaultText.type:return this.createText(_29);case gfx.defaultTextPath.type:return this.createTextPath(_29);}return null;},createGroup:function(){return this.createObject(dojox.gfx.Group);},createRect:function(_2a){return this.createObject(dojox.gfx.Rect,_2a);},createEllipse:function(_2b){return this.createObject(dojox.gfx.Ellipse,_2b);},createCircle:function(_2c){return this.createObject(dojox.gfx.Circle,_2c);},createLine:function(_2d){return this.createObject(dojox.gfx.Line,_2d);},createPolyline:function(_2e){return this.createObject(dojox.gfx.Polyline,_2e);},createImage:function(_2f){return this.createObject(dojox.gfx.Image,_2f);},createText:function(_30){return this.createObject(dojox.gfx.Text,_30);},c
 reatePath:function(_31){return this.createObject(dojox.gfx.Path,_31);},createTextPath:function(_32){return this.createObject(dojox.gfx.TextPath,{}).setText(_32);},createObject:function(_33,_34){return null;}};}
\ No newline at end of file

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/shape.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/shape.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/shape.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight.js
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight.js?rev=1341757&view=auto
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight.js (added)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight.js Wed May 23 06:24:33 2012
@@ -0,0 +1,8 @@
+/*
+	Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
+	Available via Academic Free License >= 2.1 OR the modified BSD license.
+	see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.gfx.silverlight"]){dojo._hasResource["dojox.gfx.silverlight"]=true;dojo.provide("dojox.gfx.silverlight");dojo.require("dojox.gfx._base");dojo.require("dojox.gfx.shape");dojo.require("dojox.gfx.path");dojo.experimental("dojox.gfx.silverlight");dojox.gfx.silverlight.dasharray={solid:"none",shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,1,1,1,1,1],dot:[1,3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]};dojox.gfx.silverlight.fontweight={normal:400,bold:700};dojox.gfx.silverlight.caps={butt:"Flat",round:"Round",square:"Square"};dojox.gfx.silverlight.joins={bevel:"Bevel",round:"Round"};dojox.gfx.silverlight.fonts={serif:"Times New Roman",times:"Times New Roman","sans-serif":"Arial",helvetica:"Arial",monotone:"Courier New",courier:"Courier New"};dojox.gfx.silverlight.hexColor=function(_1){var c=dojox.gfx.normalizeColor(_1),t=c.toHex(),a=Math.round(c.a*255);a=(a<0?0:a>255?255:a).
 toString(16);return "#"+(a.length<2?"0"+a:a)+t.slice(1);};dojo.extend(dojox.gfx.Shape,{setFill:function(_2){var p=this.rawNode.getHost().content,r=this.rawNode,f;if(!_2){this.fillStyle=null;this._setFillAttr(null);return this;}if(typeof (_2)=="object"&&"type" in _2){switch(_2.type){case "linear":this.fillStyle=f=dojox.gfx.makeParameters(dojox.gfx.defaultLinearGradient,_2);var _3=p.createFromXaml("<LinearGradientBrush/>");_3.mappingMode="Absolute";_3.startPoint=f.x1+","+f.y1;_3.endPoint=f.x2+","+f.y2;dojo.forEach(f.colors,function(c){var t=p.createFromXaml("<GradientStop/>");t.offset=c.offset;t.color=dojox.gfx.silverlight.hexColor(c.color);_3.gradientStops.add(t);});this._setFillAttr(_3);break;case "radial":this.fillStyle=f=dojox.gfx.makeParameters(dojox.gfx.defaultRadialGradient,_2);var _4=p.createFromXaml("<RadialGradientBrush/>"),c=dojox.gfx.matrix.multiplyPoint(dojox.gfx.matrix.invert(this._getAdjustedMatrix()),f.cx,f.cy),pt=c.x+","+c.y;_4.mappingMode="Absolute";_4.gradie
 ntOrigin=pt;_4.center=pt;_4.radiusX=_4.radiusY=f.r;dojo.forEach(f.colors,function(c){var t=p.createFromXaml("<GradientStop/>");t.offset=c.offset;t.color=dojox.gfx.silverlight.hexColor(c.color);_4.gradientStops.add(t);});this._setFillAttr(_4);break;case "pattern":this.fillStyle=null;this._setFillAttr(null);break;}return this;}this.fillStyle=f=dojox.gfx.normalizeColor(_2);var _5=p.createFromXaml("<SolidColorBrush/>");_5.color=f.toHex();_5.opacity=f.a;this._setFillAttr(_5);return this;},_setFillAttr:function(f){this.rawNode.fill=f;},setStroke:function(_6){var p=this.rawNode.getHost().content,r=this.rawNode;if(!_6){this.strokeStyle=null;r.stroke=null;return this;}if(typeof _6=="string"||dojo.isArray(_6)||_6 instanceof dojo.Color){_6={color:_6};}var s=this.strokeStyle=dojox.gfx.makeParameters(dojox.gfx.defaultStroke,_6);s.color=dojox.gfx.normalizeColor(s.color);if(s){var _7=p.createFromXaml("<SolidColorBrush/>");_7.color=s.color.toHex();_7.opacity=s.color.a;r.stroke=_7;r.strokeTh
 ickness=s.width;r.strokeStartLineCap=r.strokeEndLineCap=r.strokeDashCap=dojox.gfx.silverlight.caps[s.cap];if(typeof s.join=="number"){r.strokeLineJoin="Miter";r.strokeMiterLimit=s.join;}else{r.strokeLineJoin=dojox.gfx.silverlight.joins[s.join];}var da=s.style.toLowerCase();if(da in dojox.gfx.silverlight.dasharray){da=dojox.gfx.silverlight.dasharray[da];}if(da instanceof Array){da=dojo.clone(da);var i;if(s.cap!="butt"){for(i=0;i<da.length;i+=2){--da[i];if(da[i]<1){da[i]=1;}}for(i=1;i<da.length;i+=2){++da[i];}}r.strokeDashArray=da.join(",");}else{r.strokeDashArray=null;}}return this;},_getParentSurface:function(){var _8=this.parent;for(;_8&&!(_8 instanceof dojox.gfx.Surface);_8=_8.parent){}return _8;},_applyTransform:function(){var tm=this._getAdjustedMatrix(),r=this.rawNode;if(tm){var p=this.rawNode.getHost().content,m=p.createFromXaml("<MatrixTransform/>"),mm=p.createFromXaml("<Matrix/>");mm.m11=tm.xx;mm.m21=tm.xy;mm.m12=tm.yx;mm.m22=tm.yy;mm.offsetX=tm.dx;mm.offsetY=tm.dy;m
 .matrix=mm;r.renderTransform=m;}else{r.renderTransform=null;}return this;},setRawNode:function(_9){_9.fill=null;_9.stroke=null;this.rawNode=_9;},_moveToFront:function(){var c=this.parent.rawNode.children,r=this.rawNode;c.remove(r);c.add(r);return this;},_moveToBack:function(){var c=this.parent.rawNode.children,r=this.rawNode;c.remove(r);c.insert(0,r);return this;},_getAdjustedMatrix:function(){return this.matrix;}});dojo.declare("dojox.gfx.Group",dojox.gfx.Shape,{constructor:function(){dojox.gfx.silverlight.Container._init.call(this);},setRawNode:function(_a){this.rawNode=_a;}});dojox.gfx.Group.nodeType="Canvas";dojo.declare("dojox.gfx.Rect",dojox.gfx.shape.Rect,{setShape:function(_b){this.shape=dojox.gfx.makeParameters(this.shape,_b);this.bbox=null;var r=this.rawNode,n=this.shape;r.width=n.width;r.height=n.height;r.radiusX=r.radiusY=n.r;return this._applyTransform();},_getAdjustedMatrix:function(){var m=this.matrix,s=this.shape,d={dx:s.x,dy:s.y};return new dojox.gfx.Matrix2
 D(m?[m,d]:d);}});dojox.gfx.Rect.nodeType="Rectangle";dojo.declare("dojox.gfx.Ellipse",dojox.gfx.shape.Ellipse,{setShape:function(_c){this.shape=dojox.gfx.makeParameters(this.shape,_c);this.bbox=null;var r=this.rawNode,n=this.shape;r.width=2*n.rx;r.height=2*n.ry;return this._applyTransform();},_getAdjustedMatrix:function(){var m=this.matrix,s=this.shape,d={dx:s.cx-s.rx,dy:s.cy-s.ry};return new dojox.gfx.Matrix2D(m?[m,d]:d);}});dojox.gfx.Ellipse.nodeType="Ellipse";dojo.declare("dojox.gfx.Circle",dojox.gfx.shape.Circle,{setShape:function(_d){this.shape=dojox.gfx.makeParameters(this.shape,_d);this.bbox=null;var r=this.rawNode,n=this.shape;r.width=r.height=2*n.r;return this._applyTransform();},_getAdjustedMatrix:function(){var m=this.matrix,s=this.shape,d={dx:s.cx-s.r,dy:s.cy-s.r};return new dojox.gfx.Matrix2D(m?[m,d]:d);}});dojox.gfx.Circle.nodeType="Ellipse";dojo.declare("dojox.gfx.Line",dojox.gfx.shape.Line,{setShape:function(_e){this.shape=dojox.gfx.makeParameters(this.shape,
 _e);this.bbox=null;var r=this.rawNode,n=this.shape;r.x1=n.x1;r.y1=n.y1;r.x2=n.x2;r.y2=n.y2;return this;}});dojox.gfx.Line.nodeType="Line";dojo.declare("dojox.gfx.Polyline",dojox.gfx.shape.Polyline,{setShape:function(_f,_10){if(_f&&_f instanceof Array){this.shape=dojox.gfx.makeParameters(this.shape,{points:_f});if(_10&&this.shape.points.length){this.shape.points.push(this.shape.points[0]);}}else{this.shape=dojox.gfx.makeParameters(this.shape,_f);}this.bbox=null;this._normalizePoints();var p=this.shape.points,rp=[];for(var i=0;i<p.length;++i){rp.push(p[i].x,p[i].y);}this.rawNode.points=rp.join(",");return this;}});dojox.gfx.Polyline.nodeType="Polyline";dojo.declare("dojox.gfx.Image",dojox.gfx.shape.Image,{setShape:function(_11){this.shape=dojox.gfx.makeParameters(this.shape,_11);this.bbox=null;var r=this.rawNode,n=this.shape;r.width=n.width;r.height=n.height;r.source=n.src;return this._applyTransform();},_getAdjustedMatrix:function(){var m=this.matrix,s=this.shape,d={dx:s.x,dy
 :s.y};return new dojox.gfx.Matrix2D(m?[m,d]:d);},setRawNode:function(_12){this.rawNode=_12;}});dojox.gfx.Image.nodeType="Image";dojo.declare("dojox.gfx.Text",dojox.gfx.shape.Text,{setShape:function(_13){this.shape=dojox.gfx.makeParameters(this.shape,_13);this.bbox=null;var r=this.rawNode,s=this.shape;r.text=s.text;r.textDecorations=s.decoration==="underline"?"Underline":"None";r["Canvas.Left"]=-10000;r["Canvas.Top"]=-10000;if(!this._delay){this._delay=window.setTimeout(dojo.hitch(this,"_delayAlignment"),10);}return this;},_delayAlignment:function(){var r=this.rawNode,s=this.shape,w=r.actualWidth,h=r.actualHeight,x=s.x,y=s.y-h*0.75;switch(s.align){case "middle":x-=w/2;break;case "end":x-=w;break;}this._delta={dx:x,dy:y};r["Canvas.Left"]=0;r["Canvas.Top"]=0;this._applyTransform();delete this._delay;},_getAdjustedMatrix:function(){var m=this.matrix,d=this._delta,x;if(m){x=d?[m,d]:m;}else{x=d?d:{};}return new dojox.gfx.Matrix2D(x);},setStroke:function(){return this;},_setFillAtt
 r:function(f){this.rawNode.foreground=f;},setRawNode:function(_14){this.rawNode=_14;},getTextWidth:function(){return this.rawNode.actualWidth;}});dojox.gfx.Text.nodeType="TextBlock";dojo.declare("dojox.gfx.Path",dojox.gfx.path.Path,{_updateWithSegment:function(_15){dojox.gfx.Path.superclass._updateWithSegment.apply(this,arguments);var p=this.shape.path;if(typeof (p)=="string"){this.rawNode.data=p?p:null;}},setShape:function(_16){dojox.gfx.Path.superclass.setShape.apply(this,arguments);var p=this.shape.path;this.rawNode.data=p?p:null;return this;}});dojox.gfx.Path.nodeType="Path";dojo.declare("dojox.gfx.TextPath",dojox.gfx.path.TextPath,{_updateWithSegment:function(_17){},setShape:function(_18){},_setText:function(){}});dojox.gfx.TextPath.nodeType="text";dojox.gfx.silverlight.surfaces={};dojox.gfx.silverlight.nullFunc=function(){};dojo.declare("dojox.gfx.Surface",dojox.gfx.shape.Surface,{constructor:function(){dojox.gfx.silverlight.Container._init.call(this);},destroy:functio
 n(){window[this._onLoadName]=dojox.gfx.silverlight.nullFunc;delete dojox.gfx.silverlight.surfaces[this.rawNode.name];this.inherited(arguments);},setDimensions:function(_19,_1a){this.width=dojox.gfx.normalizedLength(_19);this.height=dojox.gfx.normalizedLength(_1a);var p=this.rawNode&&this.rawNode.getHost();if(p){p.width=_19;p.height=_1a;}return this;},getDimensions:function(){var p=this.rawNode&&this.rawNode.getHost();var t=p?{width:p.content.actualWidth,height:p.content.actualHeight}:null;if(t.width<=0){t.width=this.width;}if(t.height<=0){t.height=this.height;}return t;}});dojox.gfx.createSurface=function(_1b,_1c,_1d){if(!_1c&&!_1d){var pos=d.position(_1b);_1c=_1c||pos.w;_1d=_1d||pos.h;}if(typeof _1c=="number"){_1c=_1c+"px";}if(typeof _1d=="number"){_1d=_1d+"px";}var s=new dojox.gfx.Surface();_1b=dojo.byId(_1b);s._parent=_1b;var t=_1b.ownerDocument.createElement("script");t.type="text/xaml";t.id=dojox.gfx._base._getUniqueId();t.text="<?xml version='1.0'?><Canvas xmlns='http:
 //schemas.microsoft.com/client/2007' Name='"+dojox.gfx._base._getUniqueId()+"'/>";_1b.parentNode.insertBefore(t,_1b);s._nodes.push(t);var obj,_1e=dojox.gfx._base._getUniqueId(),_1f="__"+dojox.gfx._base._getUniqueId()+"_onLoad";s._onLoadName=_1f;window[_1f]=function(_20){if(!s.rawNode){s.rawNode=dojo.byId(_1e).content.root;dojox.gfx.silverlight.surfaces[s.rawNode.name]=_1b;s.onLoad(s);}};if(dojo.isSafari){obj="<embed type='application/x-silverlight' id='"+_1e+"' width='"+_1c+"' height='"+_1d+" background='transparent'"+" source='#"+t.id+"'"+" windowless='true'"+" maxFramerate='60'"+" onLoad='"+_1f+"'"+" onError='__dojoSilverlightError'"+" /><iframe style='visibility:hidden;height:0;width:0'/>";}else{obj="<object type='application/x-silverlight' data='data:application/x-silverlight,' id='"+_1e+"' width='"+_1c+"' height='"+_1d+"'>"+"<param name='background' value='transparent' />"+"<param name='source' value='#"+t.id+"' />"+"<param name='windowless' value='true' />"+"<param nam
 e='maxFramerate' value='60' />"+"<param name='onLoad' value='"+_1f+"' />"+"<param name='onError' value='__dojoSilverlightError' />"+"</object>";}_1b.innerHTML=obj;var _21=dojo.byId(_1e);if(_21.content&&_21.content.root){s.rawNode=_21.content.root;dojox.gfx.silverlight.surfaces[s.rawNode.name]=_1b;}else{s.rawNode=null;s.isLoaded=false;}s._nodes.push(_21);s.width=dojox.gfx.normalizedLength(_1c);s.height=dojox.gfx.normalizedLength(_1d);return s;};__dojoSilverlightError=function(_22,err){var t="Silverlight Error:\n"+"Code: "+err.ErrorCode+"\n"+"Type: "+err.ErrorType+"\n"+"Message: "+err.ErrorMessage+"\n";switch(err.ErrorType){case "ParserError":t+="XamlFile: "+err.xamlFile+"\n"+"Line: "+err.lineNumber+"\n"+"Position: "+err.charPosition+"\n";break;case "RuntimeError":t+="MethodName: "+err.methodName+"\n";if(err.lineNumber!=0){t+="Line: "+err.lineNumber+"\n"+"Position: "+err.charPosition+"\n";}break;}};dojox.gfx.silverlight.Font={_setFont:function(){var f=this.fontStyle,r=this.raw
 Node,fw=dojox.gfx.silverlight.fontweight,fo=dojox.gfx.silverlight.fonts,t=f.family.toLowerCase();r.fontStyle=f.style=="italic"?"Italic":"Normal";r.fontWeight=f.weight in fw?fw[f.weight]:f.weight;r.fontSize=dojox.gfx.normalizedLength(f.size);r.fontFamily=t in fo?fo[t]:f.family;if(!this._delay){this._delay=window.setTimeout(dojo.hitch(this,"_delayAlignment"),10);}}};dojox.gfx.silverlight.Container={_init:function(){dojox.gfx.shape.Container._init.call(this);},add:function(_23){if(this!=_23.getParent()){dojox.gfx.shape.Container.add.apply(this,arguments);this.rawNode.children.add(_23.rawNode);}return this;},remove:function(_24,_25){if(this==_24.getParent()){var _26=_24.rawNode.getParent();if(_26){_26.children.remove(_24.rawNode);}dojox.gfx.shape.Container.remove.apply(this,arguments);}return this;},clear:function(){this.rawNode.children.clear();return dojox.gfx.shape.Container.clear.apply(this,arguments);},_moveChildToFront:dojox.gfx.shape.Container._moveChildToFront,_moveChild
 ToBack:dojox.gfx.shape.Container._moveChildToBack};dojo.mixin(dojox.gfx.shape.Creator,{createObject:function(_27,_28){if(!this.rawNode){return null;}var _29=new _27();var _2a=this.rawNode.getHost().content.createFromXaml("<"+_27.nodeType+"/>");_29.setRawNode(_2a);_29.setShape(_28);this.add(_29);return _29;}});dojo.extend(dojox.gfx.Text,dojox.gfx.silverlight.Font);dojo.extend(dojox.gfx.Group,dojox.gfx.silverlight.Container);dojo.extend(dojox.gfx.Group,dojox.gfx.shape.Creator);dojo.extend(dojox.gfx.Surface,dojox.gfx.silverlight.Container);dojo.extend(dojox.gfx.Surface,dojox.gfx.shape.Creator);(function(){var _2b=dojox.gfx.silverlight.surfaces;var _2c=function(s,a){var ev={target:s,currentTarget:s,preventDefault:function(){},stopPropagation:function(){}};if(a){try{ev.ctrlKey=a.ctrl;ev.shiftKey=a.shift;var p=a.getPosition(null);ev.x=ev.offsetX=ev.layerX=p.x;ev.y=ev.offsetY=ev.layerY=p.y;var _2d=_2b[s.getHost().content.root.name];var t=dojo.position(_2d);ev.clientX=t.x+p.x;ev.cli
 entY=t.y+p.y;}catch(e){}}return ev;};var _2e=function(s,a){var ev={keyCode:a.platformKeyCode,ctrlKey:a.ctrl,shiftKey:a.shift};return ev;};var _2f={onclick:{name:"MouseLeftButtonUp",fix:_2c},onmouseenter:{name:"MouseEnter",fix:_2c},onmouseleave:{name:"MouseLeave",fix:_2c},onmouseover:{name:"MouseEnter",fix:_2c},onmouseout:{name:"MouseLeave",fix:_2c},onmousedown:{name:"MouseLeftButtonDown",fix:_2c},onmouseup:{name:"MouseLeftButtonUp",fix:_2c},onmousemove:{name:"MouseMove",fix:_2c},onkeydown:{name:"KeyDown",fix:_2e},onkeyup:{name:"KeyUp",fix:_2e}};var _30={connect:function(_31,_32,_33){var _34,n=_31 in _2f?_2f[_31]:{name:_31,fix:function(){return {};}};if(arguments.length>2){_34=this.getEventSource().addEventListener(n.name,function(s,a){dojo.hitch(_32,_33)(n.fix(s,a));});}else{_34=this.getEventSource().addEventListener(n.name,function(s,a){_32(n.fix(s,a));});}return {name:n.name,token:_34};},disconnect:function(_35){this.getEventSource().removeEventListener(_35.name,_35.token)
 ;}};dojo.extend(dojox.gfx.Shape,_30);dojo.extend(dojox.gfx.Surface,_30);dojox.gfx.equalSources=function(a,b){return a&&b&&a.equals(b);};})();}
\ No newline at end of file

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight_attach.js
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight_attach.js?rev=1341757&view=auto
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight_attach.js (added)
+++ geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight_attach.js Wed May 23 06:24:33 2012
@@ -0,0 +1,8 @@
+/*
+	Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
+	Available via Academic Free License >= 2.1 OR the modified BSD license.
+	see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo.require("dojox.gfx.silverlight");dojo.experimental("dojox.gfx.silverlight_attach");(function(){dojox.gfx.attachNode=function(_1){return null;if(!_1){return null;}var s=null;switch(_1.tagName.toLowerCase()){case dojox.gfx.Rect.nodeType:s=new dojox.gfx.Rect(_1);break;case dojox.gfx.Ellipse.nodeType:if(_1.width==_1.height){s=new dojox.gfx.Circle(_1);}else{s=new dojox.gfx.Ellipse(_1);}break;case dojox.gfx.Polyline.nodeType:s=new dojox.gfx.Polyline(_1);break;case dojox.gfx.Path.nodeType:s=new dojox.gfx.Path(_1);break;case dojox.gfx.Line.nodeType:s=new dojox.gfx.Line(_1);break;case dojox.gfx.Image.nodeType:s=new dojox.gfx.Image(_1);break;case dojox.gfx.Text.nodeType:s=new dojox.gfx.Text(_1);_2(s);break;default:return null;}_3(s);if(!(s instanceof dojox.gfx.Image)){_4(s);_5(s);}_6(s);return s;};dojox.gfx.attachSurface=function(_7){return null;};var _4=function(_8){return null;};var _5=function(_9){return null;};var _6=function(_a){return null;};var _2=function(_b){return null;
 };var _3=function(_c){return null;};})();
\ No newline at end of file

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight_attach.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight_attach.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-beta/plugins/console/console-portal-driver/src/main/webapp/dojo/dojox/gfx/silverlight_attach.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message