finished new database system... FINALLY

This commit is contained in:
potzplitz 2024-03-25 22:23:59 +01:00
parent 295f5ad96c
commit 03d0a57671
4 changed files with 36 additions and 34 deletions

View file

@ -19,7 +19,7 @@ public class LoadMenu {
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
load.setMinimum(0);
load.setMaximum(6);
load.setMaximum(7);
load.setBounds(1, 178, 398, 20);

View file

@ -21,40 +21,7 @@ public class SettingsGui {
settings.setSize(500, 500);
settings.setVisible(true);
Button button = new Button("Daten auf neues System migrieren");
button.setBounds(20, 20, 200, 30);
Button save = new Button("speichern");
save.setBounds(430, 230, 100, 30);
save.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
WriteSettings write = new WriteSettings();
try {
write.write();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
MigrateData migrate = new MigrateData();
migrate.migrateData();
}
});
settings.add(button);
settings.add(save);
}
}

View file

@ -10,6 +10,7 @@ import data.ManageFiles;
import database.DatabaseManager;
import filestructure.CreateFileStructure;
import gui.LoadMenu;
import preload.PreChecks;
import settingsfunctions.LoadSettings;
public class Main {
@ -34,6 +35,11 @@ public class Main {
FetchData fetch = new FetchData();
fetch.getGithubString();
load.updateBar("Daten werden überprüft...");
PreChecks check = new PreChecks();
check.check();
load.updateBar("Einträge werden Indexiert...");
ManageFiles manager = new ManageFiles();

View file

@ -0,0 +1,29 @@
package preload;
import java.io.File;
import javax.swing.JOptionPane;
import data.FetchData;
import data.ManageFiles;
import settingsfunctions.MigrateData;
public class PreChecks {
public void check() {
File file = new File("C:\\ExtremeDemonList\\levels");
File[] list = file.listFiles();
FetchData data = new FetchData();
System.out.println(data.allLevels().size() - 10);
System.out.println(list.length);
if(list.length >= data.allLevels().size() - 10) {
JOptionPane.showMessageDialog(null, "Deine Daten wurden noch nicht migriert. Dies erfolgt nun und kann etwas Zeit in Anspruch nehmen. Die Liste startet sich danach automatisch.", "Migration", JOptionPane.INFORMATION_MESSAGE);
MigrateData migration = new MigrateData();
migration.migrateData();
}
}
}