Class TableComponent

  • All Implemented Interfaces:
    net.runelite.client.ui.overlay.components.LayoutableRenderableEntity, net.runelite.client.ui.overlay.RenderableEntity

    public class TableComponent
    extends java.lang.Object
    implements net.runelite.client.ui.overlay.components.LayoutableRenderableEntity
    The TableComponent class represents a customizable table component used for rendering tabular data in a graphical user interface. It provides options to define table properties, layout, column and row configurations, and controls for customization such as alignments, colors, and bounds. This class extends the capabilities of LayoutableRenderableEntity.

    The table supports the following features:

    • Dynamic addition and configuration of rows and columns.
    • Per-element, per-row, and per-column customization of alignment and colors.
    • Automatic adjustment of column widths based on content.
    • Rendering in a graphical context with appropriate spacing and alignment.
    • Helper utilities for string manipulation, text alignment, and graphical calculations.

    The class is designed to be highly configurable and ensures that content is visually aligned and spaced across the table's structure. Note: This code was taken from the following source here: - https://github.com/lucid-plugins/SideloadPlugins/blob/master/src/main/java/com/lucidplugins/lucidgauntlet/table/TableComponent.java - https://github.com/OreoCupcakes/kotori-plugins/blob/master/kotoriutils/src/main/java/com/theplug/kotori/kotoriutils/rlapi/table/TableComponent.java All credit to the authors of this code goes to them. The projects are both open source, and the Kraken API provides these components as a utility to be used within other plugins. Kraken API in no way claims to have written or owns this code.

    • Constructor Detail

      • TableComponent

        public TableComponent()
    • Method Detail

      • render

        public java.awt.Dimension render​(java.awt.Graphics2D graphics)
        Specified by:
        render in interface net.runelite.client.ui.overlay.RenderableEntity
      • isEmpty

        public boolean isEmpty()
      • setColumnAlignments

        public void setColumnAlignments​(@Nonnull
                                        TableAlignment... alignments)
      • addRow

        public void addRow​(@Nonnull
                           java.lang.String... cells)
      • addRows

        public void addRows​(@NonNull
                            @NonNull TableRow... rows)
      • setRows

        public void setRows​(@Nonnull
                            java.lang.String[]... elements)
      • setRows

        public void setRows​(@Nonnull
                            TableRow... elements)
      • addColumns

        public void addColumns​(@NonNull
                               @NonNull TableElement... columns)
      • setColumns

        public void setColumns​(@Nonnull
                               TableElement... elements)
      • setColumns

        public void setColumns​(@Nonnull
                               java.lang.String... columns)