6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package javafx.scene.shape;
27
28 import com.sun.javafx.geom.Path2D;
29 import com.sun.javafx.pgstub.SVGPathImpl;
30 import com.sun.javafx.sg.prism.NGNode;
31 import com.sun.javafx.sg.prism.NGSVGPath;
32 import javafx.beans.property.SimpleStringProperty;
33 import javafx.beans.property.StringProperty;
34 import javafx.scene.NodeTest;
35 import org.junit.Test;
36
37 import static org.junit.Assert.*;
38
39 public class SVGPathTest {
40
41 @Test public void testBoundPropertySync_Content() throws Exception {
42 StubSVGPath svgPath = new StubSVGPath();
43 svgPath.setContent("M40,60 C42,48 44,30 25,32");
44
45 StringProperty content = new SimpleStringProperty();
46 svgPath.contentProperty().bind(content);
47 String s = "M11,11 C22,22 33,33";
48 content.set(s);
49 NodeTest.syncNode(svgPath);
50
51 SVGPathImpl geometry = ((StubNGSVGPath) svgPath.impl_getPeer()).geometry;
52 assertEquals(s, geometry.getContent());
53 }
54
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package test.javafx.scene.shape;
27
28 import com.sun.javafx.geom.Path2D;
29 import test.com.sun.javafx.pgstub.SVGPathImpl;
30 import com.sun.javafx.sg.prism.NGNode;
31 import com.sun.javafx.sg.prism.NGSVGPath;
32 import javafx.beans.property.SimpleStringProperty;
33 import javafx.beans.property.StringProperty;
34 import test.javafx.scene.NodeTest;
35 import javafx.scene.shape.FillRule;
36 import javafx.scene.shape.SVGPath;
37 import org.junit.Test;
38
39 import static org.junit.Assert.*;
40
41 public class SVGPathTest {
42
43 @Test public void testBoundPropertySync_Content() throws Exception {
44 StubSVGPath svgPath = new StubSVGPath();
45 svgPath.setContent("M40,60 C42,48 44,30 25,32");
46
47 StringProperty content = new SimpleStringProperty();
48 svgPath.contentProperty().bind(content);
49 String s = "M11,11 C22,22 33,33";
50 content.set(s);
51 NodeTest.syncNode(svgPath);
52
53 SVGPathImpl geometry = ((StubNGSVGPath) svgPath.impl_getPeer()).geometry;
54 assertEquals(s, geometry.getContent());
55 }
56
|