Enum BuiltInWidgets

java.lang.Object
java.lang.Enum<BuiltInWidgets>
edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets
All Implemented Interfaces:
WidgetType, Serializable, Comparable<BuiltInWidgets>, java.lang.constant.Constable

public enum BuiltInWidgets
extends Enum<BuiltInWidgets>
implements WidgetType
The types of the widgets bundled with Shuffleboard.

For example, setting a number to be displayed with a slider:


 NetworkTableEntry example = Shuffleboard.getTab("My Tab")
   .add("My Number", 0)
   .withWidget(BuiltInWidgets.kNumberSlider)
   .withProperties(Map.of("min", 0, "max", 1))
   .getEntry();
 

Each value in this enum goes into detail on what data types that widget can support, as well as the custom properties that widget uses.

  • Enum Constant Details

    • kTextView

      public static final BuiltInWidgets kTextView
      Displays a value with a simple text field.
      Supported types:
      • String
      • Number
      • Boolean

      This widget has no custom properties.
    • kNumberSlider

      public static final BuiltInWidgets kNumberSlider
      Displays a number with a controllable slider.
      Supported types:
      • Number

      Custom properties:
      NameTypeDefault ValueNotes
      MinNumber-1.0The minimum value of the slider
      MaxNumber1.0The maximum value of the slider
      Block incrementNumber0.0625 How much to move the slider by with the arrow keys
    • kNumberBar

      public static final BuiltInWidgets kNumberBar
      Displays a number with a view-only bar.
      Supported types:
      • Number

      Custom properties:
      NameTypeDefault ValueNotes
      MinNumber-1.0The minimum value of the bar
      MaxNumber1.0The maximum value of the bar
      CenterNumber0The center ("zero") value of the bar
    • kDial

      public static final BuiltInWidgets kDial
      Displays a number with a view-only dial. Displayed values are rounded to the nearest integer.
      Supported types:
      • Number

      Custom properties:
      NameTypeDefault ValueNotes
      MinNumber0The minimum value of the dial
      MaxNumber100The maximum value of the dial
      Show valueBooleantrue Whether or not to show the value as text
    • kGraph

      public static final BuiltInWidgets kGraph
      Displays a number with a graph. NOTE: graphs can be taxing on the computer running the dashboard. Keep the number of visible data points to a minimum. Making the widget smaller also helps with performance, but may cause the graph to become difficult to read.
      Supported types:
      • Number
      • Number array

      Custom properties:
      NameTypeDefault ValueNotes
      Visible timeNumber30 How long, in seconds, should past data be visible for
    • kBooleanBox

      public static final BuiltInWidgets kBooleanBox
      Displays a boolean value as a large colored box.
      Supported types:
      • Boolean

      Custom properties:
      NameTypeDefault ValueNotes
      Color when trueColor"green" Can be specified as a string ("#00FF00") or a rgba integer (0x00FF0000)
      Color when falseColor"red" Can be specified as a string or a number
    • kToggleButton

      public static final BuiltInWidgets kToggleButton
      Displays a boolean with a large interactive toggle button.
      Supported types:
      • Boolean

      This widget has no custom properties.
    • kToggleSwitch

      public static final BuiltInWidgets kToggleSwitch
      Displays a boolean with a fixed-size toggle switch.
      Supported types:
      • Boolean

      This widget has no custom properties.
    • kVoltageView

      public static final BuiltInWidgets kVoltageView
      Displays an analog input or a raw number with a number bar.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      MinNumber0The minimum value of the bar
      MaxNumber5The maximum value of the bar
      CenterNumber0The center ("zero") value of the bar
      OrientationString"HORIZONTAL" The orientation of the bar. One of ["HORIZONTAL", "VERTICAL"]
      Number of tick marksNumber5 The number of discrete ticks on the bar
    • kPowerDistribution

      public static final BuiltInWidgets kPowerDistribution
      Displays a PowerDistribution.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      Show voltage and current valuesBooleantrue Whether or not to display the voltage and current draw
    • kComboBoxChooser

      public static final BuiltInWidgets kComboBoxChooser
      Displays a SendableChooser with a dropdown combo box with a list of options.
      Supported types:
      This widget has no custom properties.
    • kSplitButtonChooser

      public static final BuiltInWidgets kSplitButtonChooser
      Displays a SendableChooser with a toggle button for each available option.
      Supported types:
      This widget has no custom properties.
    • kEncoder

      public static final BuiltInWidgets kEncoder
      Displays an Encoder displaying its speed, total traveled distance, and its distance per tick.
      Supported types:
      This widget has no custom properties.
    • kMotorController

      public static final BuiltInWidgets kMotorController
      Displays a MotorController. The motor controller will be controllable from the dashboard when test mode is enabled, but will otherwise be view-only.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      OrientationString"HORIZONTAL" One of ["HORIZONTAL", "VERTICAL"]
    • kCommand

      public static final BuiltInWidgets kCommand
      Displays a command with a toggle button. Pressing the button will start the command, and the button will automatically release when the command completes.
      Supported types:
      This widget has no custom properties.
    • kPIDCommand

      public static final BuiltInWidgets kPIDCommand
      Displays a PID command with a checkbox and an editor for the PIDF constants. Selecting the checkbox will start the command, and the checkbox will automatically deselect when the command completes.
      Supported types:
      This widget has no custom properties.
    • kPIDController

      public static final BuiltInWidgets kPIDController
      Displays a PID controller with an editor for the PIDF constants and a toggle switch for enabling and disabling the controller.
      Supported types:
      This widget has no custom properties.
    • kAccelerometer

      public static final BuiltInWidgets kAccelerometer
      Displays an accelerometer with a number bar displaying the magnitude of the acceleration and text displaying the exact value.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      MinNumber-1 The minimum acceleration value to display
      MaxNumber1 The maximum acceleration value to display
      Show textBooleantrue Show or hide the acceleration values
      PrecisionNumber2 How many numbers to display after the decimal point
      Show tick marksBooleanfalse Show or hide the tick marks on the number bars
    • k3AxisAccelerometer

      public static final BuiltInWidgets k3AxisAccelerometer
      Displays a 3-axis accelerometer with a number bar for each axis' acceleration.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      RangeAccelerometer.Rangek16GThe accelerometer range
      Show valueBooleantrue Show or hide the acceleration values
      PrecisionNumber2 How many numbers to display after the decimal point
      Show tick marksBooleanfalse Show or hide the tick marks on the number bars
    • kGyro

      public static final BuiltInWidgets kGyro
      Displays a gyro with a dial from 0 to 360 degrees.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      Major tick spacingNumber45Degrees
      Starting angleNumber180 How far to rotate the entire dial, in degrees
      Show tick mark ringBooleantrue
    • kRelay

      public static final BuiltInWidgets kRelay
      Displays a relay with toggle buttons for each supported mode (off, on, forward, reverse).
      Supported types:
      This widget has no custom properties.
    • kDifferentialDrive

      public static final BuiltInWidgets kDifferentialDrive
      Displays a differential drive with a widget that displays the speed of each side of the drivebase and a vector for the direction and rotation of the drivebase. The widget will be controllable if the robot is in test mode.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      Number of wheelsNumber4Must be a positive even integer
      Wheel diameterNumber80Pixels
      Show velocity vectorsBooleantrue
    • kMecanumDrive

      public static final BuiltInWidgets kMecanumDrive
      Displays a mecanum drive with a widget that displays the speed of each wheel, and vectors for the direction and rotation of the drivebase. The widget will be controllable if the robot is in test mode.
      Supported types:
      Custom properties:
      NameTypeDefault ValueNotes
      Show velocity vectorsBooleantrue
    • kCameraStream

      public static final BuiltInWidgets kCameraStream
      Displays a camera stream.
      Supported types:
      • VideoSource (as long as it is streaming on an MJPEG server)

      Custom properties:
      NameTypeDefault ValueNotes
      Show crosshairBooleantrue Show or hide a crosshair on the image
      Crosshair colorColor"white" Can be a string or a rgba integer
      Show controlsBooleantrueShow or hide the stream controls
      RotationString"NONE" Rotates the displayed image. One of ["NONE", "QUARTER_CW", "QUARTER_CCW", "HALF"]
  • Method Details

    • values

      public static BuiltInWidgets[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static BuiltInWidgets valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getWidgetName

      Description copied from interface: WidgetType
      Gets the string type of the widget as defined by that widget in Shuffleboard.
      Specified by:
      getWidgetName in interface WidgetType
      Returns:
      The string type of the widget.