1 /* 2 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 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 java.util.Arrays; 29 import java.util.Collection; 30 31 import javafx.scene.paint.Color; 32 import javafx.scene.shape.Rectangle; 33 import javafx.scene.shape.StrokeLineCap; 34 import javafx.scene.shape.StrokeLineJoin; 35 import javafx.scene.shape.StrokeType; 36 37 import org.junit.runner.RunWith; 38 import org.junit.runners.Parameterized; 39 import org.junit.runners.Parameterized.Parameters; 40 41 import test.com.sun.javafx.test.CssMethodsTestBase; 42 43 @RunWith(Parameterized.class) 44 public class Shape_cssMethods_Test extends CssMethodsTestBase { 45 private static final Rectangle TEST_SHAPE = new Rectangle(100, 100); 46 47 @Parameters 48 public static Collection data() { 49 return Arrays.asList(new Object[] { 50 config(TEST_SHAPE, "fill", null, "-fx-fill", Color.RED), 51 config(TEST_SHAPE, "fill", null, "-fx-fill", null), 52 config(TEST_SHAPE, "smooth", false, "-fx-smooth", true), 53 config(TEST_SHAPE, "stroke", null, "-fx-stroke", Color.BLUE), 54 config(TEST_SHAPE, "strokeDashOffset", 0.0, 55 "-fx-stroke-dash-offset", 2.0), 56 config(TEST_SHAPE, "strokeLineCap", StrokeLineCap.SQUARE, 57 "-fx-stroke-line-cap", StrokeLineCap.ROUND), 58 config(TEST_SHAPE, "strokeLineJoin", StrokeLineJoin.BEVEL, 59 "-fx-stroke-line-join", StrokeLineJoin.MITER), 60 config(TEST_SHAPE, "strokeType", StrokeType.CENTERED, 61 "-fx-stroke-type", StrokeType.INSIDE), 62 config(TEST_SHAPE, "strokeMiterLimit", 0.0, 63 "-fx-stroke-miter-limit", 20.0), 64 config(TEST_SHAPE, "strokeWidth", 1.0, 65 "-fx-stroke-width", 2.0), 66 // TODO: strokeDashArray is not writable! 67 // config(TEST_SHAPE, Shape.STROKE_DASH_ARRAY, 68 // new GenericObservableList<Double>(), 69 // "-fx-stroke-dash-array", 70 // new GenericObservableList<Double>(10.0, 5.0, 2.0)), 71 config(TEST_SHAPE, "translateY", 0.0, 72 "-fx-translate-y", 10.0) 73 }); 74 } 75 76 public Shape_cssMethods_Test(final Configuration configuration) { 77 super(configuration); 78 } 79 80 static { 81 } 82 }