当前位置: 首页>>代码示例>>Java>>正文


Java Flow类代码示例

本文整理汇总了Java中io.datafx.controller.flow.Flow的典型用法代码示例。如果您正苦于以下问题:Java Flow类的具体用法?Java Flow怎么用?Java Flow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Flow类属于io.datafx.controller.flow包,在下文中一共展示了Flow类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import io.datafx.controller.flow.Flow; //导入依赖的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

示例2: start

import io.datafx.controller.flow.Flow; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    new Thread(() -> {
        try {
            SVGGlyphLoader.loadGlyphsFont(MainDemo.class.getResourceAsStream("/fonts/icomoon.svg"),
                "icomoon.svg");
        } catch (IOException ioExc) {
            ioExc.printStackTrace();
        }
    }).start();

    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);
    decorator.setText("JFoenix Demo");
    decorator.setGraphic(new SVGGlyph(""));

    double width = 800;
    double height = 600;
    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(MainDemo.class.getResource("/css/jfoenix-fonts.css").toExternalForm(),
                       MainDemo.class.getResource("/css/jfoenix-design.css").toExternalForm(),
                       MainDemo.class.getResource("/css/jfoenix-main-demo.css").toExternalForm());
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:39,代码来源:MainDemo.java

示例3: bindNodeToController

import io.datafx.controller.flow.Flow; //导入依赖的package包/类
private void bindNodeToController(Node node, Class<?> controllerClass, Flow flow, FlowHandler flowHandler) {
    flow.withGlobalLink(node.getId(), controllerClass);
}
 
开发者ID:b3log,项目名称:JHosts,代码行数:4,代码来源:SideMenuController.java


注:本文中的io.datafx.controller.flow.Flow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。