类javafx.scene.control.Pagination源码实例Demo

下面列出了怎么用javafx.scene.control.Pagination的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: marathonv5   文件: PaginationSample.java
@Override
public void start(final Stage stage) throws Exception {
    fonts = Font.getFamilies().toArray(fonts);

    pagination = new Pagination(fonts.length / itemsPerPage(), 0);
    pagination.getStyleClass().add(Pagination.STYLE_CLASS_BULLET);
    pagination.setPageFactory((Integer pageIndex) -> createPage(pageIndex));
    AnchorPane anchor = new AnchorPane();
    AnchorPane.setTopAnchor(pagination, 10.0);
    AnchorPane.setRightAnchor(pagination, 10.0);
    AnchorPane.setBottomAnchor(pagination, 10.0);
    AnchorPane.setLeftAnchor(pagination, 10.0);
    anchor.getChildren().addAll(pagination);
    Scene scene = new Scene(anchor);
    stage.setScene(scene);
    stage.setTitle("PaginationSample");
    scene.getStylesheets().add("paginationsample/ControlStyle.css");
    stage.show();
}
 
源代码2 项目: WorkbenchFX   文件: AllPatientsView.java
@Override
public void initializeParts() {
  pagination = new Pagination();
  pagination.getStyleClass().add("patient-pagination");
  pagination.getStyleClass().add(Pagination.STYLE_CLASS_BULLET);
  pagination.pageCountProperty().bind(Bindings.size(cabinet.getAllPatients()));
  pagination.setPageFactory(
      param -> new PatientView(cabinet.getAllPatients().get(param), translator));
}
 
源代码3 项目: WorkbenchFX   文件: AddModuleView.java
/**
 * {@inheritDoc}
 */
@Override
public final void layoutParts() {
  getStyleClass().add(Pagination.STYLE_CLASS_BULLET);
}
 
源代码4 项目: game-of-life-java   文件: PresetHandler.java
public AnchorPane loadPresets(FlowPane base) {
    
    File dir = new File("Presets");
    File[] selectedFiles = dir.listFiles(new FileFilter() {
        @Override
        public boolean accept(File pathname) {
            if (pathname.getName().endsWith(".gofb")){
                presetCount++;
                return true;}
            return false;
        }
    });
    int pr = 0;
    presets = new String[presetCount];
    for (File selectedFile : selectedFiles) {
        presets[pr] = selectedFile.getName().substring(0, selectedFile.getName().length() - 5);
        pr++;
    }

    Pagination presetsPagination = new Pagination(presets.length, 0);
    //pagination.setStyle("-fx-border-color:red;");
    presetsPagination.setPageFactory(new Callback<Integer, Node>() {
        @Override
        public Node call(Integer pageIndex) {
            if (pageIndex >= presets.length) {
                return null;
            } else {
                return createPresetPage(pageIndex, base);
            }
        }
    });

    AnchorPane anchor = new AnchorPane();
    AnchorPane.setTopAnchor(presetsPagination, 10.0);
    AnchorPane.setRightAnchor(presetsPagination, 10.0);
    AnchorPane.setBottomAnchor(presetsPagination, 10.0);
    AnchorPane.setLeftAnchor(presetsPagination, 10.0);
    anchor.getChildren().addAll(presetsPagination);
    
    return anchor;
}
 
 类所在包
 类方法
 同包方法