From 5f3590a36d7ee4de95ce2b240a9eecdc5476e626 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 18 Apr 2024 09:14:18 -0400 Subject: [PATCH 1/2] Expose vertical orientation option for numberSlider ala numberBar --- .../plugin/base/widget/NumberSliderWidget.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java index c1476ff2c..073c1aa9d 100644 --- a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java +++ b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java @@ -11,13 +11,16 @@ import java.util.List; import org.fxmisc.easybind.EasyBind; +import javafx.beans.property.Property; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleObjectProperty; import javafx.fxml.FXML; import javafx.scene.control.Slider; import javafx.scene.control.Label; import javafx.scene.layout.Pane; +import javafx.geometry.Orientation; @Description( name = "Number Slider", @@ -33,6 +36,8 @@ public class NumberSliderWidget extends SimpleAnnotatedWidget { private Label text; private final BooleanProperty showText = new SimpleBooleanProperty(this, "showText", true); + private final Property orientation = + new SimpleObjectProperty<>(this, "orientation", Orientation.HORIZONTAL); @FXML private void initialize() { @@ -43,6 +48,7 @@ private void initialize() { .divide(4)); slider.valueProperty().bindBidirectional(dataProperty()); text.textProperty().bind(EasyBind.map(dataOrDefault, n -> String.format("%.2f", n.doubleValue()))); + slider.orientationProperty().bind(orientation); } @Override @@ -59,7 +65,8 @@ public List getSettings() { Setting.of("Block increment", slider.blockIncrementProperty(), Double.class) ), Group.of("Visuals", - Setting.of("Display value", showText, Boolean.class) + Setting.of("Display value", showText, Boolean.class), + Setting.of("Orientation", orientation, Orientation.class) ) ); } From 4a1c70ae792dfb5fc8956ba9296a591d0ea4d6d9 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 18 Apr 2024 09:22:02 -0400 Subject: [PATCH 2/2] Update BasePlugin version to 1.3.7 --- .../java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java index 1ae219408..2d67b89e5 100644 --- a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java +++ b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java @@ -81,7 +81,7 @@ @Description( group = "edu.wpi.first.shuffleboard", name = "Base", - version = "1.3.6", + version = "1.3.7", summary = "Defines all the WPILib data types and stock widgets" ) @SuppressWarnings("PMD.CouplingBetweenObjects")