Java 类javafx.scene.control.ScrollPane.ScrollBarPolicy 实例源码

项目:marathonv5    文件:CheckList.java   
private Node createTextArea(boolean selectable, boolean editable) {
    textArea = new TextArea();
    textArea.setPrefRowCount(4);
    textArea.setEditable(editable);
    textArea.textProperty().addListener((observable, oldValue, newValue) -> {
        text = textArea.getText();
    });
    textArea.setText(text);
    ScrollPane scrollPane = new ScrollPane(textArea);
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
    scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    HBox.setHgrow(scrollPane, Priority.ALWAYS);
    return scrollPane;
}
项目:BudgetMaster    文件:MonthBarChart.java   
public MonthBarChart(ArrayList<MonthInOutSum> monthInOutSums, String currency)
{
    if(monthInOutSums == null)
    {
        this.monthInOutSums = new ArrayList<>();
    }
    else
    {
        this.monthInOutSums = monthInOutSums;
    }
    this.currency = currency;   

    ScrollPane scrollPane = new ScrollPane();
       scrollPane.setVbarPolicy(ScrollBarPolicy.NEVER);
       scrollPane.setFocusTraversable(false);
       scrollPane.setStyle("-fx-background-color: transparent; -fx-background-insets: 0; -fx-border-color: transparent; -fx-border-width: 0; -fx-border-insets: 0;");
       scrollPane.setPadding(new Insets(0, 0, 10, 0));

       HBox generatedChart = generate();              
       scrollPane.setContent(generatedChart);
       generatedChart.prefHeightProperty().bind(scrollPane.heightProperty().subtract(30));
       this.getChildren().add(scrollPane);
       VBox.setVgrow(scrollPane, Priority.ALWAYS);

       this.getChildren().add(generateLegend());
}
项目:programmierpraktikum-abschlussprojekt-nimmdochirgendeinennamen    文件:Tracker.java   
/**
 * Prints the content of the tracking log into a new Stage.
 */
public void showOutput() {
    Text show = new Text(output());

    ScrollPane window = new ScrollPane();
    window.setContent(show);
    window.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    window.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);

    Scene scene = new Scene(window, 400, 600);
    Stage stage = new Stage();

    stage.setTitle("Tracking history");
    stage.setScene(scene);
    stage.show();
}
项目:sgf4j-gui    文件:MainUI.java   
private ScrollPane generateMoveTreePane() {

    movePane = new GridPane();
    movePane.setPadding(new Insets(0, 0, 0, 0));
    movePane.setStyle("-fx-background-color: white");

    treePaneScrollPane = new ScrollPane(movePane);
    treePaneScrollPane.setPrefHeight(150);
    treePaneScrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    treePaneScrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);

    movePane.setMinWidth(640);
    movePane.setMaxWidth(Control.USE_PREF_SIZE);

    return treePaneScrollPane;
  }
项目:ShootOFF    文件:SessionViewerController.java   
private void updateCameraTabs() {
    cameraTabPane.getTabs().clear();
    cameraGroups.clear();
    eventSelectionsPerTab.clear();

    for (final String cameraName : currentSession.getEvents().keySet()) {
        final Group canvas = new Group();
        final ScrollPane scrollPane = new ScrollPane(canvas);
        scrollPane.setPrefSize(cameraTabPane.getPrefWidth(), cameraTabPane.getPrefHeight());
        scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
        scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        cameraGroups.put(cameraName, new SessionCanvasManager(canvas, config));

        final Tab cameraTab = new Tab(cameraName);
        cameraTab.setContent(scrollPane);
        cameraTabPane.getTabs().add(cameraTab);
    }
}
项目:org.csstudio.display.builder    文件:SplitPaneDemo.java   
@Override
public void start(final Stage stage)
{
    final SplitPane split = new SplitPane();

    Label label = new Label("Left");
    label.setMaxWidth(Double.MAX_VALUE);
    label.setStyle(DEBUG_STYLE);
    final StackPane left = new StackPane(label);

    label = new Label("Some long text in the right panel");
    label.setStyle(DEBUG_STYLE);
    label.setMaxWidth(Double.MAX_VALUE);
    label.setPrefWidth(Double.MAX_VALUE);
    final ScrollPane scroll = new ScrollPane(label);
    scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    final StackPane right = new StackPane(scroll);

    split.getItems().addAll(left, right);
    split.setDividerPositions(0.5);

    final Scene scene = new Scene(split, 800, 700);
    stage.setScene(scene);
    stage.show();
}
项目:jfx-torrent    文件:UiSettingsContentPane.java   
private Node buildUISettingsOptionsView() {
    final TitledBorderPane displayOptions = new TitledBorderPane(
            "Display Options", buildDisplayOptionsPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
    final TitledBorderPane systemTrayOptions = new TitledBorderPane(
            "System Tray", buildSystemTrayOptionsPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
    final TitledBorderPane torrentAdditionOptions = new TitledBorderPane(
            "When Adding Torrents", buildOnTorrentAdditionOptionsPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
    final TitledBorderPane doubleClickActionsOptions = new TitledBorderPane(
            "Actions for Double Click", buildDoubleClickActionsOptionPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);

    final VBox content = new VBox();
    content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
    content.getChildren().addAll(displayOptions, systemTrayOptions, torrentAdditionOptions,
            doubleClickActionsOptions);

    final ScrollPane contentScroll = new ScrollPane(content);
    contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    contentScroll.setFitToWidth(true);

    return contentScroll;
}
项目:jfx-torrent    文件:BitTorrentContentPane.java   
private Node buildOptionsView() {
    final TitledBorderPane basicOptions = new TitledBorderPane(
            "Basic BitTorrent Features", buildBasicOptionsPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
    final TitledBorderPane trackerOptions = new TitledBorderPane(
            "Tracker Features", buildTrackerOptionsPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);
    final TitledBorderPane encryptionOptions = new TitledBorderPane(
            "Protocol Encryption", buildEncryptionOptionsPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);

    final VBox content = new VBox();
    content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
    content.getChildren().addAll(basicOptions, trackerOptions, encryptionOptions);

    final ScrollPane contentScroll = new ScrollPane(content);
    contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    contentScroll.setFitToWidth(true);

    return contentScroll;
}
项目:jfx-torrent    文件:UiExtrasContentPane.java   
private Node buildUiExtrasOptionsView() {
    final TitledBorderPane themeOptions = new TitledBorderPane(
            "Theme Options", buildThemeOptionsPane(), BorderStyle.COMPACT,
            TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE);

    final VBox content = new VBox();
    content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
    content.getChildren().addAll(themeOptions);

    final ScrollPane contentScroll = new ScrollPane(content);
    contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    contentScroll.setFitToWidth(true);

    return contentScroll;
}
项目:jfx-torrent    文件:ConnectionContentPane.java   
@Override
protected Node build() {
    final VBox content = new VBox();
    content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
    content.getChildren().addAll(
            new TitledBorderPane("Listening Port", buildPortSettingsPane(), BorderStyle.COMPACT,
                    TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE),
            new TitledBorderPane("Network Interface", buildNetworkInterfaceSettingsPane(), BorderStyle.COMPACT,
                    TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE));

    final ScrollPane contentScroll = new ScrollPane(content);
    contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    contentScroll.setFitToWidth(true);
    return contentScroll;
}
项目:cvia    文件:RootWindowController.java   
private void showManageJobLayout() {
    clearAllLayout();

    try {
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(CviaApp.class.getResource("/JobDescriptionList.fxml"));

        jdPane = (ScrollPane) loader.load();
        JobDescriptionListController jdListController = loader.getController();

        jdPane.setLayoutX(200);
        jdPane.setLayoutY(0);
        jdPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        jdPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
        rootPane.getChildren().add(jdPane);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
项目:VOOGASalad    文件:DecisionTableButton.java   
private void showTable(DecisionTable dt) {
    Stage stage = new Stage();
    stage.setWidth(dimension);
    stage.setHeight(dimension); 
    stage.setResizable(false);
    stage.initStyle(StageStyle.UTILITY);
    Group root = new Group(); 
    ScrollPane sp = new ScrollPane();
    sp.setContent(dt);
    sp.setPannable(true);
    sp.setMaxHeight(maxDimensionSize); 
    sp.setMaxWidth(maxDimensionSize); 
    sp.setPrefSize(dimension-barOffset, dimension-barOffset); 
    sp.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    sp.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    Scene s = new Scene(root);
    root.getChildren().add(sp);
    stage.setScene(s);  
    stage.show();
    return;
}
项目:livestreamer_twitch_gui    文件:BrowserTab.java   
private ScrollPane buildContent() {
    final ScrollPane scrollPane = new ScrollPane();
    scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);

    final TilePane pane = new TilePane();
    pane.setOnScroll(scrollEvent -> {
        final double deltaY = scrollEvent.getDeltaY() * 2.0D;
        final double height = BrowserTab.this.getCustomContent().getBoundsInLocal().getHeight();
        final double vValue = BrowserTab.this.getCustomContent().getVvalue();
        BrowserTab.this.getCustomContent().setVvalue(vValue - deltaY / height);
    });
    pane.setPrefColumns(PREFERED_COLUMNS);
    pane.setVgap(ITEM_GAP);
    pane.setHgap(ITEM_GAP);
    pane.setPadding(new Insets(ITEM_GAP));
    this.activeItemsProperty().addListener((ListChangeListener.Change<? extends ITwitchItem> c) -> pane
            .getChildren().setAll(convertToNodeList(this.activeItemsProperty().get())));
    scrollPane.setContent(pane);
    return scrollPane;
}
项目:pdfsam    文件:WorkArea.java   
@Inject
public WorkArea(List<Module> modules, QuickbarModuleButtonsPane modulesButtons) {
    getStyleClass().addAll(Style.CONTAINER.css());
    setId("work-area");
    for (Module module : modules) {
        this.modules.put(module.id(), module);
    }
    fade.setFromValue(0);
    fade.setToValue(1);
    center.setHbarPolicy(ScrollBarPolicy.NEVER);
    center.setFitToWidth(true);
    center.setFitToHeight(true);
    setCenter(center);
    setLeft(new QuickbarPane(modulesButtons));
    eventStudio().addAnnotatedListeners(this);
}
项目:pdfsam    文件:NewsPanel.java   
public NewsPanel() {
    getStyleClass().add("news-panel");
    getStyleClass().addAll(Style.CONTAINER.css());
    Button closeButton = GlyphsDude.createIconButton(FontAwesomeIcon.TIMES);
    closeButton.getStyleClass().addAll("close-button");
    closeButton.setOnAction(e -> eventStudio().broadcast(HideNewsPanelRequest.INSTANCE));
    Label titleLabel = new Label(DefaultI18nContext.getInstance().i18n("What's new"));
    titleLabel.setPrefWidth(Integer.MAX_VALUE);
    titleLabel.getStyleClass().add("news-panel-title");

    StackPane top = new StackPane(titleLabel, closeButton);
    top.setAlignment(Pos.TOP_RIGHT);

    scroll.getStyleClass().add("scrollable-news");
    scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    scroll.setFitToHeight(true);
    scroll.setFitToWidth(true);
    getChildren().addAll(top, scroll);

    eventStudio().addAnnotatedListeners(this);
}
项目:lttng-scope    文件:UiModelApp2.java   
@Override
public void start(Stage primaryStage) throws Exception {
    if (primaryStage == null) {
        return;
    }

    /* Layers */
    Group backgroundLayer = new Group();
    Group statesLayer = new Group();
    Group selectionLayer = new Group();

    Pane paintingPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
    paintingPane.setStyle(BACKGROUND_STYLE);

    /* Top-level */
    Pane contentPane = new Pane(paintingPane);
    contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());

    ScrollPane scrollPane = new ScrollPane(contentPane);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);
    scrollPane.setPannable(true);

    BorderPane borderPane = new BorderPane(scrollPane);

    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
    primaryStage.setHeight(500);
    primaryStage.setWidth(500);

    contentPane.setPrefHeight(200);
    contentPane.setPrefWidth(PANE_WIDTH);

    /* Bind painting pane's height to the content pane */
    paintingPane.minHeightProperty().bind(contentPane.minHeightProperty());
    paintingPane.prefHeightProperty().bind(contentPane.prefHeightProperty());
    paintingPane.maxHeightProperty().bind(contentPane.maxHeightProperty());

    /* We set painting's pane width programmatically */
    paintingPane.minWidthProperty().bind(paintingPane.prefWidthProperty());
    paintingPane.maxWidthProperty().bind(paintingPane.prefWidthProperty());

    paintingPane.setPrefWidth(2000);
    double x = PANE_WIDTH - 2000;
    System.out.println(x);
    paintingPane.relocate(x, 0);

    drawBackground(backgroundLayer, paintingPane);
    drawRectangles(statesLayer);
    drawSelection(selectionLayer, paintingPane);
}
项目:lttng-scope    文件:UiModelApp.java   
@Override
public void start(Stage primaryStage) throws Exception {
    if (primaryStage == null) {
        return;
    }

    /* Layers */
    Group backgroundLayer = new Group();
    Group statesLayer = new Group();
    Group selectionLayer = new Group();

    /* Top-level */
    Pane contentPane = new Pane(backgroundLayer, statesLayer, selectionLayer);
    contentPane.minWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.maxWidthProperty().bind(contentPane.prefWidthProperty());
    contentPane.setStyle(BACKGROUND_STYLE);

    ScrollPane scrollPane = new ScrollPane(contentPane);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
    scrollPane.setFitToHeight(true);
    scrollPane.setFitToWidth(true);
    scrollPane.setPannable(true);

    BorderPane borderPane = new BorderPane(scrollPane);

    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
    primaryStage.setHeight(500);
    primaryStage.setWidth(500);

    contentPane.setPrefHeight(200);
    contentPane.setPrefWidth(PANE_WIDTH);

    drawBackground(backgroundLayer, contentPane);
    drawRectangles(statesLayer);
    drawSelection(selectionLayer, contentPane);
}
项目:marathonv5    文件:FunctionStage.java   
private void initComponents() {
    mainSplitPane.setDividerPositions(0.35);
    mainSplitPane.getItems().addAll(createTree(), functionSplitPane);

    expandAllBtn.setOnAction((e) -> expandAll());
    collapseAllBtn.setOnAction((e) -> collapseAll());
    refreshButton.setOnAction((e) -> refresh());
    topButtonBar.setId("topButtonBar");
    topButtonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
    topButtonBar.getButtons().addAll(expandAllBtn, collapseAllBtn, refreshButton);

    functionSplitPane.setDividerPositions(0.4);
    functionSplitPane.setOrientation(Orientation.VERTICAL);
    documentArea = functionInfo.getEditorProvider().get(false, 0, IEditorProvider.EditorType.OTHER, false);
    Platform.runLater(() -> {
        documentArea.setEditable(false);
        documentArea.setMode("ruby");
    });

    argumentPane = new VBox();
    ScrollPane scrollPane = new ScrollPane(argumentPane);
    scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
    scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    functionSplitPane.getItems().addAll(documentArea.getNode(), scrollPane);

    okButton.setOnAction(new OkHandler());
    okButton.setDisable(true);
    cancelButton.setOnAction((e) -> dispose());
    buttonBar.getButtons().addAll(okButton, cancelButton);
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
}
项目:marathonv5    文件:CheckList.java   
private Node createTextArea(boolean selectable, boolean editable) {
    textArea.setPrefRowCount(4);
    textArea.setEditable(editable);
    textArea.textProperty().addListener((observable, oldValue, newValue) -> {
        text = textArea.getText();
    });
    textArea.setText(text);
    ScrollPane scrollPane = new ScrollPane(textArea);
    scrollPane.setFitToWidth(true);
    scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    HBox.setHgrow(scrollPane, Priority.ALWAYS);
    return scrollPane;
}
项目:NoMoreOversleeps    文件:JavaFxHelper.java   
public static ScrollPane createScrollPane(double width, double height, String style, String styleClass, ScrollBarPolicy hPolicy, ScrollBarPolicy vPolicy, boolean pannable)
{
    ScrollPane pane = new ScrollPane();
    pane.setMinWidth(width);
    pane.setMaxWidth(width);
    pane.setMinHeight(height);
    pane.setMaxHeight(height);
    pane.setStyle(style);
    pane.getStyleClass().add(styleClass);
    pane.hbarPolicyProperty().set(hPolicy);
    pane.vbarPolicyProperty().set(vPolicy);
    pane.pannableProperty().set(pannable);
    return pane;
}
项目:WebPLP    文件:QuickViewPanel.java   
public QuickViewPanel(String isaName, List<QuickViewSection> sections)
{
    VBox vbox = new VBox();

    for (QuickViewSection section : sections)
    {
        Node sectionView = createSectionView(section);
        vbox.getChildren().add(sectionView);
    }

    ScrollPane center = new ScrollPane(vbox);
    center.setFitToWidth(true);
    center.setHbarPolicy(ScrollBarPolicy.NEVER);
    this.setCenter(center);
}
项目:farmsim    文件:TaskViewer.java   
public TaskViewer() {
    super(370, 235, 0, 0, "Task Manager");
    getStylesheets().add("css/taskViewer.css");
    this.getStyleClass().add("task-viewer");

    macrosDropdown = macroDropdownSetup();
    ScrollPane scroll = new ScrollPane();
    scroll.getStyleClass().add("scroll");
    scroll.setPrefSize(235, 300);
    scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS);

    taskViewerBox = new VBox(8);
    taskViewerBox.getStyleClass().add("task-viewer-inner");
    taskPanes = new ArrayList<TaskPane>();
    scroll.setContent(taskViewerBox);

    BorderPane taskViewerRootPane = new BorderPane();
    taskViewerRootPane.setCenter(scroll);

    HBox buttonSection = new HBox(5);
    buttonSection.setPrefSize(235, 30);
    buttonSection.getStyleClass().add("button-section");
    buttonSection.setPadding(new Insets(2));
    buttonSection.setAlignment(Pos.CENTER);
    addDeleteButton(buttonSection);
    addMoveButtons(buttonSection);
    addMacroButtons(buttonSection);

    Platform.runLater(() -> {
            Tooltip.install(macrosDropdown, new Tooltip("Macros"));
        });
    buttonSection.getChildren().add(macrosDropdown);
    taskViewerRootPane.setBottom(buttonSection);

    this.setContent(taskViewerRootPane);
}
项目:openjfx-8u-dev-tests    文件:ScrollPaneTest.java   
@ScreenshotCheck
@Test(timeout = 300000)//RT-17350
public void immediateHVBarPoliticApplyingTest() throws Throwable {
    setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, ScrollPane.ScrollBarPolicy.ALWAYS, Properties.hbarPolicy);
    setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, ScrollPane.ScrollBarPolicy.NEVER, Properties.hbarPolicy);

    //There must not be horizontal bar.
    checkScreenshot("ScrollPane_PoliticApplyingTest", testedControl);
    throwScreenshotError();
}
项目:JttDesktop    文件:ScrollableConfigurationItem.java   
/**
 * Method to wrap the content in a {@link ScrollPane}.
 * @param css the {@link DynamicCssOnlyProperties} for configuring the {@link ScrollPane}.
 * @param content the {@link Node} to wrap.
 * @return the {@link ScrollPane} wrapping.
 */
private static Node wrapInScroller( DynamicCssOnlyProperties css, Node content ){
   ScrollPane scroller = new ScrollPane( content );
   scroller.setHbarPolicy( ScrollBarPolicy.NEVER );
   scroller.setFitToWidth( true );
   css.removeScrollPaneBorder( scroller );
   return scroller;
}
项目:JttDesktop    文件:ScrollableConfigurationItemTest.java   
@Test public void shouldWrapInScroller(){
   systemUnderTest = new TestableScrollableItem( NAME, contentTitle, controller, content );
   ArgumentCaptor< Node > contentCaptor = ArgumentCaptor.forClass( Node.class );
   systemUnderTest.handleBeingSelected();
   verify( controller ).displayContent( Mockito.eq( contentTitle ), contentCaptor.capture() );

   assertThat( contentCaptor.getValue(), is( instanceOf( ScrollPane.class ) ) );
   ScrollPane scroller = ( ScrollPane ) contentCaptor.getValue();
   assertThat( scroller.getContent(), is( content ) );
   assertThat( scroller.getHbarPolicy(), is( ScrollBarPolicy.NEVER ) );
   assertThat( scroller.isFitToWidth(), is( true ) );
}
项目:FXGL    文件:FXGLMenu.java   
/**
 * @return menu content containing input mappings (action -> key/mouse)
 */
protected final MenuContent createContentControls() {
    log.debug("createContentControls()");

    GridPane grid = new GridPane();
    grid.setAlignment(Pos.CENTER);
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(10, 10, 10, 10));
    grid.getColumnConstraints().add(new ColumnConstraints(100, 100, 100, Priority.ALWAYS, HPos.LEFT, true));
    grid.getRowConstraints().add(new RowConstraints(40, 40, 40, Priority.ALWAYS, VPos.CENTER, true));

    // row 0
    grid.setUserData(0);

    app.getInput().getBindings().forEach((action, trigger) -> addNewInputBinding(action, trigger, grid));

    // TODO: use specific style class, i.e. FXGLScrollPane
    ScrollPane scroll = new ScrollPane(grid);
    scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scroll.setMaxHeight(app.getHeight() / 2.5);

    HBox hbox = new HBox(scroll);
    hbox.setAlignment(Pos.CENTER);

    return new MenuContent(hbox);
}
项目:blackmarket    文件:AutoCompleteTextField.java   
/**
     * Populate the entry set with the given search results. Display is limited
     * to 10 entries, for performance.
     * 
     * @param searchResult
     *            The set of matching strings.
     */
    private void populatePopup(List<String> searchResult) {
        System.out.println("populatePopup: " + searchResult);
//      List<CustomMenuItem> menuItems = new LinkedList<>();
        List<Hyperlink> menuItems = new LinkedList<>();
        // If you'd like more entries, modify this line.
//      int maxEntries = 100;
//      int count = Math.min(searchResult.size(), maxEntries);
        int count = searchResult.size();
        for (int i = 0; i < count; i++) {
            final String result = searchResult.get(i);
            Hyperlink entryLabel = new Hyperlink(result);
            entryLabel.setFocusTraversable(false);
//          entryLabel.setMaxWidth(Double.MAX_VALUE);
//          CustomMenuItem item = new CustomMenuItem(entryLabel, true);
            entryLabel.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent actionEvent) {
                    setText(result);
                    entriesPopup.hide();
                }
            });
            menuItems.add(entryLabel);
        }
        VBox vBox = new VBox();
//      vBox.setMaxWidth(Double.MAX_VALUE);
        vBox.getChildren().addAll(menuItems);
        ScrollPane scrollPane = new ScrollPane(vBox);
        scrollPane.setMaxHeight(500);//Adjust max height of the popup here
        scrollPane.setMaxWidth(Double.MAX_VALUE);//Adjust max width of the popup here
        scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
        // Focusing on this node makes it blurry for some reason
        // http://www.jensd.de/wordpress/?p=1245
        scrollPane.setStyle("-fx-background-color: -fx-outer-border, -fx-inner-border, -fx-body-color; -fx-background-insets: 0, 1, 2; -fx-background-radius: 5, 4, 3;");
//      entriesPopup.getItems().clear();
//      entriesPopup.getItems().addAll(menuItems);
        entriesPopup.getContent().clear();
        entriesPopup.getContent().add(scrollPane);
    }
项目:htm.java-examples    文件:BreakingNewsDemo.java   
public void configureView() {
    view = new BreakingNewsDemoView();
    view.autoModeProperty().addListener((v, o, n) -> { this.mode = n; });
    this.mode = view.autoModeProperty().get();
    view.startActionProperty().addListener((v, o, n) -> {
        if(n) {
            if(mode == Mode.AUTO) cursor++;
            start();
        }else{
            stop();
        }
    });
    view.runOneProperty().addListener((v, o, n) -> {
        this.cursor += n.intValue();
        runOne(jsonList.get(cursor), cursor);
    });
    view.flipStateProperty().addListener((v, o, n) -> {
        view.flipPaneProperty().get().flip();
    });

    view.setPrefSize(1370, 1160);
    view.setMinSize(1370, 1160);

    mainViewScroll  = new ScrollPane();
    mainViewScroll.setViewportBounds(new BoundingBox(0, 0, 1370, 1160));

    mainViewScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    mainViewScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    mainViewScroll.setContent(view);
    mainViewScroll.viewportBoundsProperty().addListener((v, o, n) -> {
        view.setPrefSize(Math.max(1370, n.getMaxX()), Math.max(1160, n.getMaxY()));//1370, 1160);
    });

    createDataStream();
    createAlgorithm();
}
项目:org.csstudio.display.builder    文件:EmbeddedDisplayRepresentation.java   
@Override
public void updateChanges()
{
    super.updateChanges();
    if (dirty_sizes.checkAndClear())
    {
        final Integer width = model_widget.propWidth().getValue();
        final Integer height = model_widget.propHeight().getValue();
        scroll.setPrefSize(width, height);

        final Resize resize = model_widget.propResize().getValue();
        if (resize == Resize.None)
        {
            zoom.setX(1.0);
            zoom.setY(1.0);
            scroll.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
            scroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
        }
        else if (resize == Resize.ResizeContent)
        {
            zoom.setX(zoom_factor);
            zoom.setY(zoom_factor);
            scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
            scroll.setVbarPolicy(ScrollBarPolicy.NEVER);
        }
        else // SizeToContent
        {
            zoom.setX(1.0);
            zoom.setY(1.0);
            scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
            scroll.setVbarPolicy(ScrollBarPolicy.NEVER);
        }
    }
}
项目:jfx-torrent    文件:DirectoriesContentPane.java   
private Node buildDirectoriesOptionsView() {        
    //Downloaded files directory                
    final VBox downloadDirectoryPane = buildDownloadDirectoryPane();        
    VBox.setMargin(moveFromDefaultCheck, new Insets(0, 0, 0, 25));

    //Torrent location directory
    final VBox torrentDirectoryPane = buildTorrentDirectoryPane();

    //Key store directory               
    final HBox keyStorePane = new HBox();
    keyStorePane.getStyleClass().add(GuiProperties.HORIZONTAL_LAYOUT_SPACING);
    keyStorePane.getChildren().addAll(keyStoreLocationField, browseKeyStoreButton);

    HBox.setHgrow(keyStoreLocationField, Priority.ALWAYS);

    final VBox content = new VBox();
    content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);     
    content.getChildren().addAll(
            new TitledBorderPane("Location of Downloaded Files", downloadDirectoryPane, BorderStyle.COMPACT,
                    TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE),
            new TitledBorderPane("Location of .torrents", torrentDirectoryPane, BorderStyle.COMPACT,
                    TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE),
            new TitledBorderPane("Location of Certificate Key Store", keyStorePane, BorderStyle.COMPACT,
                    TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE));

    final ScrollPane contentScroll = new ScrollPane(content);
    contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    contentScroll.setFitToWidth(true);

    return contentScroll;
}
项目:jfx-torrent    文件:QueueingContentPane.java   
@Override
protected Node build() {
    final VBox content = new VBox();
    content.getStyleClass().add(GuiProperties.VERTICAL_LAYOUT_SPACING);
    content.getChildren().addAll(
            new TitledBorderPane("Queue Settings", buildQueueSettingsPane(), BorderStyle.COMPACT,
                    TitledBorderPane.SECONDARY_BORDER_COLOR_STYLE));

    final ScrollPane contentScroll = new ScrollPane(content);
    contentScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    contentScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    contentScroll.setFitToWidth(true);
    return contentScroll;
}
项目:OCRaptor    文件:MessageDialog.java   
/**
 *
 *
 */
public void wrapText() {
  messageText.setMaxWidth(pane.getWidth() - 10);
  this.scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
  pane.widthProperty().addListener(new ChangeListener() {
    @Override
    public void changed(ObservableValue observable, Object oldvalue, Object newValue) {
      messageText.setMaxWidth((double) newValue - 10);
    }
  });
}
项目:HubTurbo    文件:UI.java   
private Parent createRootNode() {

        VBox top = new VBox();

        panelsScrollPane = new ScrollPane(panels);
        panelsScrollPane.getStyleClass().add("transparent-bg");
        panelsScrollPane.setFitToHeight(true);
        panelsScrollPane.setVbarPolicy(ScrollBarPolicy.NEVER);
        HBox.setHgrow(panelsScrollPane, Priority.ALWAYS);
        menuBar = new MenuControl(this, panels, panelsScrollPane, prefs, mainStage);
        menuBar.setUseSystemMenuBar(true);

        HBox detailsBar = new HBox();
        detailsBar.setAlignment(Pos.CENTER_LEFT);
        apiBox.getStyleClass().add("text-grey");
        apiBox.setTooltip(new Tooltip("Remaining calls / Minutes to next refresh"));
        detailsBar.getChildren().add(apiBox);

        top.getChildren().addAll(menuBar, detailsBar);

        BorderPane root = new BorderPane();
        root.setTop(top);
        root.setCenter(panelsScrollPane);
        root.setBottom((HTStatusBar) status);

        notificationPane = new NotificationPane(root);

        return notificationPane;
    }
项目:Wallet    文件:StartupController.java   
@FXML protected void btnRestoreSSS(ActionEvent event){
 restoreSSSScrllContent = new ScrollPaneContentManager()
    .setSpacingBetweenItems(20)
    .setScrollStyle(scrlSSSRestoreShares.getStyle());
 scrlSSSRestoreShares.setContent(restoreSSSScrllContent);
 scrlSSSRestoreShares.setHbarPolicy(ScrollBarPolicy.NEVER);

 MainRestorePane.setVisible(false);
 RestoreFromSSSPane.setVisible(true);
 btnRestoreFromSeedFromSSSContinue.setDisable(true);
}
项目:Wallet    文件:TestSSSWindow.java   
public void initialize() {
    setPiecesCells(shares);

    contentManagerResults = new ScrollPaneContentManager();
    scrlResults.setContent(contentManagerResults);
    scrlResults.setHbarPolicy(ScrollBarPolicy.NEVER);
}
项目:Wallet    文件:TestSSSWindow.java   
@SuppressWarnings("restriction")
private void setPiecesCells(List<Share> shares){
    contentManager = new ScrollPaneContentManager();
    scrlPieces.setContent(contentManager);
    scrlPieces.setHbarPolicy(ScrollBarPolicy.NEVER);
    for(Share s: shares){
        TestSSSCell c = new TestSSSCell();
        c.setPiece(s.toString());
        contentManager.addItem(c);
    }
}
项目:javafx-demos    文件:DynamicTextAreaDemo.java   
@Override
public void start(Stage stage) throws Exception {
    this.stage = stage;
    configureScene();
    configureStage();
    // Logic starts
    VBox vb = new VBox();
    vb.setSpacing(10);

    final VBox layout = VBoxBuilder.create().build();
    layout.getChildren().add(new DynamicTextArea());

    Button btn = ButtonBuilder.create().text("Add").onAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent arg0) {
            layout.getChildren().add(new DynamicTextArea());
        }
    }).build();

    final GridPane gridPane = GridPaneBuilder.create()
            .styleClass("contact-details-gridpane")
            // [ARE] Further modification for CAEMR-2098. Setting minimum width to show labels even if application width is changed.
            .columnConstraints(ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).minWidth(80).build(),
                    ColumnConstraintsBuilder.create().hgrow(Priority.ALWAYS).build(),
                    ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).minWidth(100).build()).build();

    gridPane.addRow(0, new Label("hi"), layout, btn);

    root.getChildren().add(ScrollPaneBuilder.create().styleClass("contact-details-pane").hbarPolicy(ScrollBarPolicy.NEVER)
            .fitToWidth(true).content(gridPane).build());
}
项目:pdfsam    文件:DashboardItemPane.java   
DashboardItemPane(DashboardItem item) {
    requireNotNull(item, "Dashboard item cannot be null");
    this.item = item;
    this.item.pane().getStyleClass().addAll(Style.DEAULT_CONTAINER.css());
    this.item.pane().getStyleClass().addAll(Style.CONTAINER.css());
    ScrollPane scroll = new ScrollPane(this.item.pane());
    scroll.getStyleClass().addAll(Style.DEAULT_CONTAINER.css());
    scroll.setFitToWidth(true);
    scroll.setHbarPolicy(ScrollBarPolicy.NEVER);
    scroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
    setCenter(scroll);
    eventStudio().add(SetActiveModuleRequest.class, enableFooterListener, Integer.MAX_VALUE,
            ReferenceStrength.STRONG);
}
项目:LJGM    文件:LJGM.java   
@Override
public void start(Stage primaryStage) throws Exception {
    if (false) {
        new GalleryCreator(galleryManager.getGalleries().get(0)).show();
        return;
    }
    logger.info("Setting up main stage...");
    this.ljgmStage = primaryStage;
    ljgmStage.setTitle(LJGMUtils.generateStageTitle("Starting..."));
    ljgmStage.getIcons().add(new Image("file:res/favicon.png"));

    // Create the scroll pane for the viewing area
    ScrollPane sp = ScrollPaneBuilder.create().content(view).hbarPolicy(ScrollBarPolicy.AS_NEEDED)
            .vbarPolicy(ScrollBarPolicy.AS_NEEDED).build();

    // Create the main border pane to host all the components
    // Center: viewing area, left: sidebar, bottom: status bar, top: menu
    // items
    // @formatter:off
    BorderPane bp = BorderPaneBuilder.create().center(sp).left(gallerySidebar).bottom(statusBar).top(createMenuBar()).build();
    // @formatter:on
    ljgmStage.setScene(new Scene(bp, 1000, 500));

    // Select the first gallery
    if (gallerySidebar.getListView().getItems().size() != 0) {
        view.setFocus(galleryManager.getGallery(gallerySidebar.removeImageCount(gallerySidebar.getListView().getItems()
                .get(0))));
        gallerySidebar.getListView().getSelectionModel().select(0);
    } else {
        view.setFocus(null);
    }

    logger.info("Main stage set up.");
    ljgmStage.show();
    logger.info("Done!");
}
项目:Lernkartei_2017    文件:TroubleShootView.java   
@Override
public Parent constructContainer() {

    webContent.loadContent("<html><body><b>Missing a manual</b></body></html>");
    try {
        // To avoid strange chars like "", the html -Tag is added here separately:
        webContent.loadContent("<html>"+Functions.fileToString(new File(
                               "src/views/txt/troubleshoot.htm"))+"</html>");
    } catch (Exception e) {
        e.printStackTrace();
    }
    double pageWidth = this.getFXController().getMyFXStage().getOPTIMAL_WIDTH();
    double pageHeight = this.getFXController().getMyFXStage().getOPTIMAL_HEIGHT();
    debug.Debugger.out("ManualView sizes: w:"+pageWidth+" h:"+pageHeight);

    //webPage.setPrefHeight(pageHeight);
    webPage.setPrefWidth(pageWidth*.93);
    //webContent.setJavaScriptEnabled(true);
    webPage.applyCss();

    Label labelTitel = new Label("Fehlerbehandlung");
    labelTitel.setId("anleitungstitel");

    BackButton backBtn = new BackButton(this.getFXController());

    BorderPane headLayout = new BorderPane(labelTitel);
    headLayout.setPadding(new Insets(20));

    ScrollPane scroller = new ScrollPane();
    scroller.setMaxWidth(pageWidth);

    scroller.setContent(webPage);
    scroller.setHbarPolicy(ScrollBarPolicy.NEVER);
    scroller.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    scroller.setId("anleitung");

    HBox controlLayout = new HBox(20);
    controlLayout.setAlignment(Pos.BOTTOM_CENTER);
    controlLayout.getChildren().addAll(backBtn);
    controlLayout.setPadding(new Insets(10));

    BorderPane mainLayout = new BorderPane();
    mainLayout.setPadding(new Insets(15));
    mainLayout.setTop(headLayout);
    mainLayout.setCenter(scroller);
    mainLayout.setBottom(controlLayout);

    return mainLayout;
}