1 /*
   2  * Copyright (c) 2009, 2012, 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  */
  24 package test.scenegraph.lcd;
  25 
  26 import javafx.geometry.Insets;
  27 import javafx.scene.Scene;
  28 import javafx.scene.layout.VBox;
  29 import javafx.scene.text.FontSmoothingType;
  30 import javafx.scene.text.Text;
  31 import test.javaclient.shared.InteroperabilityApp;
  32 import test.javaclient.shared.Utils;
  33 
  34 /**
  35  *
  36  * @author Alexander Petrov
  37  */
  38 public class LcdAPITestApp extends InteroperabilityApp {
  39     static {
  40         System.setProperty("prism.lcdtext", "true");
  41     }
  42     /**
  43      * @param args the command line arguments
  44      */
  45     public static void main(String[] args) {
  46         Utils.launch(LcdAPITestApp.class, args);
  47     }
  48 
  49 
  50     @Override
  51     protected Scene getScene() {
  52         VBox root = new VBox();
  53                 root.setPadding(new Insets(10));
  54                 root.setSpacing(10);
  55                 Text t1 = new Text("Text");
  56                 t1.setId("GrayGray");
  57                 t1.setFontSmoothingType(FontSmoothingType.GRAY);
  58                 t1.setStyle("-fx-font-size: 16;-fx-font-smoothing-type: gray; ");
  59                 Text t2 = new Text("Text");
  60                 t2.setId("LCDGray");
  61                 t2.setFontSmoothingType(FontSmoothingType.LCD);
  62                 t2.setStyle("-fx-font-size: 16;-fx-font-smoothing-type: gray; ");
  63                 Text t3 = new Text("Text");
  64                 t3.setId("GrayLCD");
  65                 t3.setFontSmoothingType(FontSmoothingType.GRAY);
  66                 t3.setStyle("-fx-font-size: 16;-fx-font-smoothing-type: lcd; ");
  67                 Text t4 = new Text("Text");
  68                 t4.setId("LCDLCD");
  69                 t4.setFontSmoothingType(FontSmoothingType.LCD);
  70                 t4.setStyle("-fx-font-size: 16;-fx-font-smoothing-type: lcd;");
  71                 root.getChildren().addAll(t1, t2, t3, t4);
  72         return new Scene(root, 200, 200);
  73     }
  74 }