92 93 public class Modena extends Application { 94 public static final String TEST = "test"; 95 static { 96 System.getProperties().put("javafx.pseudoClassOverrideEnabled", "true"); 97 } 98 private static final String testAppCssUrl = Modena.class.getResource("TestApp.css").toExternalForm(); 99 private static String MODENA_STYLESHEET_URL; 100 private static String MODENA_EMBEDDED_STYLESHEET_URL; 101 private static String MODENA_STYLESHEET_BASE; 102 private static String CASPIAN_STYLESHEET_URL; 103 private static String CASPIAN_STYLESHEET_BASE; 104 static { 105 try { 106 // these are not supported ways to find the platform themes and may 107 // change release to release. Just used here for testing. 108 File caspianCssFile = new File("../../../modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css"); 109 if (!caspianCssFile.exists()) { 110 caspianCssFile = new File("rt/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css"); 111 } 112 CASPIAN_STYLESHEET_URL = caspianCssFile.exists() ? 113 caspianCssFile.toURI().toURL().toExternalForm() : 114 com.sun.javafx.scene.control.skin.ButtonSkin.class.getResource("caspian/caspian.css").toExternalForm(); 115 File modenaCssFile = new File("../../../modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css"); 116 if (!modenaCssFile.exists()) { 117 modenaCssFile = new File("rt/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css"); 118 System.out.println("modenaCssFile = " + modenaCssFile); 119 System.out.println("modenaCssFile = " + modenaCssFile.getAbsolutePath()); 120 } 121 MODENA_STYLESHEET_URL = modenaCssFile.exists() ? 122 modenaCssFile.toURI().toURL().toExternalForm() : 123 com.sun.javafx.scene.control.skin.ButtonSkin.class.getResource("modena/modena.css").toExternalForm(); 124 MODENA_STYLESHEET_BASE = MODENA_STYLESHEET_URL.substring(0,MODENA_STYLESHEET_URL.lastIndexOf('/')+1); 125 CASPIAN_STYLESHEET_BASE = CASPIAN_STYLESHEET_URL.substring(0,CASPIAN_STYLESHEET_URL.lastIndexOf('/')+1); 126 MODENA_EMBEDDED_STYLESHEET_URL = MODENA_STYLESHEET_BASE + "modena-embedded-performance.css"; 127 System.out.println("MODENA_EMBEDDED_STYLESHEET_URL = " + MODENA_EMBEDDED_STYLESHEET_URL); 128 } catch (MalformedURLException ex) { 129 Logger.getLogger(Modena.class.getName()).log(Level.SEVERE, null, ex); 130 } 131 } 132 133 private BorderPane outerRoot; 134 private BorderPane root; 135 private SamplePageNavigation samplePageNavigation; 136 private SamplePage samplePage; 137 private Node mosaic; 138 private Node heightTest; 139 private SimpleWindowPage simpleWindows; 140 private Node combinationsTest; 141 private Node customerTest; 142 private Stage mainStage; 143 private Color backgroundColor; | 92 93 public class Modena extends Application { 94 public static final String TEST = "test"; 95 static { 96 System.getProperties().put("javafx.pseudoClassOverrideEnabled", "true"); 97 } 98 private static final String testAppCssUrl = Modena.class.getResource("TestApp.css").toExternalForm(); 99 private static String MODENA_STYLESHEET_URL; 100 private static String MODENA_EMBEDDED_STYLESHEET_URL; 101 private static String MODENA_STYLESHEET_BASE; 102 private static String CASPIAN_STYLESHEET_URL; 103 private static String CASPIAN_STYLESHEET_BASE; 104 static { 105 try { 106 // these are not supported ways to find the platform themes and may 107 // change release to release. Just used here for testing. 108 File caspianCssFile = new File("../../../modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css"); 109 if (!caspianCssFile.exists()) { 110 caspianCssFile = new File("rt/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian.css"); 111 } 112 String jfxrtPath = Application.class.getProtectionDomain().getCodeSource().getLocation().getPath(); 113 CASPIAN_STYLESHEET_URL = caspianCssFile.exists() ? 114 caspianCssFile.toURI().toURL().toExternalForm() : "jar:file:" + jfxrtPath + 115 "!/com/sun/javafx/scene/control/skin/caspian/caspian.css"; 116 File modenaCssFile = new File("../../../modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css"); 117 if (!modenaCssFile.exists()) { 118 modenaCssFile = new File("rt/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css"); 119 System.out.println("modenaCssFile = " + modenaCssFile); 120 System.out.println("modenaCssFile = " + modenaCssFile.getAbsolutePath()); 121 } 122 MODENA_STYLESHEET_URL = modenaCssFile.exists() ? 123 modenaCssFile.toURI().toURL().toExternalForm() : "jar:file:" + jfxrtPath + 124 "!/com/sun/javafx/scene/control/skin/modena/modena.css"; 125 MODENA_STYLESHEET_BASE = MODENA_STYLESHEET_URL.substring(0,MODENA_STYLESHEET_URL.lastIndexOf('/')+1); 126 CASPIAN_STYLESHEET_BASE = CASPIAN_STYLESHEET_URL.substring(0,CASPIAN_STYLESHEET_URL.lastIndexOf('/')+1); 127 MODENA_EMBEDDED_STYLESHEET_URL = MODENA_STYLESHEET_BASE + "modena-embedded-performance.css"; 128 System.out.println("MODENA_EMBEDDED_STYLESHEET_URL = " + MODENA_EMBEDDED_STYLESHEET_URL); 129 } catch (MalformedURLException ex) { 130 Logger.getLogger(Modena.class.getName()).log(Level.SEVERE, null, ex); 131 } 132 } 133 134 private BorderPane outerRoot; 135 private BorderPane root; 136 private SamplePageNavigation samplePageNavigation; 137 private SamplePage samplePage; 138 private Node mosaic; 139 private Node heightTest; 140 private SimpleWindowPage simpleWindows; 141 private Node combinationsTest; 142 private Node customerTest; 143 private Stage mainStage; 144 private Color backgroundColor; |