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 2010/09/17 20:40:59 UTC
svn commit: r998240 - in /pivot/trunk: core/src/org/apache/pivot/beans/
tests/src/org/apache/pivot/tests/ tests/src/org/apache/pivot/tests/issues/
tutorials/src/org/apache/pivot/tutorials/drawing/
tutorials/src/org/apache/pivot/tutorials/menus/ wtk/src...
Author: gbrown
Date: Fri Sep 17 18:40:59 2010
New Revision: 998240
URL: http://svn.apache.org/viewvc?rev=998240&view=rev
Log:
Resolve PIVOT-628.
Added:
pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_628.bxml
Removed:
pivot/trunk/tests/src/org/apache/pivot/tests/activity.bxml
Modified:
pivot/trunk/core/src/org/apache/pivot/beans/BXMLSerializer.java
pivot/trunk/tests/src/org/apache/pivot/tests/drawing_test.bxml
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.bxml
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/simple_drawing.bxml
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/menu_buttons.bxml
pivot/trunk/wtk/src/org/apache/pivot/wtk/media/drawing/Shape.java
Modified: pivot/trunk/core/src/org/apache/pivot/beans/BXMLSerializer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/beans/BXMLSerializer.java?rev=998240&r1=998239&r2=998240&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/beans/BXMLSerializer.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/beans/BXMLSerializer.java Fri Sep 17 18:40:59 2010
@@ -1051,11 +1051,15 @@ public class BXMLSerializer implements S
if (value.charAt(0) == OBJECT_REFERENCE_PREFIX) {
attribute.value = value;
} else {
- if (!JSON.containsKey(namespace, value)) {
- throw new SerializationException("Value \"" + value + "\" is not defined.");
- }
+ if (value.equals(BXML_PREFIX + ":" + null)) {
+ attribute.value = null;
+ } else {
+ if (!JSON.containsKey(namespace, value)) {
+ throw new SerializationException("Value \"" + value + "\" is not defined.");
+ }
- attribute.value = JSON.get(namespace, value);
+ attribute.value = JSON.get(namespace, value);
+ }
}
} else {
throw new SerializationException("Invalid object resolution argument.");
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/drawing_test.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/drawing_test.bxml?rev=998240&r1=998239&r2=998240&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/drawing_test.bxml (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/drawing_test.bxml Fri Sep 17 18:40:59 2010
@@ -24,7 +24,7 @@ limitations under the License.
<media:Drawing>
<Canvas xmlns="org.apache.pivot.wtk.media.drawing">
<Rectangle x="0" y="0" width="120" height="60"
- fill="#ff0000" stroke=""/>
+ fill="#ff0000" stroke="$bxml:null"/>
<Ellipse x="60" y="30" width="120" height="120"
fill="#00ff00" stroke="#000000" strokeThickness="20">
<transforms>
Added: pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_628.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_628.bxml?rev=998240&view=auto
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_628.bxml (added)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_628.bxml Fri Sep 17 18:40:59 2010
@@ -0,0 +1,29 @@
+<?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.
+-->
+
+<Window title="Value Tag Test" maximized="true"
+ xmlns:bxml="http://pivot.apache.org/bxml"
+ xmlns="org.apache.pivot.wtk">
+ <windowStateListeners>
+ function windowOpened(window) {
+ java.lang.System.out.println("text = " + label.text);
+ }
+ </windowStateListeners>
+
+ <Label bxml:id="label" text="$bxml:null"/>
+</Window>
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.bxml?rev=998240&r1=998239&r2=998240&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.bxml (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/rotate_line.bxml Fri Sep 17 18:40:59 2010
@@ -24,7 +24,7 @@ limitations under the License.
<image>
<Drawing xmlns="org.apache.pivot.wtk.media">
<Canvas xmlns="org.apache.pivot.wtk.media.drawing">
- <Ellipse width="320" height="320" stroke="" fill="#eeeeee"/>
+ <Ellipse width="320" height="320" stroke="$bxml:null" fill="#eeeeee"/>
<Line x1="0" y1="0" x2="0" y2="-160" strokeThickness="4">
<transforms>
<Shape.Translate x="160" y="160"/>
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/simple_drawing.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/simple_drawing.bxml?rev=998240&r1=998239&r2=998240&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/simple_drawing.bxml (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/drawing/simple_drawing.bxml Fri Sep 17 18:40:59 2010
@@ -23,7 +23,7 @@ limitations under the License.
<ImageView>
<media:Drawing>
<Canvas xmlns="org.apache.pivot.wtk.media.drawing">
- <Ellipse x="0" y="0" width="240" height="240" stroke="" fill="#ffff00"/>
+ <Ellipse x="0" y="0" width="240" height="240" stroke="$bxml:null" fill="#ffff00"/>
<Ellipse x="70" y="60" width="30" height="40" fill="#000000"/>
<Ellipse x="140" y="60" width="30" height="40" fill="#000000"/>
<Arc x="60" y="120" width="120" height="70"
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/menu_buttons.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/menu_buttons.bxml?rev=998240&r1=998239&r2=998240&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/menu_buttons.bxml (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/menu_buttons.bxml Fri Sep 17 18:40:59 2010
@@ -80,7 +80,7 @@ limitations under the License.
<Drawing bxml:id="drawing"
xmlns="org.apache.pivot.wtk.media">
<Canvas xmlns="org.apache.pivot.wtk.media.drawing">
- <Rectangle bxml:id="border" stroke="" fill="#eeeeee" width="480" height="360"/>
+ <Rectangle bxml:id="border" stroke="$bxml:null" fill="#eeeeee" width="480" height="360"/>
</Canvas>
</Drawing>
</image>
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/media/drawing/Shape.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/media/drawing/Shape.java?rev=998240&r1=998239&r2=998240&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/media/drawing/Shape.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/media/drawing/Shape.java Fri Sep 17 18:40:59 2010
@@ -515,7 +515,7 @@ public abstract class Shape {
throw new IllegalArgumentException("fill is null.");
}
- setFill(fill.length() == 0 ? null : GraphicsUtilities.decodePaint(fill));
+ setFill(GraphicsUtilities.decodePaint(fill));
}
public Paint getStroke() {
@@ -536,7 +536,7 @@ public abstract class Shape {
throw new IllegalArgumentException("stroke is null.");
}
- setStroke(stroke.length() == 0 ? null : GraphicsUtilities.decodePaint(stroke));
+ setStroke(GraphicsUtilities.decodePaint(stroke));
}
public int getStrokeThickness() {