當前位置: 首頁>>代碼示例>>Java>>正文


Java Slider.setOrientation方法代碼示例

本文整理匯總了Java中javafx.scene.control.Slider.setOrientation方法的典型用法代碼示例。如果您正苦於以下問題:Java Slider.setOrientation方法的具體用法?Java Slider.setOrientation怎麽用?Java Slider.setOrientation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.Slider的用法示例。


在下文中一共展示了Slider.setOrientation方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Son

import javafx.scene.control.Slider; //導入方法依賴的package包/類
public Son(Clavier clavier) {

        this.clavier = clavier;

        slider = new Slider(0, 127, 60);
        slider.setOrientation(Orientation.VERTICAL);
        slider.setTranslateY(35);
        slider.valueProperty().addListener(new ChangeListener() {
            @Override
            public void changed(ObservableValue o, Object oldVal, Object newVal) {
                clavier.requestFocus();
            }
        });

        ProgressIndicator indicateur = new ProgressIndicator(0.0);
        indicateur.progressProperty().bind(slider.valueProperty().divide(127.0));
        indicateur.setTranslateX(-15);

        this.getChildren().add(slider);
        this.getChildren().add(indicateur);
        this.setTranslateY(260);
        this.setTranslateX(60);

    }
 
開發者ID:schwabdidier,項目名稱:GazePlay,代碼行數:25,代碼來源:Son.java

示例2: createSlider

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private Slider createSlider(double chartUpperDefault, double chartUpperBound, double chartTickUnit) {
    Slider slider = new Slider();
    slider.setOrientation(Orientation.VERTICAL);
    slider.setMin(0);
    slider.setMax(chartUpperBound);
    slider.setValue(chartUpperDefault);
    slider.setShowTickLabels(true);
    slider.setShowTickMarks(true);
    slider.setMajorTickUnit(chartTickUnit);
    //slider.setMinorTickCount(0.01);
    slider.setBlockIncrement(0.01);
    
    // otherwise below, we also could delegate mediator, but in this case 
    // it is unnecessary because if the GUI that interacts with itself
    //slider.valueProperty().addListener(mediator);
    
    return slider;
}
 
開發者ID:paolopavan,項目名稱:circosFX,代碼行數:19,代碼來源:Trials.java

示例3: createSlider

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private Slider createSlider() {
    Slider slider = new Slider();
    slider.setOrientation(Orientation.VERTICAL);
    slider.setMin(1);
    slider.setMax(10);
    slider.setValue(1);
    slider.setShowTickLabels(true);
    slider.setShowTickMarks(true);
    slider.setMajorTickUnit(0.5);
    //slider.setMinorTickCount(0.01);
    slider.setBlockIncrement(0.01);
    
    
    slider.valueProperty().addListener(new ChangeListener<Number>() {
        public void changed(ObservableValue<? extends Number> ov,
            Number old_val, Number new_val) {
            magnificationProperty.set(new_val.doubleValue());
        }
    });
    // otherwise below, we also could delegate mediator, but in this case 
    // it is unnecessary because if the GUI that interacts with itself
    //slider.valueProperty().addListener(mediator);
    
    return slider;
}
 
開發者ID:paolopavan,項目名稱:circosFX,代碼行數:26,代碼來源:Circos.java

示例4: createSliderNoSizes

import javafx.scene.control.Slider; //導入方法依賴的package包/類
protected Slider createSliderNoSizes(double min, double max, boolean vertical) {
    Slider slider = new Slider();
    slider.setOrientation(vertical ? Orientation.VERTICAL : Orientation.HORIZONTAL);
    slider.setMin(min);
    slider.setMax(max);
    slider.setShowTickMarks(true);
    slider.setShowTickLabels(true);
    slider.setStyle("-fx-border-color: darkgray");
    return slider;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:11,代碼來源:SliderApp.java

示例5: start

import javafx.scene.control.Slider; //導入方法依賴的package包/類
@SuppressWarnings("nls")
@Override
public void start(final Stage stage)
{
    Slider slider = new Slider();
    slider.setOrientation(Orientation.VERTICAL);
    slider.setLayoutX(110);
    slider.setPrefHeight(200);
    slider.setValue(Double.NaN);

    Rectangle rect1 = createRect(10);
    rect1.setStyle("-fx-stroke-width: 1; -fx-stroke-dash-array: 5.0, 5.0; -fx-stroke: blue; -fx-fill: rgb(0, 0, 255, 0.05);");

    Rectangle rect2 = createRect(30);
    rect2.setStyle("-fx-stroke-width: 1; -fx-stroke: blue; -fx-fill: rgb(0, 0, 255, 0.05);");

    final Pane pane = new Pane(slider, rect1, rect2);
    pane.setPadding(new Insets(5));

    final Label label = new Label("Drag the bottom right corner of each rectangle across the slider. When the slider value is NaN,\n"
            + "the dashed rectangle freezes the program; the solid-bordered one disappears and reappears.\n"
            + "When it is finite, the rectangles behave as expected.");
    
    Button button = new Button("Toggle NaN/finite value.");
    button.setOnAction(e->
    {
        slider.setValue(Double.isFinite(slider.getValue()) ? Double.NaN : 50);
    });

    final VBox root = new VBox(pane, label, button);
    final Scene scene = new Scene(root, 800, 700);

    stage.setScene(scene);
    stage.setTitle("Slider Glitch Demo");

    stage.show();
}
 
開發者ID:kasemir,項目名稱:org.csstudio.display.builder,代碼行數:38,代碼來源:SliderGlitchDemo.java

示例6: start

import javafx.scene.control.Slider; //導入方法依賴的package包/類
@Override
public void start(final Stage stage)
{
    final Slider slider = new Slider();
    slider.setOrientation(Orientation.HORIZONTAL);
    slider.setShowTickLabels(true);
    slider.setShowTickMarks(true);
    slider.setMajorTickUnit(20.0);
    slider.setMin(-100.0);
    slider.setMax(100.0);
    slider.setValue(10.0);

    slider.valueProperty().addListener((observable, old, value)->
    {
        System.out.println("Value: " + value);
    });

    final SliderMarkers markers = new SliderMarkers(slider);
    markers.setAlarmMarkers(-100, -10, 70, 90);

    final String font = "-fx-font-size: 30px";
    slider.setStyle(font);
    markers.setStyle(font);

    final GridPane layout = new GridPane();
    layout.add(markers, 0, 0);
    layout.getChildren().add(slider);
    if (slider.getOrientation() == Orientation.VERTICAL)
    {
        GridPane.setConstraints(slider, 1, 0);
        GridPane.setVgrow(slider, Priority.ALWAYS);
    }
    else
    {
        GridPane.setConstraints(slider, 0, 1);
        GridPane.setHgrow(slider, Priority.ALWAYS);
    }
    final Scene scene = new Scene(layout, 800, 700);
    stage.setScene(scene);
    stage.setTitle("Slider Demo");

    stage.show();
    markers.update();
}
 
開發者ID:kasemir,項目名稱:org.csstudio.display.builder,代碼行數:45,代碼來源:SliderDemo.java


注:本文中的javafx.scene.control.Slider.setOrientation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。