Class ShuffleboardComponent<C extends ShuffleboardComponent<C>>
java.lang.Object
edu.wpi.first.wpilibj.shuffleboard.ShuffleboardComponent<C>
- Type Parameters:
C- the self type
- Direct Known Subclasses:
ComplexWidget,ShuffleboardLayout,SimpleWidget,SuppliedValueWidget
A generic component in Shuffleboard.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedShuffleboardComponent(ShuffleboardContainer parent, String title) Constructs a ShuffleboardComponent.protectedShuffleboardComponent(ShuffleboardContainer parent, String title, String type) Constructs a ShuffleboardComponent. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildInto(NetworkTable parentTable, NetworkTable metaTable) Builds the entries for this value.protected final voidbuildMetadata(NetworkTable metaTable) Builds NT metadata.final ShuffleboardContainerReturns the parent container.final StringgetTitle()final StringgetType()Returns the component type.protected final voidSets the component type.final CwithPosition(int columnIndex, int rowIndex) Sets the position of this component in the tab.final CwithProperties(Map<String, Object> properties) Sets custom properties for this component.final CwithSize(int width, int height) Sets the size of this component in the tab.
-
Constructor Details
-
ShuffleboardComponent
Constructs a ShuffleboardComponent.- Parameters:
parent- The parent container.title- The component title.type- The component type.
-
ShuffleboardComponent
Constructs a ShuffleboardComponent.- Parameters:
parent- The parent container.title- The component title.
-
-
Method Details
-
getParent
Returns the parent container.- Returns:
- The parent container.
-
setType
Sets the component type.- Parameters:
type- The component type.
-
getType
Returns the component type.- Returns:
- The component type.
-
getTitle
-
withProperties
Sets custom properties for this component. Property names are case- and whitespace-insensitive (capitalization and spaces do not matter).- Parameters:
properties- the properties for this component- Returns:
- this component
-
withPosition
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.
- Parameters:
columnIndex- the column in the tab to place this componentrowIndex- the row in the tab to place this component- Returns:
- this component
-
withSize
Sets the size of this component in the tab. This has no effect if this component is inside a layout.- Parameters:
width- how many columns wide the component should beheight- how many rows high the component should be- Returns:
- this component
-
buildMetadata
Builds NT metadata.- Parameters:
metaTable- The NT metadata table.
-
buildInto
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
-