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.layout.VBoxBuilder; 30 import javafx.scene.text.FontSmoothingType; 31 import javafx.scene.text.TextBuilder; 32 import test.javaclient.shared.InteroperabilityApp; 33 import test.javaclient.shared.Utils; 34 35 /** 36 * 37 * @author Alexander Petrov 38 */ 39 public class LcdAPITestApp extends InteroperabilityApp { 40 static { 41 System.setProperty("prism.lcdtext", "true"); 42 } 43 /** 44 * @param args the command line arguments 45 */ 46 public static void main(String[] args) { 47 Utils.launch(LcdAPITestApp.class, args); 48 } 49 50 51 @Override 52 protected Scene getScene() { 53 VBox root = VBoxBuilder.create() 54 .padding(new Insets(10)) 55 .spacing(10) 56 .children( 57 TextBuilder.create() 58 .id("GrayGray") 59 .text("Text") 60 .fontSmoothingType(FontSmoothingType.GRAY) 61 .style("-fx-font-size: 16;-fx-font-smoothing-type: gray; ") 62 .build(), 63 TextBuilder.create() 64 .id("LCDGray") 65 .text("Text") 66 .fontSmoothingType(FontSmoothingType.LCD) 67 .style("-fx-font-size: 16;-fx-font-smoothing-type: gray; ") 68 .build(), 69 TextBuilder.create() 70 .id("GrayLCD") 71 .text("Text") 72 .fontSmoothingType(FontSmoothingType.GRAY) 73 .style("-fx-font-size: 16;-fx-font-smoothing-type: lcd; ") 74 .build(), 75 TextBuilder.create() 76 .id("LCDLCD") 77 .text("Text") 78 .fontSmoothingType(FontSmoothingType.LCD) 79 .style("-fx-font-size: 16;-fx-font-smoothing-type: lcd;") 80 .build() 81 ) 82 .build(); 83 84 return new Scene(root, 200, 200); 85 } 86 } | 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 } |