本文整理匯總了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);
}
示例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();
}
示例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());
}