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