Interface ShuffleboardContainer

All Known Implementing Classes:
ShuffleboardLayout, ShuffleboardTab

public interface ShuffleboardContainer
Common interface for objects that can contain shuffleboard components.
  • 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, use getLayout(String, LayoutType) and the layouts in BuiltInLayouts.
      Parameters:
      title - the title of the layout
      type - 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 layout
      layoutType - 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

      ComplexWidget add​(String title, Sendable sendable)
      Adds a widget to this container to display the given sendable.
      Parameters:
      title - the title of the widget
      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
    • add

      default ComplexWidget add​(String title, VideoSource video)
      Adds a widget to this container to display the given video stream.
      Parameters:
      title - the title of the widget
      video - 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)
      Adds a widget to this container to display the given data.
      Parameters:
      title - the title of the widget
      defaultValue - 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

      default ComplexWidget addCamera​(String title, String cameraName, String... cameraUrls)
      Adds a widget to this container to display a video stream.
      Parameters:
      title - the title of the widget
      cameraName - the name of the streamed camera
      cameraUrls - 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 widget
      valueSupplier - 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 widget
      valueSupplier - 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 widget
      valueSupplier - 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 widget
      valueSupplier - 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)
      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 widget
      valueSupplier - 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)
      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 widget
      valueSupplier - 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)
      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 widget
      valueSupplier - 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)
      Adds a widget to this container to display a simple piece of data. Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than defaultValue.
      Parameters:
      title - the title of the widget
      defaultValue - 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

      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 call parentTable.getSubTable(getTitle()) to get the table to put data into. Values that only use a single entry should call parentTable.getEntry(getTitle()) to get that entry.
      metaTable - the table containing all the metadata for this value and its sub-values