Interface ShuffleboardContainer
-
- All Known Implementing Classes:
ShuffleboardLayout,ShuffleboardTab
public interface ShuffleboardContainerCommon interface for objects that can contain shuffleboard components.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ComplexWidgetadd(VideoSource video)Adds a widget to this container to display the given video stream.ComplexWidgetadd(Sendable sendable)Adds a widget to this container to display the given sendable.default ComplexWidgetadd(String title, VideoSource video)Adds a widget to this container to display the given video stream.ComplexWidgetadd(String title, Sendable sendable)Adds a widget to this container to display the given sendable.SimpleWidgetadd(String title, 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.SuppliedValueWidget<double[]>addDoubleArray(String title, Supplier<double[]> valueSupplier)Adds a widget to this container.SuppliedValueWidget<Double>addNumber(String title, DoubleSupplier valueSupplier)Adds a widget to this container.default SimpleWidgetaddPersistent(String title, Object defaultValue)Adds a widget to this container to display a simple piece of data.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.voidbuildInto(NetworkTable parentTable, NetworkTable metaTable)Builds the entries for this value.List<ShuffleboardComponent<?>>getComponents()Gets the components that are direct children of this container.ShuffleboardLayoutgetLayout(String title)Gets the already-defined layout in this container with the given title.default ShuffleboardLayoutgetLayout(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.ShuffleboardLayoutgetLayout(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.StringgetTitle()Gets the title of this Shuffleboard value.
-
-
-
Method Detail
-
getComponents
List<ShuffleboardComponent<?>> getComponents()
Gets the components that are direct children of this container.
-
getLayout
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. 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
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.- Parameters:
title- the title of the layoutlayoutType- the type of the layout, eg "List" or "Grid"- Returns:
- the layout
-
getLayout
ShuffleboardLayout getLayout(String title) throws NoSuchElementException
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
ComplexWidget add(String title, Sendable sendable) throws IllegalArgumentException
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
default ComplexWidget add(String title, VideoSource video) throws IllegalArgumentException
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
ComplexWidget add(Sendable sendable)
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
default ComplexWidget add(VideoSource video)
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
SimpleWidget add(String title, Object defaultValue) throws IllegalArgumentException
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)
-
addString
SuppliedValueWidget<String> addString(String title, Supplier<String> valueSupplier) throws IllegalArgumentException
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
SuppliedValueWidget<Double> addNumber(String title, DoubleSupplier valueSupplier) throws IllegalArgumentException
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
SuppliedValueWidget<Boolean> addBoolean(String title, BooleanSupplier valueSupplier) throws IllegalArgumentException
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
SuppliedValueWidget<String[]> addStringArray(String title, Supplier<String[]> valueSupplier) throws IllegalArgumentException
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
SuppliedValueWidget<double[]> addDoubleArray(String title, Supplier<double[]> valueSupplier) throws IllegalArgumentException
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
SuppliedValueWidget<boolean[]> addBooleanArray(String title, Supplier<boolean[]> valueSupplier) throws IllegalArgumentException
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, Supplier<byte[]> valueSupplier) throws IllegalArgumentException
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
-
addPersistent
default SimpleWidget addPersistent(String title, Object defaultValue) throws IllegalArgumentException
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)
-
getTitle
String getTitle()
Gets the title of this Shuffleboard value.
-
buildInto
void buildInto(NetworkTable parentTable, NetworkTable metaTable)
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
-
-