Package net.lenni0451.imnbt.ui.types
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 Summary
Modifier and TypeMethodDescriptiondefault voidhandleSearch(SearchProvider searchProvider, String path) Render the search overlay for the tag and handle the scrolling.voidrender(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, net.lenni0451.mcstructs.nbt.INbtTag tag) Render the tree node for the tag.default voidrenderBranch(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.default voidrenderIcon(ImNbtDrawer drawer, net.lenni0451.mcstructs.nbt.NbtType type) Render the icon for the tag.default voidrenderLeaf(String text, String suffix, String path, Runnable renderContextMenu, Function<String, Color> colorProvider, SearchProvider searchProvider) Render a leaf in the tree.
Used for primitive tags.voidrenderValueEditor(net.lenni0451.mcstructs.nbt.INbtTag tag) Render the value editor for the tag.
-
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 instancenameEditConsumer- The listener for when the name of a tag is editedtransformListener- The listener for when the tag is transformeddeleteListener- The listener for when the tag is deletedcolorProvider- The provider for the color of the tagsearchProvider- The provider for the searchopenContextMenu- Whether the context menu should be openedpath- The path of the tagname- The name of the tagtag- 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 displaysuffix- The suffix to displaypath- The path of the tagrenderContextMenu- The runnable to render the context menurenderChildren- The runnable to render the childrencolorProvider- The provider for the color of the tagsearchProvider- 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 displaysuffix- The suffix to displaypath- The path of the tagrenderContextMenu- The runnable to render the context menucolorProvider- The provider for the color of the tagsearchProvider- The provider for the search
-
handleSearch
Render the search overlay for the tag and handle the scrolling.- Parameters:
searchProvider- The provider for the searchpath- The path of the tag
-
renderIcon
Render the icon for the tag.- Parameters:
drawer- The drawer instancetype- The type of the icon
-