Interface TagRenderer

All Known Implementing Classes:
ByteArrayTagRenderer, ByteTagRenderer, CompoundTagRenderer, DoubleTagRenderer, FloatTagRenderer, IntArrayTagRenderer, IntTagRenderer, ListTagRenderer, LongArrayTagRenderer, LongTagRenderer, ShortTagRenderer, StringTagRenderer

public interface TagRenderer
The renderer for a tag type.
  • Method Details

    • render

      void render(ImNbtDrawer drawer, Consumer<String> nameEditConsumer, BiConsumer<String,net.lenni0451.mcstructs.nbt.INbtTag> transformListener, Runnable deleteListener, Function<String,Color> colorProvider, SearchProvider searchProvider, boolean openContextMenu, String path, String name, @Nonnull net.lenni0451.mcstructs.nbt.INbtTag tag)
      Render the tree node for the tag.
      Parameters:
      drawer - The drawer instance
      nameEditConsumer - The listener for when the name of a tag is edited
      transformListener - The listener for when the tag is transformed
      deleteListener - The listener for when the tag is deleted
      colorProvider - The provider for the color of the tag
      searchProvider - The provider for the search
      openContextMenu - Whether the context menu should be opened
      path - The path of the tag
      name - The name of the tag
      tag - The tag to render
    • renderValueEditor

      void renderValueEditor(net.lenni0451.mcstructs.nbt.INbtTag tag)
      Render the value editor for the tag.
      Parameters:
      tag - The tag to render
    • renderBranch

      default void renderBranch(String text, String suffix, String path, Runnable renderContextMenu, Runnable renderChildren, Function<String,Color> colorProvider, SearchProvider searchProvider)
      Render a branch in the tree.
      Used for array/list/compound tags.
      Parameters:
      text - The text to display
      suffix - The suffix to display
      path - The path of the tag
      renderContextMenu - The runnable to render the context menu
      renderChildren - The runnable to render the children
      colorProvider - The provider for the color of the tag
      searchProvider - The provider for the search
    • renderLeaf

      default void renderLeaf(String text, String suffix, String path, Runnable renderContextMenu, Function<String,Color> colorProvider, SearchProvider searchProvider)
      Render a leaf in the tree.
      Used for primitive tags.
      Parameters:
      text - The text to display
      suffix - The suffix to display
      path - The path of the tag
      renderContextMenu - The runnable to render the context menu
      colorProvider - The provider for the color of the tag
      searchProvider - The provider for the search
    • handleSearch

      default void handleSearch(SearchProvider searchProvider, String path)
      Render the search overlay for the tag and handle the scrolling.
      Parameters:
      searchProvider - The provider for the search
      path - The path of the tag
    • renderIcon

      default void renderIcon(ImNbtDrawer drawer, net.lenni0451.mcstructs.nbt.NbtType type)
      Render the icon for the tag.
      Parameters:
      drawer - The drawer instance
      type - The type of the icon