Interface ShuffleboardContainer
- All Known Implementing Classes:
ShuffleboardLayout
,ShuffleboardTab
public interface ShuffleboardContainer
Common interface for objects that can contain shuffleboard components.
-
Method Summary
Modifier and Type Method Description default ComplexWidget
add(VideoSource video)
Adds a widget to this container to display the given video stream.ComplexWidget
add(Sendable sendable)
Adds a widget to this container to display the given sendable.default ComplexWidget
add(String title, VideoSource video)
Adds a widget to this container to display the given video stream.ComplexWidget
add(String title, Sendable sendable)
Adds a widget to this container to display the given sendable.SimpleWidget
add(String title, Object defaultValue)
Adds a widget to this container to display the given data.SimpleWidget
add(String title, String typeString, Object defaultValue)
Adds a widget to this container to display the given data.SuppliedValueWidget<Boolean>
addBoolean(String title, BooleanSupplier valueSupplier)
Adds a widget to this container.SuppliedValueWidget<boolean[]>
addBooleanArray(String title, Supplier<boolean[]> valueSupplier)
Adds a widget to this container.default ComplexWidget
addCamera(String title, String cameraName, String... cameraUrls)
Adds a widget to this container to display a video stream.SuppliedValueWidget<Double>
addDouble(String title, DoubleSupplier valueSupplier)
Adds a widget to this container.SuppliedValueWidget<double[]>
addDoubleArray(String title, Supplier<double[]> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<Float>
addFloat(String title, FloatSupplier valueSupplier)
Adds a widget to this container.SuppliedValueWidget<float[]>
addFloatArray(String title, Supplier<float[]> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<Long>
addInteger(String title, LongSupplier valueSupplier)
Adds a widget to this container.SuppliedValueWidget<long[]>
addIntegerArray(String title, Supplier<long[]> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<Double>
addNumber(String title, DoubleSupplier valueSupplier)
Adds a widget to this container.default SimpleWidget
addPersistent(String title, Object defaultValue)
Adds a widget to this container to display a simple piece of data.default SimpleWidget
addPersistent(String title, String typeString, Object defaultValue)
Adds a widget to this container to display a simple piece of data.SuppliedValueWidget<byte[]>
addRaw(String title, String typeString, Supplier<byte[]> valueSupplier)
Adds a widget to this container.default SuppliedValueWidget<byte[]>
addRaw(String title, Supplier<byte[]> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<String>
addString(String title, Supplier<String> valueSupplier)
Adds a widget to this container.SuppliedValueWidget<String[]>
addStringArray(String title, Supplier<String[]> valueSupplier)
Adds a widget to this container.void
buildInto(NetworkTable parentTable, NetworkTable metaTable)
Builds the entries for this value.List<ShuffleboardComponent<?>>
getComponents()
Gets the components that are direct children of this container.ShuffleboardLayout
getLayout(String title)
Gets the already-defined layout in this container with the given title.default ShuffleboardLayout
getLayout(String title, LayoutType layoutType)
Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called.ShuffleboardLayout
getLayout(String title, String type)
Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called.String
getTitle()
Gets the title of this Shuffleboard value.
-
Method Details
-
getComponents
Gets the components that are direct children of this container.- Returns:
- The components that are direct children of this container.
-
getLayout
Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called. Note: this method should only be used to use a layout type that is not already built into Shuffleboard. To use a layout built into Shuffleboard, usegetLayout(String, LayoutType)
and the layouts inBuiltInLayouts
.- Parameters:
title
- the title of the layouttype
- the type of the layout, eg "List Layout" or "Grid Layout"- Returns:
- the layout
- See Also:
getLayout(String, LayoutType)
-
getLayout
Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called.- Parameters:
title
- the title of the layoutlayoutType
- the type of the layout, eg "List" or "Grid"- Returns:
- the layout
-
getLayout
Gets the already-defined layout in this container with the given title.Shuffleboard.getTab("Example Tab") .getLayout("My Layout", BuiltInLayouts.kList); // Later... Shuffleboard.getTab("Example Tab") .getLayout("My Layout");
- Parameters:
title
- the title of the layout to get- Returns:
- the layout with the given title
- Throws:
NoSuchElementException
- if no layout has yet been defined with the given title
-
add
Adds a widget to this container to display the given sendable.- Parameters:
title
- the title of the widgetsendable
- the sendable to display- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
add
Adds a widget to this container to display the given video stream.- Parameters:
title
- the title of the widgetvideo
- the video stream to display- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
add
Adds a widget to this container to display the given sendable.- Parameters:
sendable
- the sendable to display- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title, or if the sendable's name has not been specified
-
add
Adds a widget to this container to display the given video stream.- Parameters:
video
- the video to display- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the same title as the video source
-
add
Adds a widget to this container to display the given data.- Parameters:
title
- the title of the widgetdefaultValue
- the default value of the widget- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title- See Also:
add(String title, Object defaultValue)
-
add
Adds a widget to this container to display the given data.- Parameters:
title
- the title of the widgettypeString
- the NT type stringdefaultValue
- the default value of the widget- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title- See Also:
add(String title, Object defaultValue)
-
addCamera
Adds a widget to this container to display a video stream.- Parameters:
title
- the title of the widgetcameraName
- the name of the streamed cameracameraUrls
- the URLs with which the dashboard can access the camera stream- Returns:
- a widget to display the camera stream
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addString
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addNumber
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addDouble
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addFloat
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addInteger
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addBoolean
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addStringArray
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addDoubleArray
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addFloatArray
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addIntegerArray
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addBooleanArray
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addRaw
Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgetvalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addRaw
SuppliedValueWidget<byte[]> addRaw(String title, String typeString, Supplier<byte[]> valueSupplier)Adds a widget to this container. The widget will display the data provided by the value supplier. Changes made on the dashboard will not propagate to the widget object, and will be overridden by values from the value supplier.- Parameters:
title
- the title of the widgettypeString
- the NT type string for the valuevalueSupplier
- the supplier for values- Returns:
- a widget to display data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title
-
addPersistent
Adds a widget to this container to display a simple piece of data. Unlikeadd(String, Object)
, the value in the widget will be saved on the robot and will be used when the robot program next starts rather thandefaultValue
.- Parameters:
title
- the title of the widgetdefaultValue
- the default value of the widget- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title- See Also:
add(String title, Object defaultValue)
-
addPersistent
Adds a widget to this container to display a simple piece of data. Unlikeadd(String, Object)
, the value in the widget will be saved on the robot and will be used when the robot program next starts rather thandefaultValue
.- Parameters:
title
- the title of the widgettypeString
- the NT type stringdefaultValue
- the default value of the widget- Returns:
- a widget to display the sendable data
- Throws:
IllegalArgumentException
- if a widget already exists in this container with the given title- See Also:
add(String title, Object defaultValue)
-
getTitle
String getTitle()Gets the title of this Shuffleboard value.- Returns:
- The title of this Shuffleboard value.
-
buildInto
Builds the entries for this value.- Parameters:
parentTable
- the table containing all the data for the parent. Values that require a complex entry or table structure should callparentTable.getSubTable(getTitle())
to get the table to put data into. Values that only use a single entry should callparentTable.getEntry(getTitle())
to get that entry.metaTable
- the table containing all the metadata for this value and its sub-values
-