Example usage for javafx.scene.control ScrollBar setOrientation

List of usage examples for javafx.scene.control ScrollBar setOrientation

Introduction

In this page you can find the example usage for javafx.scene.control ScrollBar setOrientation.

Prototype

public final void setOrientation(Orientation value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 500, 200);
    stage.setScene(scene);//from   w w  w.  ja va2s.c o  m

    ScrollBar s1 = new ScrollBar();
    s1.setOrientation(Orientation.VERTICAL);

    root.getChildren().add(s1);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 500, 200);
    stage.setScene(scene);//  ww  w  .  jav a 2 s.co  m

    ScrollBar s1 = new ScrollBar();
    s1.setMax(500);
    s1.setMin(0);
    s1.setValue(100);
    s1.setUnitIncrement(30);
    s1.setBlockIncrement(35);

    s1.setOrientation(Orientation.VERTICAL);

    root.getChildren().add(s1);
    stage.show();
}

From source file:org.mskcc.shenkers.view.IntervalViewNGTest.java

@Test
public void testGenericStackedIntervalView() throws InterruptedException {
    List<Pair<Integer, Integer>> intervals = Arrays.asList(new Pair(0, 1), new Pair(1, 2), new Pair(2, 3),
            new Pair(3, 4), new Pair(4, 5), new Pair(5, 6));
    List<Pane> nodes = intervals.stream().map(i -> new RectangleIntervalNode()).collect(Collectors.toList());
    GenericStackedIntervalView p = new GenericStackedIntervalView(0, 6);
    p.setData(intervals, nodes);/*from ww w .  j  a v a  2  s  .co m*/

    ScrollPane sp = new ScrollPane(p);
    ScrollBar sb = new ScrollBar();
    sb.maxProperty().bind(sp.vmaxProperty());
    sb.minProperty().bind(sp.vminProperty());
    sb.visibleAmountProperty().bind(sp.heightProperty().divide(p.prefHeightProperty()));
    sb.setOrientation(Orientation.VERTICAL);
    sp.vvalueProperty().bindBidirectional(sb.valueProperty());
    HiddenSidesPane hsp = new HiddenSidesPane();
    hsp.setContent(sp);
    hsp.setRight(sb);
    sp.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    sp.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    p.setOrientation(Orientation.VERTICAL);
    p.prefTileHeightProperty().bind(new SimpleDoubleProperty(40));
    //        p.minHeightProperty().bind(new SimpleDoubleProperty(20).multiply(Bindings.size(p.getChildren())));
    p.prefTileWidthProperty().bind(sp.widthProperty());
    p.prefHeightProperty()
            .bind(new SimpleDoubleProperty(50).multiply(Bindings.size(p.getChildren())).subtract(10));
    p.prefWidthProperty().bind(sp.widthProperty());
    sp.setPadding(Insets.EMPTY);
    p.setVgap(10);

    CountDownLatch l = new CountDownLatch(1);
    Platform.runLater(() -> {

        Stage stage = new Stage();
        stage.setOnHidden(e -> {
            l.countDown();
        });
        Scene scene = new Scene(hsp, 300, 300, Color.GRAY);
        stage.setTitle("GenericStackedPaneTest");
        stage.setScene(scene);
        stage.show();

    });
    l.await();
}

From source file:org.mskcc.shenkers.view.IntervalViewNGTest.java

public void testStackedIntervalView() throws InterruptedException {
    StackedIntervalView p = new StackedIntervalView(0, 6);
    p.setData(Arrays.asList(new Pair(0, 1), new Pair(1, 2), new Pair(2, 3), new Pair(3, 4), new Pair(4, 5),
            new Pair(5, 6)
    //, {8, 10}, {1, 2}, {3, 7},
    //            {9, 10}, {1, 2}, {3, 5}, {6, 7}, {8, 10}, {2, 5}, {8, 10}
    ));/*w w  w.j  a  va2 s  .  c  o m*/

    ScrollPane sp = new ScrollPane(p);
    ScrollBar sb = new ScrollBar();
    sb.maxProperty().bind(sp.vmaxProperty());
    sb.minProperty().bind(sp.vminProperty());
    sb.visibleAmountProperty().bind(sp.heightProperty().divide(p.prefHeightProperty()));
    sb.setOrientation(Orientation.VERTICAL);
    sp.vvalueProperty().bindBidirectional(sb.valueProperty());
    HiddenSidesPane hsp = new HiddenSidesPane();
    hsp.setContent(sp);
    hsp.setRight(sb);
    sp.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    sp.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    p.setOrientation(Orientation.VERTICAL);
    p.prefTileHeightProperty().bind(new SimpleDoubleProperty(40));
    //        p.minHeightProperty().bind(new SimpleDoubleProperty(20).multiply(Bindings.size(p.getChildren())));
    p.prefTileWidthProperty().bind(sp.widthProperty());
    p.prefHeightProperty()
            .bind(new SimpleDoubleProperty(50).multiply(Bindings.size(p.getChildren())).subtract(10));
    p.prefWidthProperty().bind(sp.widthProperty());
    sp.setPadding(Insets.EMPTY);
    p.setVgap(10);

    CountDownLatch l = new CountDownLatch(1);
    Platform.runLater(() -> {

        Stage stage = new Stage();
        stage.setOnHidden(e -> {
            l.countDown();
        });
        Scene scene = new Scene(hsp, 300, 300, Color.GRAY);
        stage.setTitle("StackedPaneTest");
        stage.setScene(scene);
        stage.show();

    });
    l.await();
}