Package net.lenni0451.imnbt.ui.windows
Class MainWindow
java.lang.Object
net.lenni0451.imnbt.ui.types.Window
net.lenni0451.imnbt.ui.windows.MainWindow
The main window of ImNbt.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMainWindow(ImNbtDrawer drawer, FontHandler fontHandler) Create a new main window.
The font handler is required when using the font size menu. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddragAndDrop(File file, byte[] data) Handle a file being dropped on the window.net.lenni0451.mcstructs.nbt.NbtTagnet.lenni0451.mcstructs.nbt.NbtTag[]getTabs()voidHighlight the search box.voidvoidredo()Redo the last undone action.
If no action can be redone nothing will happen.voidrender()Render the window content.voidSave the currently open tab.
If the file has a path associated with it, it will be saved to that path.
If the file has no path associated with it, a save dialog will be opened.
If no tab is open or the current tag is not modified nothing will happen.voidsaveFile()voidundo()Undo the last action.
If no action can be undone nothing will happen.
-
Constructor Details
-
MainWindow
Create a new main window.
The font handler is required when using the font size menu. If you don't want to use it you can pass null.- Parameters:
drawer- The drawer instancefontHandler- The font handler to use
-
-
Method Details
-
getOpenTab
@Nullable public net.lenni0451.mcstructs.nbt.NbtTag getOpenTab()- Returns:
- The tag of the currently open tab
-
getTabs
public net.lenni0451.mcstructs.nbt.NbtTag[] getTabs()- Returns:
- The tags of all tabs
-
highlightSearch
public void highlightSearch()Highlight the search box. -
undo
public void undo()Undo the last action.
If no action can be undone nothing will happen. -
redo
public void redo()Redo the last undone action.
If no action can be redone nothing will happen. -
saveCurrent
public void saveCurrent()Save the currently open tab.
If the file has a path associated with it, it will be saved to that path.
If the file has no path associated with it, a save dialog will be opened.
If no tab is open or the current tag is not modified nothing will happen. -
render
public void render()Description copied from class:WindowRender the window content. -
chooseFile
public void chooseFile() -
dragAndDrop
Description copied from class:WindowHandle a file being dropped on the window.- Overrides:
dragAndDropin classWindow- Parameters:
file- The file that was droppeddata- The raw data of the file
-
open
-
saveFile
public void saveFile()
-