本文整理匯總了Java中javafx.scene.control.Slider.setBlockIncrement方法的典型用法代碼示例。如果您正苦於以下問題:Java Slider.setBlockIncrement方法的具體用法?Java Slider.setBlockIncrement怎麽用?Java Slider.setBlockIncrement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.control.Slider
的用法示例。
在下文中一共展示了Slider.setBlockIncrement方法的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;
}
示例2: 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);
});
}
示例3: 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;
}
示例4: 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;
}
示例5: prepareSlider
import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void prepareSlider() {
slider = new Slider(0, nbIteration, 5);
slider.setMajorTickUnit(nbIteration);
slider.valueProperty().addListener((ov, oldVal, newVal) -> {
long lNewVal = newVal.longValue();
if(lNewVal != oldVal.longValue())
System.out.println(lNewVal);
});
slider.setBlockIncrement(1);
slider.setSnapToTicks(true);
if(nbIteration > Integer.MAX_VALUE) {
slider.setMinorTickCount(Integer.MAX_VALUE);
} else
slider.setMinorTickCount((int) nbIteration - 1);
// slider.setShowTickLabels(true);
// slider.setShowTickMarks(true);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例10: drawNode
import javafx.scene.control.Slider; //導入方法依賴的package包/類
@Override
public Node drawNode() {
Slider slider = createSlider(0, 100, vertical);
slider.setValue(50);
slider.setBlockIncrement(20);
double new_value = slider.getValue();
slider.adjustValue(position);
new_value = position;
if (Double.compare(slider.getValue(), new_value) != 0) {
reportGetterFailure("ScrollBar.adjustValue()");
}
return slider;
}
示例11: buildRoadPanel
import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildRoadPanel() {
roadAttributes = new VBox();
roadColorLabel = new Label("Color");
roadColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));
roadColorPicker = new ColorPicker();
roadColorPicker.setValue(Color.BLACK);
roadWidthLabel = new Label("Pixel Width : ");
roadWidthLabel.setAlignment(Pos.CENTER);
roadWidthLabel.setPrefSize(202, 17.0);
roadWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));
roadWidthSlider = new Slider();
roadWidthSlider.setBlockIncrement(3);
roadWidthSlider.setPrefSize(202, 5.0);
roadAttributes.getChildren().addAll(roadColorLabel, roadColorPicker, roadWidthLabel, roadWidthSlider);
road = new TitledPane("Road", roadAttributes);
road.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
road.prefWidthProperty().bind(widthProperty());
road.setExpanded(false);
roadWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
roadWidthLabel.setText("Pixel Width : " + t1.intValue());
});
}
示例12: buildBuildingPanel
import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildBuildingPanel() {
buildingAttributes = new VBox();
buildingColorLabel = new Label("Color");
buildingColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));
buildingColorPicker = new ColorPicker();
buildingColorPicker.setValue(Color.BLACK);
buildingWidthLabel = new Label("Pixel Width : ");
buildingWidthLabel.setAlignment(Pos.CENTER);
buildingWidthLabel.setPrefSize(202, 17.0);
buildingWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));
buildingWidthSlider = new Slider();
buildingWidthSlider.setBlockIncrement(3);
buildingWidthSlider.setPrefSize(202, 5.0);
buildingAttributes.getChildren().addAll(buildingColorLabel, buildingColorPicker, buildingWidthLabel, buildingWidthSlider);
building = new TitledPane("Buildings", buildingAttributes);
building.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
building.prefWidthProperty().bind(widthProperty());
building.setExpanded(false);
buildingWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
buildingWidthLabel.setText("Pixel Width : " + t1.intValue());
});
}
示例13: buildReliefPanel
import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildReliefPanel() {
reliefAttributes = new VBox();
reliefColorLabel = new Label("Color");
reliefColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));
reliefColorPicker = new ColorPicker();
reliefColorPicker.setValue(Color.BLACK);
reliefWidthLabel = new Label("Pixel Width : ");
reliefWidthLabel.setAlignment(Pos.CENTER);
reliefWidthLabel.setPrefSize(202, 17.0);
reliefWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));
reliefWidthSlider = new Slider();
reliefWidthSlider.setBlockIncrement(3);
reliefWidthSlider.setPrefSize(202, 5.0);
reliefAttributes.getChildren().addAll(reliefColorLabel, reliefColorPicker, reliefWidthLabel, reliefWidthSlider);
relief = new TitledPane("Reliefs", reliefAttributes);
relief.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
relief.prefWidthProperty().bind(widthProperty());
relief.setExpanded(false);
reliefWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
reliefWidthLabel.setText("Pixel Width : " + t1.intValue());
});
}
示例14: buildPOIPanel
import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildPOIPanel() {
poiAttributes = new VBox();
poiColorLabel = new Label("Color");
poiColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));
poiColorPicker = new ColorPicker();
poiColorPicker.setValue(Color.BLACK);
poiWidthLabel = new Label("Pixel Width : ");
poiWidthLabel.setAlignment(Pos.CENTER);
poiWidthLabel.setPrefSize(202, 17.0);
poiWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));
poiWidthSlider = new Slider();
poiWidthSlider.setBlockIncrement(3);
poiWidthSlider.setPrefSize(202, 5.0);
poiAttributes.getChildren().addAll(poiColorLabel, poiColorPicker, poiWidthLabel, poiWidthSlider);
poi = new TitledPane("POI", poiAttributes);
poi.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
poi.prefWidthProperty().bind(widthProperty());
poi.setExpanded(false);
poiWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
poiWidthLabel.setText("Pixel Width : " + t1.intValue());
});
}
示例15: buildROIPanel
import javafx.scene.control.Slider; //導入方法依賴的package包/類
private void buildROIPanel() {
roiAttributes = new VBox();
roiColorLabel = new Label("Color");
roiColorLabel.setTextFill(Paint.valueOf("#bfbfbf"));
roiColorPicker = new ColorPicker();
roiColorPicker.setValue(Color.BLACK);
roiWidthLabel = new Label("Pixel Width : ");
roiWidthLabel.setAlignment(Pos.CENTER);
roiWidthLabel.setPrefSize(202, 17.0);
roiWidthLabel.setTextFill(Paint.valueOf("#e8e5e5"));
roiWidthSlider = new Slider();
roiWidthSlider.setBlockIncrement(3);
roiWidthSlider.setPrefSize(202, 5.0);
roiAttributes.getChildren().addAll(roiColorLabel, roiColorPicker, roiWidthLabel, roiWidthSlider);
roi = new TitledPane("ROI", roiAttributes);
roi.setStyle("-fx-background-color: rgba(0,0,0,0.85);");
roi.prefWidthProperty().bind(widthProperty());
roi.setExpanded(false);
roiWidthSlider.valueProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> {
roiWidthLabel.setText("Pixel Width : " + t1.intValue());
});
}