This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Event listeners but still facing async issues & Removed redundant cod…
…e areas # TODO - fix broken async logic - improve event listeners - Many buggy features to fix Signed-off-by: zhaoxinn <[email protected]>
- Loading branch information
Showing
13 changed files
with
101 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
import lombok.Getter; | ||
|
||
import java.util.EventListener; | ||
import java.util.EventObject; | ||
|
||
@Getter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
import lombok.Getter; | ||
|
||
import java.util.EventListener; | ||
import java.util.EventObject; | ||
|
||
@Getter | ||
|
4 changes: 0 additions & 4 deletions
4
src/main/java/com/zxzinn/novelai/generation/GenerationStrategy.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package com.zxzinn.novelai.gui; | ||
|
||
import com.zxzinn.novelai.config.ConfigManager; | ||
import com.zxzinn.novelai.gui.filewindow.FileManagerTab; | ||
import com.zxzinn.novelai.gui.generation.GenerationGUI; | ||
import com.zxzinn.novelai.utils.I18nManager; | ||
import com.zxzinn.novelai.utils.UIComponent; | ||
import lombok.extern.log4j.Log4j2; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.WindowAdapter; | ||
import java.awt.event.WindowEvent; | ||
|
||
@Log4j2 | ||
public class ContainerGUI extends JFrame implements UIComponent { | ||
private static final ConfigManager config = ConfigManager.getInstance(); | ||
public static final int WINDOW_WIDTH = config.getInteger("ui.window.width"); | ||
public static final int WINDOW_HEIGHT = config.getInteger("ui.window.height"); | ||
|
||
private JTabbedPane mainTabbedPane; | ||
private GenerationGUI generationGUI; | ||
private FileManagerTab fileManagerTab; | ||
|
||
public ContainerGUI() { | ||
setTitle(config.getString("application.name") + " v" + config.getString("application.version")); | ||
setSize(WINDOW_WIDTH, WINDOW_HEIGHT); | ||
setLocationRelativeTo(null); | ||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
|
||
initializeComponents(); | ||
layoutComponents(); | ||
bindEvents(); | ||
setupWindowListener(); | ||
|
||
log.info("ContainerGUI initialized"); | ||
} | ||
|
||
@Override | ||
public void initializeComponents() { | ||
mainTabbedPane = new JTabbedPane(); | ||
generationGUI = new GenerationGUI(); | ||
fileManagerTab = new FileManagerTab(); | ||
} | ||
|
||
@Override | ||
public void layoutComponents() { | ||
setLayout(new BorderLayout()); | ||
mainTabbedPane.addTab(I18nManager.getString("tab.generator"), generationGUI); | ||
mainTabbedPane.addTab(I18nManager.getString("tab.fileManager"), fileManagerTab); | ||
add(mainTabbedPane, BorderLayout.CENTER); | ||
} | ||
|
||
@Override | ||
public void bindEvents() { | ||
} | ||
|
||
private void setupWindowListener() { | ||
addWindowListener(new WindowAdapter() { | ||
@Override | ||
public void windowClosing(WindowEvent e) { | ||
log.info("Application closing"); | ||
saveAllCache(); | ||
fileManagerTab.shutdownFileWatcher(); | ||
generationGUI.shutdown(); | ||
log.info("Application closed"); | ||
} | ||
}); | ||
} | ||
|
||
private void saveAllCache() { | ||
generationGUI.saveAllCache(); | ||
fileManagerTab.saveWatchedFolders(); | ||
log.info("Cache saved"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.