當前位置: 首頁>>代碼示例>>Java>>正文


Java Scene.getStylesheets方法代碼示例

本文整理匯總了Java中javafx.scene.Scene.getStylesheets方法的典型用法代碼示例。如果您正苦於以下問題:Java Scene.getStylesheets方法的具體用法?Java Scene.getStylesheets怎麽用?Java Scene.getStylesheets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.Scene的用法示例。


在下文中一共展示了Scene.getStylesheets方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: EditorDialog

import javafx.scene.Scene; //導入方法依賴的package包/類
/**
 * Instantiates a new Editor dialog.
 */
public EditorDialog() {
    this.showedTime = LocalTime.now();

    container = new VBox();
    container.setAlignment(CENTER);

    final EditorConfig editorConfig = EditorConfig.getInstance();
    final CssColorTheme theme = editorConfig.getTheme();

    final Scene scene = new Scene(container);
    final ObservableList<String> stylesheets = scene.getStylesheets();
    stylesheets.addAll(CSS_REGISTRY.getAvailableCssFiles());
    stylesheets.add(theme.getCssFile());

    createControls(container);

    dialog = new Stage();
    dialog.setTitle(getTitleText());
    dialog.initStyle(StageStyle.UTILITY);
    dialog.initModality(Modality.WINDOW_MODAL);
    dialog.setResizable(isResizable());
    dialog.setScene(scene);

    configureSize(container);
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:29,代碼來源:EditorDialog.java

示例2: start

import javafx.scene.Scene; //導入方法依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
    Flow flow = new Flow(MainController.class);
    DefaultFlowContainer container = new DefaultFlowContainer();
    flowContext = new ViewFlowContext();
    flowContext.register("Stage", stage);
    flow.createHandler(flowContext).start(container);

    JFXDecorator decorator = new JFXDecorator(stage, container.getView());
    decorator.setCustomMaximize(true);

    double width = 700;
    double height = 200;
    try {
        Rectangle2D bounds = Screen.getScreens().get(0).getBounds();
        width = bounds.getWidth() / 2.5;
        height = bounds.getHeight() / 1.35;
    } catch (Exception e) {
    }

    Scene scene = new Scene(decorator, width, height);
    final ObservableList<String> stylesheets = scene.getStylesheets();
    stylesheets.addAll(Main.class.getResource("/css/jfoenix-fonts.css").toExternalForm(),
            Main.class.getResource("/css/jfoenix-design.css").toExternalForm(),
            Main.class.getResource("/css/jhosts-main.css").toExternalForm());
    stage.setScene(scene);
    stage.show();
}
 
開發者ID:b3log,項目名稱:JHosts,代碼行數:29,代碼來源:Main.java

示例3: setPreferredStylesheets

import javafx.scene.Scene; //導入方法依賴的package包/類
public static void setPreferredStylesheets(Configuration config, Scene scene) {
    ObservableList<String> stylesheets = scene.getStylesheets();
    stylesheets.add(config.getCssfile());
    Utils.addStylesheets(stylesheets);
    log.info(stylesheets.toString());
}
 
開發者ID:schwabdidier,項目名稱:GazePlay,代碼行數:7,代碼來源:CssUtil.java


注:本文中的javafx.scene.Scene.getStylesheets方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。