Interface ImNbtDrawer


public interface ImNbtDrawer
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the current popup window.
    void
    Gets called when the File -> Exit menu item is clicked.
    Get the instance of the about window.
    net.lenni0451.mcstructs.nbt.io.NamedTag
     
    default ImNbtConfig
     
    Get the instance of the diff window.
    int
    Get the texture id for the tag icons.
    int
    Get the amount of tags to display per page.
    This is required for large array/list/compound tags to prevent the UI from freezing.
    The default value is 500
    Get the instance of the main window.
    boolean
     
    void
    openPopup(Popup<?> popup)
    Open a popup window on the screen.
    This will close the current popup if there is one.
    void
    setClipboard(net.lenni0451.mcstructs.nbt.io.NamedTag tag)
    Set the clipboard to the given tag.
    default void
    Show a notification to the user.
    It is to be expected that the current popup will stay open when this method is called.
    void
    showNotification(NotificationLevel level, String title, String message, Runnable callback)
    Show a notification to the user.
    The callback should be called when the user has received (and optionally closed) the notification.
    It is to be expected that the current popup will stay open when this method is called.
    Show an open file dialog.
    Only one file should be selectable.
    Return null if the dialog was canceled.
    Show a save file dialog.
    Return null if the dialog was canceled.
    void
    Open a window to draw it on the screen.
    This will close the current window if there is one.
  • Method Details

    • getConfig

      default ImNbtConfig getConfig()
      Returns:
      The configuration for ImNbt
    • getLinesPerPage

      int getLinesPerPage()
      Get the amount of tags to display per page.
      This is required for large array/list/compound tags to prevent the UI from freezing.
      The default value is 500
      Returns:
      The lines per page
    • getIconsTexture

      int getIconsTexture()
      Get the texture id for the tag icons.
      Returns:
      The texture id
    • openPopup

      void openPopup(@Nonnull Popup<?> popup)
      Open a popup window on the screen.
      This will close the current popup if there is one.
      Parameters:
      popup - The popup to open
    • showNotification

      default void showNotification(NotificationLevel level, String title, String message)
      Show a notification to the user.
      It is to be expected that the current popup will stay open when this method is called.
      Parameters:
      level - The level of the notification
      title - The title of the notification
      message - The message of the notification
    • showNotification

      void showNotification(NotificationLevel level, String title, String message, Runnable callback)
      Show a notification to the user.
      The callback should be called when the user has received (and optionally closed) the notification.
      It is to be expected that the current popup will stay open when this method is called.
      Parameters:
      level - The level of the notification
      title - The title of the notification
      message - The message of the notification
      callback - The callback to call when the notification is received
    • closePopup

      void closePopup()
      Close the current popup window.
    • getMainWindow

      MainWindow getMainWindow()
      Get the instance of the main window.
      Returns:
      The main window
    • getAboutWindow

      AboutWindow getAboutWindow()
      Get the instance of the about window.
      Returns:
      The about window
    • getDiffWindow

      DiffWindow getDiffWindow()
      Get the instance of the diff window.
      Returns:
      The diff window
    • showWindow

      void showWindow(@Nonnull Window window)
      Open a window to draw it on the screen.
      This will close the current window if there is one.
      Parameters:
      window - The window to open
    • showOpenFileDialog

      @Nullable String showOpenFileDialog(String title)
      Show an open file dialog.
      Only one file should be selectable.
      Return null if the dialog was canceled.
      Parameters:
      title - The title of the dialog
      Returns:
      The path to the selected file
    • showSaveFileDialog

      @Nullable String showSaveFileDialog(String title)
      Show a save file dialog.
      Return null if the dialog was canceled.
      Parameters:
      title - The title of the dialog
      Returns:
      The path to the selected file
    • hasClipboard

      boolean hasClipboard()
      Returns:
      If the clipboard contains a tag
    • setClipboard

      void setClipboard(@Nonnull net.lenni0451.mcstructs.nbt.io.NamedTag tag)
      Set the clipboard to the given tag.
      Parameters:
      tag - The tag to copy
    • getClipboard

      @Nullable net.lenni0451.mcstructs.nbt.io.NamedTag getClipboard()
      Returns:
      The clipboard tag
    • exit

      void exit()
      Gets called when the File -> Exit menu item is clicked.