MCPcopy Create free account
hub / github.com/SW-Fantastic/Reader / bindViews

Method bindViews

src/main/java/org/swdc/reader/ui/MainView.java:63–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61 }
62
63 private void bindViews(){
64 Stage stage = this.getStage();
65 stage.setMinHeight(580);
66 stage.setMinWidth(1000);
67
68 BorderPane reader = (BorderPane)readerView.getView();
69 reader.prefHeightProperty().bind(stage.heightProperty().subtract(48));
70 reader.prefWidthProperty().bind(stage.widthProperty().subtract(84));
71
72 BorderPane config = (BorderPane)configureView.getView();
73 config.prefHeightProperty().bind(stage.heightProperty().subtract(48));
74 config.prefWidthProperty().bind(stage.widthProperty().subtract(84));
75
76
77 // 不知道为什么,view被首次set到center的时候,在窗口中不会显示此view。
78 // 在这里首先把每一个view分别set到center一遍,防止这种情况。
79 // 我可以确信不是本框架的问题,在出现此问题的时候view组件均已经初始化完毕。
80 BorderPane root = this.findById("content");
81 root.setCenter(config);
82 // 主界面。
83 root.setCenter(reader);
84 }
85
86 private void changeView() {
87 ToggleButton view = (ToggleButton) group.getSelectedToggle();

Callers 1

initMethod · 0.95

Calls 2

bindMethod · 0.80
getViewMethod · 0.65

Tested by

no test coverage detected