Shuffleboard Custom Tab Prefrences

I am trying to make a class to control our shuffleboard, I am wondering if there is a way to control a tabs grid size or grid gaps.

public class ShuffleDisplay {

    private ShuffleboardTab _shuffleDrivetrainTab = Shuffleboard.getTab("Drivetrain")

   

    private ShuffleboardTab _shuffleIntakeTab = Shuffleboard.getTab("Intake");

    private ShuffleboardTab _shuffleTurretTab = Shuffleboard.getTab("Turret");

    ShuffleboardLayout frontLeftWheel = _makeSwerveModuleList("Front Left Wheel", 2, 1);

       

    ShuffleboardLayout frontRightWheel = _makeSwerveModuleList("Front Right Wheel", 2, 2);

    ShuffleboardLayout backLeftWheel = _makeSwerveModuleList("Back Left Wheel", 2, 3);

   

    ShuffleboardLayout backRightWheel = _makeSwerveModuleList("Back Right Wheel", 2, 4);

    public ShuffleDisplay() {

        //Front left

        _addSwerveModuleWidget(frontLeftWheel, "Velocity", BuiltInWidgets.kDial, Map.of("Text", 0));

        _addSwerveModuleWidget(frontLeftWheel, "Wheel Position", BuiltInWidgets.kNumberBar, Map.of("max", 5, "min", -5));

        _addSwerveModuleWidget(frontLeftWheel, "Current", BuiltInWidgets.kTextView, Map.of("Text", 0));

        _addSwerveModuleWidget(frontLeftWheel, "Number Slider", BuiltInWidgets.kNumberSlider, Map.of());

        //Front right

        _addSwerveModuleWidget(frontRightWheel, "Velocity", BuiltInWidgets.kDial, Map.of("text", 0));

        _addSwerveModuleWidget(frontRightWheel, "Wheel Position", BuiltInWidgets.kNumberBar, Map.of("max", 5, "min", -5));

        _addSwerveModuleWidget(frontRightWheel, "Current", BuiltInWidgets.kTextView, Map.of("Text", 0));

        _addSwerveModuleWidget(frontRightWheel, "Number Slider", BuiltInWidgets.kNumberSlider, Map.of());

        //Back left

        _addSwerveModuleWidget(backLeftWheel, "Velocity", BuiltInWidgets.kDial, Map.of("text", 0));

        _addSwerveModuleWidget(backLeftWheel, "Wheel Position", BuiltInWidgets.kNumberBar, Map.of("max", 5, "min", -5));

        _addSwerveModuleWidget(backLeftWheel, "Current", BuiltInWidgets.kTextView, Map.of("Text", 0));

        _addSwerveModuleWidget(backLeftWheel, "Number Slider", BuiltInWidgets.kNumberSlider, Map.of());

        //Back right

        _addSwerveModuleWidget(backRightWheel, "Velocity", BuiltInWidgets.kDial, Map.of("text", 0));

        _addSwerveModuleWidget(backRightWheel, "Wheel Position", BuiltInWidgets.kNumberBar, Map.of("max", 5, "min", -5));

        _addSwerveModuleWidget(backRightWheel, "Current", BuiltInWidgets.kTextView, Map.of("Text", 0));

        _addSwerveModuleWidget(backRightWheel, "Number Slider", BuiltInWidgets.kNumberSlider, Map.of());

        _addDrivetrainWidget(_shuffleDrivetrainTab, "Gyro", BuiltInWidgets.kGyro, Map.of());

        _addDrivetrainWidget(_shuffleDrivetrainTab, "Speed", BuiltInWidgets.kNumberBar, Map.of("max", 15, "min", -15));

    }

    private ShuffleboardLayout _makeSwerveModuleList(String name, int x, int y) {

        return Shuffleboard.getTab("Drivetrain")

        .getLayout(name, BuiltInLayouts.kList)

        .withSize(x, y)

        .withPosition(columnIndex, rowIndex)

        .withProperties(Map.of("Label Position", "HIDDEN"));

   

    }

   

    private void _addSwerveModuleWidget(ShuffleboardLayout layout, String name, BuiltInWidgets widget, Map props) {

        layout.add(name, 0)

        .withWidget(widget)

        .withProperties(props);

    }

    private void _addDrivetrainWidget(ShuffleboardTab tab, String name, BuiltInWidgets widget, Map props) {

        tab.add(name, 0)

        .withWidget(widget)

        .withProperties(props);

    }

}
 "title": "Drivetrain",
      "autoPopulate": false,
      "autoPopulatePrefix": "",
      "widgetPane": {
        "gridSize": 64.0,
        "showGrid": false,
        "hgap": 12.0,
        "vgap": 12.0,
        "titleType": 1,

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.