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
public abstract class ShuffleboardComponent<C extends ShuffleboardComponent<C>> extends Object
A generic component in Shuffleboard.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedShuffleboardComponent(ShuffleboardContainer parent, String title)protectedShuffleboardComponent(ShuffleboardContainer parent, String title, String type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbuildInto(NetworkTable parentTable, NetworkTable metaTable)Builds the entries for this value.protected voidbuildMetadata(NetworkTable metaTable)ShuffleboardContainergetParent()StringgetTitle()StringgetType()protected voidsetType(String type)CwithPosition(int columnIndex, int rowIndex)Sets the position of this component in the tab.CwithProperties(Map<String,Object> properties)Sets custom properties for this component.CwithSize(int width, int height)Sets the size of this component in the tab.
-
-
-
Constructor Detail
-
ShuffleboardComponent
protected ShuffleboardComponent(ShuffleboardContainer parent, String title, String type)
-
ShuffleboardComponent
protected ShuffleboardComponent(ShuffleboardContainer parent, String title)
-
-
Method Detail
-
getParent
public final ShuffleboardContainer getParent()
-
setType
protected final void setType(String type)
-
getType
public final String getType()
-
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).- Parameters:
properties- the properties for this component- Returns:
- 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.
- Parameters:
columnIndex- the column in the tab to place this componentrowIndex- the row in the tab to place this component- Returns:
- 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.- Parameters:
width- how many columns wide the component should beheight- how many rows high the component should be- Returns:
- this component
-
buildMetadata
protected final void buildMetadata(NetworkTable metaTable)
-
buildInto
public abstract 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
-
-