001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.wpilibj.shuffleboard;
006
007/**
008 * The types of layouts bundled with Shuffleboard.
009 *
010 * <pre>{@code
011 * ShuffleboardLayout myList = Shuffleboard.getTab("My Tab")
012 *   .getLayout(BuiltinLayouts.kList, "My List");
013 * }</pre>
014 */
015public enum BuiltInLayouts implements LayoutType {
016  /**
017   * Groups components in a vertical list. New widgets added to the layout will be placed at the
018   * bottom of the list. <br>
019   * Custom properties:
020   *
021   * <table>
022   * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
023   * <tr><td>Label position</td><td>String</td><td>"BOTTOM"</td>
024   * <td>The position of component labels inside the grid. One of
025   * {@code ["TOP", "LEFT", "BOTTOM", "RIGHT", "HIDDEN"}</td></tr>
026   * </table>
027   */
028  kList("List Layout"),
029
030  /**
031   * Groups components in an <i>n</i> x <i>m</i> grid. Grid layouts default to 3x3. <br>
032   * Custom properties:
033   *
034   * <table>
035   * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
036   * <tr><td>Number of columns</td><td>Number</td><td>3</td><td>Must be in the range [1,15]</td>
037   * </tr>
038   * <tr><td>Number of rows</td><td>Number</td><td>3</td><td>Must be in the range [1,15]</td></tr>
039   * <tr>
040   * <td>Label position</td>
041   * <td>String</td>
042   * <td>"BOTTOM"</td>
043   * <td>The position of component labels inside the grid.
044   * One of {@code ["TOP", "LEFT", "BOTTOM", "RIGHT", "HIDDEN"}</td>
045   * </tr>
046   * </table>
047   */
048  kGrid("Grid Layout"),
049  ;
050
051  private final String m_layoutName;
052
053  BuiltInLayouts(String layoutName) {
054    m_layoutName = layoutName;
055  }
056
057  @Override
058  public String getLayoutName() {
059    return m_layoutName;
060  }
061}