You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/05/27 23:46:48 UTC
svn commit: r779328 - in /incubator/pivot/trunk: core/src/pivot/collections/
core/src/pivot/serialization/ core/src/pivot/util/
core/test/pivot/core/test/ wtk/src/pivot/wtk/
wtk/src/pivot/wtk/media/drawing/ wtk/src/pivot/wtk/skin/
wtk/src/pivot/wtk/ski...
Author: gbrown
Date: Wed May 27 21:46:47 2009
New Revision: 779328
URL: http://svn.apache.org/viewvc?rev=779328&view=rev
Log:
Fix bug in retrieving numeric values using JSONSerializer; add gradient paint encodings to GraphicsUtilities; remove raw type warning suppression.
Added:
incubator/pivot/trunk/wtk/test/pivot/wtk/test/paint_test.wtkx
Modified:
incubator/pivot/trunk/core/src/pivot/collections/Sequence.java
incubator/pivot/trunk/core/src/pivot/serialization/CSVSerializer.java
incubator/pivot/trunk/core/src/pivot/serialization/JSONSerializer.java
incubator/pivot/trunk/core/src/pivot/util/Resources.java
incubator/pivot/trunk/core/test/pivot/core/test/PropertiesSerializerTest.java
incubator/pivot/trunk/wtk/src/pivot/wtk/ApplicationContext.java
incubator/pivot/trunk/wtk/src/pivot/wtk/DesktopApplicationContext.java
incubator/pivot/trunk/wtk/src/pivot/wtk/GraphicsUtilities.java
incubator/pivot/trunk/wtk/src/pivot/wtk/TreeView.java
incubator/pivot/trunk/wtk/src/pivot/wtk/media/drawing/Shape.java
incubator/pivot/trunk/wtk/src/pivot/wtk/skin/ContainerSkin.java
incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTreeViewSkin.java
incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java
incubator/pivot/trunk/wtk/test/pivot/wtk/test/sample.wtkd
Modified: incubator/pivot/trunk/core/src/pivot/collections/Sequence.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/pivot/collections/Sequence.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/pivot/collections/Sequence.java (original)
+++ incubator/pivot/trunk/core/src/pivot/collections/Sequence.java Wed May 27 21:46:47 2009
@@ -269,7 +269,7 @@
* The path of first occurrence of the item if it exists in the
* sequence; <tt>null</tt>, otherwise.
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public static <T> Path pathOf(Sequence<T> sequence, T item) {
if (sequence == null) {
throw new IllegalArgumentException("sequence is null.");
Modified: incubator/pivot/trunk/core/src/pivot/serialization/CSVSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/pivot/serialization/CSVSerializer.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/pivot/serialization/CSVSerializer.java (original)
+++ incubator/pivot/trunk/core/src/pivot/serialization/CSVSerializer.java Wed May 27 21:46:47 2009
@@ -267,7 +267,7 @@
return new StreamIterator(reader);
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
private Object readItem(Reader reader)
throws IOException, SerializationException {
Object item = null;
@@ -388,7 +388,7 @@
* @param writer
* The writer to which data will be written.
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public void writeObject(List<?> items, Writer writer)
throws IOException, SerializationException {
if (items == null) {
Modified: incubator/pivot/trunk/core/src/pivot/serialization/JSONSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/pivot/serialization/JSONSerializer.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/pivot/serialization/JSONSerializer.java (original)
+++ incubator/pivot/trunk/core/src/pivot/serialization/JSONSerializer.java Wed May 27 21:46:47 2009
@@ -663,7 +663,7 @@
return get(root, split(path));
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
private static Object get(Object root, Sequence<String> keys) {
Object value = root;
@@ -717,7 +717,7 @@
* @see #getValue(Object, String)
*/
public static Short getShort(Object root, String path) {
- return (Short)get(root, path);
+ return getNumber(root, path).shortValue();
}
/**
@@ -729,7 +729,7 @@
* @see #getValue(Object, String)
*/
public static Integer getInteger(Object root, String path) {
- return (Integer)get(root, path);
+ return getNumber(root, path).intValue();
}
/**
@@ -741,7 +741,7 @@
* @see #getValue(Object, String)
*/
public static Long getLong(Object root, String path) {
- return (Long)get(root, path);
+ return getNumber(root, path).longValue();
}
/**
@@ -753,7 +753,7 @@
* @see #getValue(Object, String)
*/
public static Float getFloat(Object root, String path) {
- return (Float)get(root, path);
+ return getNumber(root, path).floatValue();
}
/**
@@ -765,7 +765,7 @@
* @see #getValue(Object, String)
*/
public static Double getDouble(Object root, String path) {
- return (Double)get(root, path);
+ return getNumber(root, path).doubleValue();
}
/**
@@ -815,7 +815,7 @@
* @return
* The value previously associated with the path.
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public static Object put(Object root, String path, Object value) {
if (root == null) {
throw new IllegalArgumentException("root is null.");
@@ -857,7 +857,7 @@
* @return
* The value that was removed.
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public static Object remove(Object root, String path) {
if (root == null) {
throw new IllegalArgumentException("root is null.");
@@ -899,7 +899,7 @@
* @return
* <tt>true</tt> if the path exists; <tt>false</tt>, otherwise.
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public static boolean containsKey(Object root, String path) {
if (root == null) {
throw new IllegalArgumentException("root is null.");
Modified: incubator/pivot/trunk/core/src/pivot/util/Resources.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/pivot/util/Resources.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/pivot/util/Resources.java (original)
+++ incubator/pivot/trunk/core/src/pivot/util/Resources.java Wed May 27 21:46:47 2009
@@ -162,7 +162,7 @@
return resourceMap.isEmpty();
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
private void applyOverrides(Map<String, Object> sourceMap,
Map<String, Object> overridesMap) {
Modified: incubator/pivot/trunk/core/test/pivot/core/test/PropertiesSerializerTest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/test/pivot/core/test/PropertiesSerializerTest.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/core/test/pivot/core/test/PropertiesSerializerTest.java (original)
+++ incubator/pivot/trunk/core/test/pivot/core/test/PropertiesSerializerTest.java Wed May 27 21:46:47 2009
@@ -26,7 +26,7 @@
public class PropertiesSerializerTest
{
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public static void main(String[] args) {
Serializer serializer = new PropertiesSerializer();
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/ApplicationContext.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/ApplicationContext.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/ApplicationContext.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/ApplicationContext.java Wed May 27 21:46:47 2009
@@ -1241,7 +1241,6 @@
*
* @param location
*/
- @SuppressWarnings("rawtypes")
public static void open(URL location) {
// TODO Remove dynamic invocation when Java 6 is fully supported on
// Mac OS X
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/DesktopApplicationContext.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/DesktopApplicationContext.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/DesktopApplicationContext.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/DesktopApplicationContext.java Wed May 27 21:46:47 2009
@@ -174,7 +174,6 @@
*
* @param args
*/
- @SuppressWarnings("rawtypes")
public static void main(String[] args) {
if (application != null) {
throw new IllegalStateException();
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/GraphicsUtilities.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/GraphicsUtilities.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/GraphicsUtilities.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/GraphicsUtilities.java Wed May 27 21:46:47 2009
@@ -17,11 +17,17 @@
package pivot.wtk;
import java.awt.Color;
+import java.awt.GradientPaint;
import java.awt.Graphics2D;
+import java.awt.LinearGradientPaint;
import java.awt.Paint;
+import java.awt.RadialGradientPaint;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
+import pivot.collections.Dictionary;
+import pivot.collections.List;
+import pivot.serialization.JSONSerializer;
import pivot.wtk.Orientation;
/**
@@ -30,6 +36,53 @@
* @author tvolkert
*/
public final class GraphicsUtilities {
+ public enum PaintType {
+ SOLID_COLOR,
+ GRADIENT,
+ LINEAR_GRADIENT,
+ RADIAL_GRADIENT;
+
+ public static PaintType decode(String value) {
+ if (value == null) {
+ throw new IllegalArgumentException();
+ }
+
+ PaintType paintType;
+ if (value.equals("solidColor")) {
+ paintType = SOLID_COLOR;
+ } else if (value.equals("gradient")) {
+ paintType = GRADIENT;
+ } else if (value.equals("linearGradient")) {
+ paintType = LINEAR_GRADIENT;
+ } else if (value.equals("radialGradient")) {
+ paintType = RADIAL_GRADIENT;
+ } else {
+ throw new IllegalArgumentException("\"" + value + "\" is not a valid paint type.");
+ }
+
+ return paintType;
+ }
+ }
+
+ public static final String PAINT_TYPE_KEY = "paintType";
+
+ public static final String COLOR_KEY = "color";
+
+ public static final String START_X_KEY = "startX";
+ public static final String START_Y_KEY = "startY";
+ public static final String END_X_KEY = "endX";
+ public static final String END_Y_KEY = "endY";
+
+ public static final String START_COLOR_KEY = "startColor";
+ public static final String END_COLOR_KEY = "endColor";
+
+ public static final String CENTER_X_KEY = "centerX";
+ public static final String CENTER_Y_KEY = "centerY";
+ public static final String RADIUS_KEY = "radius";
+
+ public static final String STOPS_KEY = "stops";
+ public static final String OFFSET_KEY = "offset";
+
private GraphicsUtilities() {
}
@@ -139,30 +192,30 @@
}
}
- public static Color decodeColor(String name) throws NumberFormatException {
- if (name == null) {
+ public static Color decodeColor(String value) throws NumberFormatException {
+ if (value == null) {
throw new IllegalArgumentException();
}
- name = name.toLowerCase();
+ value = value.toLowerCase();
int rgb;
float alpha;
- if (name.startsWith("0x")) {
- name = name.substring(2);
- if (name.length() != 8) {
+ if (value.startsWith("0x")) {
+ value = value.substring(2);
+ if (value.length() != 8) {
throw new IllegalArgumentException();
}
- rgb = Integer.parseInt(name.substring(0, 6), 16);
- alpha = (float)Integer.parseInt(name.substring(6, 8), 16) / 255f;
- } else if (name.startsWith("#")) {
- name = name.substring(1);
- if (name.length() != 6) {
+ rgb = Integer.parseInt(value.substring(0, 6), 16);
+ alpha = (float)Integer.parseInt(value.substring(6, 8), 16) / 255f;
+ } else if (value.startsWith("#")) {
+ value = value.substring(1);
+ if (value.length() != 6) {
throw new IllegalArgumentException();
}
- rgb = Integer.parseInt(name, 16);
+ rgb = Integer.parseInt(value, 16);
alpha = 1.0f;
} else {
throw new IllegalArgumentException();
@@ -177,8 +230,105 @@
return color;
}
- public static Paint decodePaint(String name) {
- // TODO
- return null;
+ public static Paint decodePaint(String value) {
+ if (value == null) {
+ throw new IllegalArgumentException();
+ }
+
+ Paint paint;
+ if (value.startsWith("#")
+ || value.startsWith("0x")
+ || value.startsWith("0X")) {
+ paint = decodeColor(value);
+ } else {
+ paint = decodePaint(JSONSerializer.parseMap(value));
+ }
+
+ return paint;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Paint decodePaint(Dictionary<String, ?> value) {
+ String paintType = JSONSerializer.getString(value, PAINT_TYPE_KEY);
+ if (paintType == null) {
+ throw new IllegalArgumentException(PAINT_TYPE_KEY + " is required.");
+ }
+
+ Paint paint;
+ switch(PaintType.decode(paintType)) {
+ case SOLID_COLOR: {
+ String color = JSONSerializer.getString(value, COLOR_KEY);
+ paint = decodeColor(color);
+ break;
+ }
+
+ case GRADIENT: {
+ float startX = JSONSerializer.getFloat(value, START_X_KEY);
+ float startY = JSONSerializer.getFloat(value, START_Y_KEY);
+ float endX = JSONSerializer.getFloat(value, END_X_KEY);
+ float endY = JSONSerializer.getFloat(value, END_Y_KEY);
+ Color startColor = Color.decode(JSONSerializer.getString(value, START_COLOR_KEY));
+ Color endColor = Color.decode(JSONSerializer.getString(value, END_COLOR_KEY));
+ paint = new GradientPaint(startX, startY, startColor, endX, endY, endColor);
+ break;
+ }
+
+ case LINEAR_GRADIENT: {
+ float startX = JSONSerializer.getFloat(value, START_X_KEY);
+ float startY = JSONSerializer.getFloat(value, START_Y_KEY);
+ float endX = JSONSerializer.getFloat(value, END_X_KEY);
+ float endY = JSONSerializer.getFloat(value, END_Y_KEY);
+
+ List<Dictionary<String, ?>> stops =
+ (List<Dictionary<String, ?>>)JSONSerializer.getList(value, STOPS_KEY);
+
+ int n = stops.getLength();
+ float[] fractions = new float[n];
+ Color[] colors = new Color[n];
+ for (int i = 0; i < n; i++) {
+ Dictionary<String, ?> stop = stops.get(i);
+
+ float offset = JSONSerializer.getFloat(stop, OFFSET_KEY);
+ fractions[i] = offset;
+
+ Color color = Color.decode(JSONSerializer.getString(stop, COLOR_KEY));
+ colors[i] = color;
+ }
+
+ paint = new LinearGradientPaint(startX, startY, endX, endY, fractions, colors);
+ break;
+ }
+
+ case RADIAL_GRADIENT: {
+ float centerX = JSONSerializer.getFloat(value, CENTER_X_KEY);
+ float centerY = JSONSerializer.getFloat(value, CENTER_Y_KEY);
+ float radius = JSONSerializer.getFloat(value, RADIUS_KEY);
+
+ List<Dictionary<String, ?>> stops =
+ (List<Dictionary<String, ?>>)JSONSerializer.getList(value, STOPS_KEY);
+
+ int n = stops.getLength();
+ float[] fractions = new float[n];
+ Color[] colors = new Color[n];
+ for (int i = 0; i < n; i++) {
+ Dictionary<String, ?> stop = stops.get(i);
+
+ float offset = JSONSerializer.getFloat(stop, OFFSET_KEY);
+ fractions[i] = offset;
+
+ Color color = Color.decode(JSONSerializer.getString(stop, COLOR_KEY));
+ colors[i] = color;
+ }
+
+ paint = new RadialGradientPaint(centerX, centerY, radius, fractions, colors);
+ break;
+ }
+
+ default: {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ return paint;
}
}
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/TreeView.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/TreeView.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/TreeView.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/TreeView.java Wed May 27 21:46:47 2009
@@ -1632,7 +1632,6 @@
* @throws IllegalArgumentException
* If the path contains any leaf nodes.
*/
- @SuppressWarnings("rawtypes")
private void monitorBranch(Path path) {
BranchHandler parent = rootBranchHandler;
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/media/drawing/Shape.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/media/drawing/Shape.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/media/drawing/Shape.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/media/drawing/Shape.java Wed May 27 21:46:47 2009
@@ -504,7 +504,7 @@
throw new IllegalArgumentException("fill is null.");
}
- setFill(fill.length() == 0 ? null : GraphicsUtilities.decodeColor(fill));
+ setFill(fill.length() == 0 ? null : GraphicsUtilities.decodePaint(fill));
}
public Paint getStroke() {
@@ -521,7 +521,7 @@
throw new IllegalArgumentException("stroke is null.");
}
- setStroke(stroke.length() == 0 ? null : GraphicsUtilities.decodeColor(stroke));
+ setStroke(stroke.length() == 0 ? null : GraphicsUtilities.decodePaint(stroke));
}
public int getStrokeThickness() {
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/skin/ContainerSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/skin/ContainerSkin.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/skin/ContainerSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/skin/ContainerSkin.java Wed May 27 21:46:47 2009
@@ -21,6 +21,7 @@
import java.awt.Paint;
import java.awt.Transparency;
+import pivot.collections.Dictionary;
import pivot.collections.Sequence;
import pivot.wtk.Component;
import pivot.wtk.Container;
@@ -201,6 +202,14 @@
repaintComponent();
}
+ public final void setBackgroundPaint(Dictionary<String, ?> backgroundPaint) {
+ if (backgroundPaint == null) {
+ throw new IllegalArgumentException("backgroundPaint is null");
+ }
+
+ setBackgroundPaint(GraphicsUtilities.decodePaint(backgroundPaint));
+ }
+
public Color getBackgroundColor() {
if (backgroundPaint != null
&& !(backgroundPaint instanceof Color)) {
Modified: incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTreeViewSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTreeViewSkin.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTreeViewSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtk/skin/terra/TerraTreeViewSkin.java Wed May 27 21:46:47 2009
@@ -96,7 +96,7 @@
depth = (parent == null) ? 0 : parent.depth + 1;
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public static NodeInfo createNew(BranchInfo parent, Object data) {
NodeInfo nodeInfo = null;
Modified: incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java Wed May 27 21:46:47 2009
@@ -289,7 +289,7 @@
}
}
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings({"unchecked"})
public Object readObject(InputStream inputStream) throws IOException,
SerializationException {
if (inputStream == null) {
Added: incubator/pivot/trunk/wtk/test/pivot/wtk/test/paint_test.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/pivot/wtk/test/paint_test.wtkx?rev=779328&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/test/pivot/wtk/test/paint_test.wtkx (added)
+++ incubator/pivot/trunk/wtk/test/pivot/wtk/test/paint_test.wtkx Wed May 27 21:46:47 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License,
+Version 2.0 (the "License"); you may not use this file except in
+compliance with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<FlowPane styles="{backgroundPaint:{paintType:'gradient',
+ color:'#ff0000',
+ startX:0, startY:0, startColor:'#ffffff',
+ endX:400, endY:400, endColor:'#000000'}}"
+ xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
+ xmlns="pivot.wtk"/>
Modified: incubator/pivot/trunk/wtk/test/pivot/wtk/test/sample.wtkd
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/pivot/wtk/test/sample.wtkd?rev=779328&r1=779327&r2=779328&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/pivot/wtk/test/sample.wtkd (original)
+++ incubator/pivot/trunk/wtk/test/pivot/wtk/test/sample.wtkd Wed May 27 21:46:47 2009
@@ -53,7 +53,10 @@
</transforms>
<Rectangle x="0" y="0"
- width="160" height="120" fill="#0000ff"
+ width="160" height="120"
+ fill="{paintType:'radialGradient',
+ centerX:50, centerY:50, radius:50,
+ stops: [{color:'#ffffff', offset:0.0}, {color:'#000000', offset:1.0}]}"
stroke="#00ff00" strokeThickness="4"
cornerRadius="20"/>
<Arc x="-10" y="10" width="50" height="50" start="90.0" extent="90.0"