Interface ShuffleboardContainer
-
- All Known Implementing Classes:
ShuffleboardLayout
,ShuffleboardTab
public interface ShuffleboardContainer
Common interface for objects that can contain shuffleboard components.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ComplexWidget
add(Sendable sendable)
Adds a widget to this container to display the given sendable.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.default SimpleWidget
addPersistent(String title, Object defaultValue)
Adds a widget to this container to display a simple piece of data.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 type, String title)
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 Detail
-
getComponents
List<ShuffleboardComponent<?>> getComponents()
Gets the components that are direct children of this container.
-
getLayout
ShuffleboardLayout getLayout(String type, String title)
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:
type
- the type of the layout, eg "List" or "Grid"title
- the title of the layout- Returns:
- the layout
-
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
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
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)
-
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
-
-