Interface ShuffleboardContainer

  • All Known Implementing Classes:
    ShuffleboardLayout, ShuffleboardTab

    public interface ShuffleboardContainer
    Common interface for objects that can contain shuffleboard components.
    • 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, 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

        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 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)
                           throws IllegalArgumentException
        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
      • 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 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