Package net.lenni0451.imnbt
Interface ImNbtDrawer
public interface ImNbtDrawer
-
Method Summary
Modifier and TypeMethodDescriptionvoidClose the current popup window.voidexit()Gets called when the File -> Exit menu item is clicked.Get the instance of the about window.net.lenni0451.mcstructs.nbt.io.NamedTagdefault ImNbtConfigGet the instance of the diff window.intGet the texture id for the tag icons.intGet 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 500Get the instance of the main window.booleanvoidOpen a popup window on the screen.
This will close the current popup if there is one.voidsetClipboard(net.lenni0451.mcstructs.nbt.io.NamedTag tag) Set the clipboard to the given tag.default voidshowNotification(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.voidshowNotification(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.showOpenFileDialog(String title) Show an open file dialog.
Only one file should be selectable.
Returnnullif the dialog was canceled.showSaveFileDialog(String title) Show a save file dialog.
Returnnullif the dialog was canceled.voidshowWindow(Window window) Open a window to draw it on the screen.
This will close the current window if there is one.
-
Method Details
-
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
Open a popup window on the screen.
This will close the current popup if there is one.- Parameters:
popup- The popup to open
-
showNotification
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 notificationtitle- The title of the notificationmessage- The message of the notification
-
showNotification
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 notificationtitle- The title of the notificationmessage- The message of the notificationcallback- 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
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
Show an open file dialog.
Only one file should be selectable.
Returnnullif the dialog was canceled.- Parameters:
title- The title of the dialog- Returns:
- The path to the selected file
-
showSaveFileDialog
Show a save file dialog.
Returnnullif 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.
-