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


Java Slider.setShowTickLabels方法代碼示例

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


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

示例1: simulationSpeedSelection

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private Node simulationSpeedSelection( SimulatorSettingDetails settingDetails )
{
	VBox vBox = new VBox();

	Text simulationSpeedLabel = new Text("Simulation Speed (milliseconds / cycle)");
	simulationSpeedLabel.setId(UIConstants.TEXT_COLOR);

	//TODO take in settings for slider
	Slider simulationSpeedSlider = new Slider(0, 1000, 100);
	simulationSpeedSlider.setShowTickMarks(true);
	simulationSpeedSlider.setShowTickLabels(true);
	simulationSpeedSlider.setMajorTickUnit(100);
	simulationSpeedSlider.setBlockIncrement(100);

	simulationSpeedModel = simulationSpeedSlider.valueProperty();

	vBox.getChildren().addAll(simulationSpeedLabel, simulationSpeedSlider);

	return vBox;
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:21,代碼來源:SimulatorSettingsPanel.java

示例2: criaPainelInferior

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private HBox criaPainelInferior() {
	HBox hbBotoes = new HBox();
	final Button btnParar = new Button("Parar");
	final Button btnTocar = new Button("Tocar");
	final Button btnPausar = new Button("Pausar");
	final Button btnAjusta = new Button("Ajustar");
	sldTempo = new Slider(1, 10, 5);
	sldTempo.setShowTickLabels(true);
	sldTempo.setShowTickMarks(true);
	sldTempo.setMinorTickCount(1);
	sldTempo.setMajorTickUnit(1);
	hbBotoes.setAlignment(Pos.CENTER);
	hbBotoes.setSpacing(20);
	hbBotoes.getChildren().addAll(btnTocar, btnPausar, btnParar, btnAjusta, new Label("Duração (s):"), sldTempo);

	// setando as ações. Muito código gasto aqui! Poderíamos ter só uma ação
	// e setar a mesma em todos os botões ou usar os lambdas no Java 8
	btnParar.setOnAction(e -> transicaoAtual.stop());
	btnTocar.setOnAction(e -> acaoTocar(btnParar, btnTocar, btnPausar, btnAjusta));
	btnPausar.setOnAction(e -> transicaoAtual.pause());
	btnAjusta.setOnAction(e -> criaNoAlvo());
	return hbBotoes;
}
 
開發者ID:jesuino,項目名稱:livro-javafx-pratico,代碼行數:24,代碼來源:AprendendoTransicoes.java

示例3: setSliderRange

import javafx.scene.control.Slider; //導入方法依賴的package包/類
static void setSliderRange(final Slider slider, double position, double min, double max) {
		slider.setMin(min);
		slider.setMax(max);
//		int range = (int)(max - min + 0.5);
//		if (range > 200) {
//			slider.setMajorTickUnit(50);
//			slider.setMinorTickCount(10);
//		} else if (range >= 50) {
//			slider.setMajorTickUnit(10);
//			slider.setMinorTickCount(5);
//		} else if (range >= 10) {
//			slider.setMajorTickUnit(5);
//			slider.setMinorTickCount(1);
//		} else {
//			slider.setMajorTickUnit(1);
//			slider.setMinorTickCount(1);
//		}
		slider.setMajorTickUnit(1);
		slider.setSnapToTicks(true);
		slider.setShowTickMarks(false);
		slider.setShowTickLabels(false);
		slider.setValue(position);
		slider.setOpacity(0.25);
		slider.setBlockIncrement(1.0);
		
		slider.setOnMouseEntered(e -> {
			slider.setOpacity(1);			
		});
		slider.setOnMouseExited(e -> {
			slider.setOpacity(0.5);			
		});
	}
 
開發者ID:qupath,項目名稱:qupath,代碼行數:33,代碼來源:QuPathViewerPlus.java

示例4: 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

示例5: 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

示例6: SliderSample

import javafx.scene.control.Slider; //導入方法依賴的package包/類
public SliderSample() {
    VBox root = new VBox();
    Slider slider = new Slider();
    slider.setMin(0);
    slider.setMax(100);
    slider.setValue(40);
    slider.setShowTickLabels(true);
    slider.setShowTickMarks(true);
    slider.setMajorTickUnit(50);
    slider.setMinorTickCount(5);
    slider.setBlockIncrement(10);
    root.getChildren().addAll(slider, new Button("Click me!!"));
    getChildren().add(root);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:15,代碼來源:SliderSample.java

示例7: newSlider

import javafx.scene.control.Slider; //導入方法依賴的package包/類
public static Slider newSlider(final double min, final double max, final double value, final double blockIncrement, final double majorTickUnit, final boolean showTickLabels, final boolean showTickMarks, final boolean snapToTicks, ChangeListener<? super Number> changeListener) {
	final
	Slider slider = new Slider(min, max, value);
	slider.setBlockIncrement(blockIncrement);
	slider.setMajorTickUnit(majorTickUnit);
	slider.setShowTickLabels(showTickLabels);
	slider.setShowTickMarks(showTickMarks);
	slider.setSnapToTicks(snapToTicks);
	slider.valueProperty().addListener(changeListener);
	
	return slider;
}
 
開發者ID:macroing,項目名稱:Dayflower-Path-Tracer,代碼行數:13,代碼來源:JavaFX.java

示例8: createSlider

import javafx.scene.control.Slider; //導入方法依賴的package包/類
@Override
public Slider createSlider (double min, double max, double start, double increment) {
    Slider slider = new Slider();
    slider.setMin(min);
    slider.setMax(max);
    slider.setValue(start);
    slider.setBlockIncrement(increment);
    slider.setShowTickLabels(true);
    slider.setShowTickMarks(true);
    return slider;
}
 
開發者ID:tomrom95,項目名稱:GameAuthoringEnvironment,代碼行數:12,代碼來源:BasicUIFactory.java

示例9: createSlider

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private Slider createSlider(){
	Slider pSlider = new Slider();
	pSlider.setShowTickLabels(true);
	pSlider.setShowTickMarks(true);
	pSlider.setSnapToTicks(true);
	pSlider.setMin(0);
	pSlider.setMax(10.0);
	pSlider.setMajorTickUnit(10.0);
	pSlider.setMinorTickCount(99);
	pSlider.setBlockIncrement(0.1);
	
	return pSlider;
}
 
開發者ID:Flash3388,項目名稱:FlashLib,代碼行數:14,代碼來源:PIDTunerWindow.java

示例10: drawNode

import javafx.scene.control.Slider; //導入方法依賴的package包/類
@Override
public Node drawNode() {
    Slider slider = createSlider(0, 100, vertical);
    slider.setShowTickLabels(labels);
    slider.setShowTickMarks(marks);
    if (slider.isShowTickLabels() != labels) {
        reportGetterFailure("Slider.isShowTickLabels()");
    }
    if (slider.isShowTickMarks() != marks) {
        reportGetterFailure("Slider.isShowTickMarks()");
    }
    return slider;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:14,代碼來源:SliderApp.java

示例11: 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

示例12: start

import javafx.scene.control.Slider; //導入方法依賴的package包/類
@Override
public void start(Stage palco) throws Exception {
	VBox raiz = new VBox(10); // 1
	raiz.setAlignment(Pos.CENTER); // 2

	Label rotuloDemo = new Label("Sou um rótulo de texto!"); // 3
	rotuloDemo.setTooltip(new Tooltip("Esse é um rótulo para mostrar textos de forma simples")); // 4

	TextField campoTexto = new TextField("Digite algo"); // 5
	campoTexto.setTooltip(new Tooltip("Campo de texto para entrada de uma só linha "));

	TextArea areaTexto = new TextArea("Digite algo com várias linhas"); // 6
	areaTexto.setTooltip(new Tooltip("Campo de texto para entrada de múltiplas linhas"));

	Separator separadorHorizontal = new Separator(); // 7
	Separator separadorVertical = new Separator(Orientation.VERTICAL); // 8
	Slider deslizante = new Slider(); // 9
	deslizante.setShowTickLabels(true); // 10
	deslizante.setShowTickMarks(true); // 11
	deslizante.setTooltip(new Tooltip("O controle deslizante tem um valor numérico de acordo com sua posição"));

	raiz.getChildren().addAll(rotuloDemo, campoTexto, areaTexto, separadorVertical, separadorHorizontal,
			deslizante);

	Scene cena = new Scene(raiz, 300, 400);
	palco.setTitle("Controles Básicos I");
	palco.setScene(cena);
	palco.show();
}
 
開發者ID:jesuino,項目名稱:livro-javafx-pratico,代碼行數:30,代碼來源:ControlesSimples.java

示例13: View

import javafx.scene.control.Slider; //導入方法依賴的package包/類
/**
 * Create an instance of the View.
 */
public View() {
    setSpacing(20);
    setPadding(new Insets(20));

    final Text header = new Text("SynchronizeFX Example");
    header.setFill(Color.DIMGRAY);
    header.setStyle("-fx-font-size:24");

    slider = new Slider();
    slider.setMin(0);
    slider.setMax(100);
    slider.setShowTickLabels(true);
    slider.setShowTickMarks(true);
    slider.setMajorTickUnit(20);
    slider.setMinorTickCount(5);
    slider.setSnapToTicks(true);


    final Label valueLabel = new Label();
    valueLabel.setTextFill(Color.DIMGRAY);
    valueLabel.setStyle("-fx-font-size:15");

    valueLabel.textProperty()
            .bind(Bindings.format("Current Value: %1$.1f",
                    slider.valueProperty()));

    getChildren().addAll(header, slider, valueLabel);
}
 
開發者ID:saxsys,項目名稱:SynchronizeFX,代碼行數:32,代碼來源:View.java

示例14: makeSlider

import javafx.scene.control.Slider; //導入方法依賴的package包/類
public Slider makeSlider (double min, double max, boolean showTicks, boolean showLabels) {
    Slider slider = new Slider(min, max, min + (max - min) / 2);
    slider.setShowTickMarks(showTicks);
    slider.setShowTickLabels(showLabels);
    return slider;
}
 
開發者ID:tomrom95,項目名稱:GameAuthoringEnvironment,代碼行數:7,代碼來源:BasicUIFactory.java

示例15: mainScreen

import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void mainScreen(final Stage primaryStage) {
    GridPane grid = new GridPane();
    grid.setAlignment(Pos.CENTER);
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(25, 25, 25, 25));

    Text scenetitle = new Text("Game Of Life");
    scenetitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
    grid.add(scenetitle, 0, 0);

    Label heightLabel = new Label("Height:");
    grid.add(heightLabel, 0, 2);

    final TextField heightField = new TextField();
    heightField.setText(String.valueOf(fieldHeight));
    grid.add(heightField, 1, 2);

    Label widthLabel = new Label("Width:");
    grid.add(widthLabel, 0, 3);

    final TextField widthField = new TextField();
    widthField.setText(String.valueOf(fieldWidth));
    grid.add(widthField, 1, 3);

    Label cellDensityLabel = new Label("Cell density:");
    grid.add(cellDensityLabel, 0, 4);

    final Slider cellDensitySlider = new Slider();
    cellDensitySlider.setMin(0);
    cellDensitySlider.setMax(1);
    cellDensitySlider.setValue(cellDensity);
    cellDensitySlider.setShowTickLabels(true);
    cellDensitySlider.setShowTickMarks(true);
    cellDensitySlider.setMajorTickUnit(0.50);
    cellDensitySlider.setMinorTickCount(10);
    grid.add(cellDensitySlider, 1, 4);

    final Label errorLabel = new Label("");
    errorLabel.setMinSize(150, 10);
    grid.add(errorLabel, 0, 6);

    Button start = new Button("Start");
    start.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            try {
                fieldHeight = Integer.parseInt(heightField.getText());
                fieldWidth = Integer.parseInt(widthField.getText());
                cellDensity = cellDensitySlider.getValue();
                gameScreen(primaryStage);
            } catch (NumberFormatException e) {
                errorLabel.setText("Please enter an integer.");
            }
        }
    });
    grid.add(start,1,5);

    Scene scene = new Scene(grid);
    primaryStage.setScene(scene);
}
 
開發者ID:slemonide,項目名稱:GraphSpace,代碼行數:62,代碼來源:Main.java


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