modules/graphics/src/test/java/com/sun/javafx/css/HonorDeveloperSettingsTest.java

Print this page
rev 6167 : RT-35330 [Monocle] Remove StubToolkit and replace it with headless glass implementation


  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 com.sun.javafx.css;
  27 
  28 import static org.junit.Assert.*;
  29 

  30 import javafx.beans.value.ChangeListener;
  31 import javafx.beans.value.ObservableValue;
  32 import javafx.scene.Cursor;
  33 import javafx.scene.Group;
  34 import javafx.scene.Scene;
  35 import javafx.scene.shape.Rectangle;
  36 import javafx.scene.text.Font;
  37 import javafx.scene.text.FontSmoothingType;
  38 import javafx.scene.text.Text;
  39 import javafx.stage.Stage;
  40 import javafx.stage.Window;
  41 
  42 import com.sun.javafx.Logging;
  43 import org.junit.Before;
  44 import org.junit.Test;
  45 import sun.util.logging.PlatformLogger;
  46 
  47 /**
  48  * AKA: RT-7401. Tests that the pattern used works by testing opacity
  49  * specifically. Tests for font and text-fill should be done in the tests
  50  * for Label and Labeled.
  51  */
  52 public class HonorDeveloperSettingsTest {
  53 



  54     private Scene scene;
  55     private Rectangle rect;
  56     private Text text;
  57 
  58     // Scene must have a Window for CSS to load the stylesheet.
  59     // And Window must have a Scene for StyleManager to find the right scene
  60     static class TestWindow extends Window {
  61         @Override public void setScene(Scene value) {
  62             super.setScene(value);
  63         }
  64     }
  65 
  66     @Before
  67     public void setUp() {
  68         rect = new Rectangle();
  69         rect.setId("rectangle");
  70 
  71         text = new Text();
  72         text.setId("text");
  73 




  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 com.sun.javafx.css;
  27 
  28 import static org.junit.Assert.*;
  29 
  30 import com.sun.javafx.FXUnit;
  31 import javafx.beans.value.ChangeListener;
  32 import javafx.beans.value.ObservableValue;
  33 import javafx.scene.Cursor;
  34 import javafx.scene.Group;
  35 import javafx.scene.Scene;
  36 import javafx.scene.shape.Rectangle;
  37 import javafx.scene.text.Font;
  38 import javafx.scene.text.FontSmoothingType;
  39 import javafx.scene.text.Text;
  40 import javafx.stage.Stage;
  41 import javafx.stage.Window;
  42 
  43 import com.sun.javafx.Logging;
  44 import org.junit.*;

  45 import sun.util.logging.PlatformLogger;
  46 
  47 /**
  48  * AKA: RT-7401. Tests that the pattern used works by testing opacity
  49  * specifically. Tests for font and text-fill should be done in the tests
  50  * for Label and Labeled.
  51  */
  52 public class HonorDeveloperSettingsTest {
  53 
  54     @org.junit.Rule
  55     public FXUnit fx = new FXUnit();
  56 
  57     private Scene scene;
  58     private Rectangle rect;
  59     private Text text;
  60 
  61     // Scene must have a Window for CSS to load the stylesheet.
  62     // And Window must have a Scene for StyleManager to find the right scene
  63     static class TestWindow extends Window {
  64         @Override public void setScene(Scene value) {
  65             super.setScene(value);
  66         }
  67     }
  68 
  69     @Before
  70     public void setUp() {
  71         rect = new Rectangle();
  72         rect.setId("rectangle");
  73 
  74         text = new Text();
  75         text.setId("text");
  76