Java Code Examples for javafx.scene.control.Slider#setMin()

The following examples show how to use javafx.scene.control.Slider#setMin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DoubleSliderControl.java    From PreferencesFX with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initializeParts() {
  super.initializeParts();

  fieldLabel = new Label(field.labelProperty().getValue());

  valueLabel = new Label(String.valueOf(field.getValue().doubleValue()));

  slider = new Slider();
  slider.setMin(min);
  slider.setMax(max);
  slider.setShowTickLabels(false);
  slider.setShowTickMarks(false);
  slider.setValue(field.getValue());

  node = new HBox();
  node.getStyleClass().add("double-slider-control");
}
 
Example 2
Source File: IntegerSliderControl.java    From PreferencesFX with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initializeParts() {
  super.initializeParts();

  fieldLabel = new Label(field.labelProperty().getValue());

  valueLabel = new Label(String.valueOf(field.getValue().intValue()));

  slider = new Slider();
  slider.setMin(min);
  slider.setMax(max);
  slider.setShowTickLabels(false);
  slider.setShowTickMarks(false);
  slider.setValue(field.getValue());

  node = new HBox();
  node.getStyleClass().add("integer-slider-control");
}
 
Example 3
Source File: PercentSliderControl.java    From Quelea with GNU General Public License v3.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initializeParts() {
    super.initializeParts();

    fieldLabel = new Label(field.labelProperty().getValue());

    valueLabel = new Label((int) (100 * field.getValue()) + "%");

    slider = new Slider();
    slider.setMin(min);
    slider.setMax(max);
    slider.setShowTickLabels(false);
    slider.setShowTickMarks(false);
    slider.setValue(field.getValue());

    node = new HBox();
    node.getStyleClass().add("double-slider-control");
}
 
Example 4
Source File: SliderSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 5
Source File: TimeSlider.java    From regions with Apache License 2.0 5 votes vote down vote up
public TimeSlider() {
    getStyleClass().add("track");
    setFocusTraversable(true);
    setMinWidth(200);
    setMaxWidth(200);

    slider = new Slider();
    slider.setMin(0);

    progressBar = new ProgressBar(0);
}
 
Example 6
Source File: View.java    From SynchronizeFX with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * 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);
}
 
Example 7
Source File: SliderDemo.java    From phoebus with Eclipse Public License 1.0 4 votes vote down vote up
@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();
}
 
Example 8
Source File: DemoUtil.java    From RadialFx with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void addAngleControl(final String title, final DoubleProperty prop) {
final Slider slider = addSliderControl(title, prop);
slider.setMin(0);
slider.setMax(360);
   }
 
Example 9
Source File: DemoUtil.java    From RadialFx with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void addRadiusControl(final String title, final DoubleProperty prop) {
final Slider slider = addSliderControl(title, prop);
slider.setMin(0);
slider.setMax(500);
   }