Class ShuffleboardComponent<C extends ShuffleboardComponent<C>>

Type Parameters:
C - the self type
Direct Known Subclasses:
ComplexWidget, ShuffleboardLayout, SimpleWidget, SuppliedValueWidget

public abstract class ShuffleboardComponent<C extends ShuffleboardComponent<C>>
extends Object
A generic component in Shuffleboard.
  • Constructor Details

  • Method Details

    • getParent

      Returns the parent container.
      The parent container.
    • setType

      protected final void setType​(String type)
      Sets the component type.
      type - The component type.
    • getType

      public final String getType()
      Returns the component type.
      The component type.
    • getTitle

      public final String getTitle()
    • withProperties

      public final C withProperties​(Map<String,​Object> properties)
      Sets custom properties for this component. Property names are case- and whitespace-insensitive (capitalization and spaces do not matter).
      properties - the properties for this component
      this component
    • withPosition

      public final C withPosition​(int columnIndex, int rowIndex)
      Sets the position of this component in the tab. This has no effect if this component is inside a layout.

      If the position of a single component is set, it is recommended to set the positions of all components inside a tab to prevent Shuffleboard from automatically placing another component there before the one with the specific position is sent.

      columnIndex - the column in the tab to place this component
      rowIndex - the row in the tab to place this component
      this component
    • withSize

      public final C withSize​(int width, int height)
      Sets the size of this component in the tab. This has no effect if this component is inside a layout.
      width - how many columns wide the component should be
      height - how many rows high the component should be
      this component
    • buildMetadata

      protected final void buildMetadata​(NetworkTable metaTable)
      Builds NT metadata.
      metaTable - The NT metadata table.
    • buildInto

      public abstract void buildInto​(NetworkTable parentTable, NetworkTable metaTable)
      Builds the entries for this value.
      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