mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 13:06:30 +02:00
Commit WIP code
This commit is contained in:
parent
197951162e
commit
abc6e321e0
19
build.gradle
19
build.gradle
@ -1,24 +1,11 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java-library'
|
||||||
id 'application'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Use JUnit test framework
|
//testImplementation 'junit:junit:4.12'
|
||||||
testImplementation 'junit:junit:4.12'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In this section you declare where to find the dependencies of your project
|
|
||||||
repositories {
|
repositories {
|
||||||
// Use jcenter for resolving your dependencies.
|
|
||||||
// You can declare any Maven/Ivy/file repository here.
|
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
|
||||||
manifest {
|
|
||||||
attributes 'Main-Class': 'link.infra.packwiz.launcher.Main'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mainClassName = 'link.infra.packwiz.launcher.Main'
|
|
@ -1,19 +1,27 @@
|
|||||||
package link.infra.packwiz.launcher;
|
package link.infra.packwiz.launcher;
|
||||||
|
|
||||||
import java.awt.EventQueue;
|
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.UIManager;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import javax.swing.JProgressBar;
|
import java.awt.Component;
|
||||||
|
import java.awt.EventQueue;
|
||||||
|
import java.awt.GridBagConstraints;
|
||||||
|
import java.awt.GridBagLayout;
|
||||||
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JProgressBar;
|
||||||
|
import javax.swing.UIManager;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
|
// TODO: move to seperate file, make usable without GUI
|
||||||
|
|
||||||
private JFrame frmPackwizlauncher;
|
private JFrame frmPackwizlauncher;
|
||||||
|
private UpdateManager updateManager = new UpdateManager();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch the application.
|
* Launch the application.
|
||||||
@ -44,9 +52,10 @@ public class Main {
|
|||||||
*/
|
*/
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
frmPackwizlauncher = new JFrame();
|
frmPackwizlauncher = new JFrame();
|
||||||
frmPackwizlauncher.setTitle("packwiz-launcher");
|
frmPackwizlauncher.setTitle("Updating modpack...");
|
||||||
frmPackwizlauncher.setBounds(100, 100, 450, 87);
|
frmPackwizlauncher.setBounds(100, 100, 493, 95);
|
||||||
frmPackwizlauncher.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frmPackwizlauncher.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
frmPackwizlauncher.setLocationRelativeTo(null);
|
||||||
|
|
||||||
JPanel panel = new JPanel();
|
JPanel panel = new JPanel();
|
||||||
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
|
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||||
@ -55,16 +64,36 @@ public class Main {
|
|||||||
|
|
||||||
JProgressBar progressBar = new JProgressBar();
|
JProgressBar progressBar = new JProgressBar();
|
||||||
progressBar.setValue(50);
|
progressBar.setValue(50);
|
||||||
panel.add(progressBar, BorderLayout.NORTH);
|
panel.add(progressBar, BorderLayout.CENTER);
|
||||||
|
|
||||||
JLabel lblProgresslabel = new JLabel("Loading...");
|
JLabel lblProgresslabel = new JLabel("Loading...");
|
||||||
panel.add(lblProgresslabel, BorderLayout.SOUTH);
|
panel.add(lblProgresslabel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
JPanel panel_1 = new JPanel();
|
JPanel panel_1 = new JPanel();
|
||||||
|
panel_1.setBorder(new EmptyBorder(0, 5, 0, 5));
|
||||||
frmPackwizlauncher.getContentPane().add(panel_1, BorderLayout.EAST);
|
frmPackwizlauncher.getContentPane().add(panel_1, BorderLayout.EAST);
|
||||||
|
GridBagLayout gbl_panel_1 = new GridBagLayout();
|
||||||
|
panel_1.setLayout(gbl_panel_1);
|
||||||
|
|
||||||
JButton btnOptions = new JButton("Options...");
|
JButton btnOptions = new JButton("Options...");
|
||||||
panel_1.add(btnOptions);
|
btnOptions.setAlignmentX(Component.CENTER_ALIGNMENT);
|
||||||
|
GridBagConstraints gbc_btnOptions = new GridBagConstraints();
|
||||||
|
gbc_btnOptions.gridx = 0;
|
||||||
|
gbc_btnOptions.gridy = 0;
|
||||||
|
panel_1.add(btnOptions, gbc_btnOptions);
|
||||||
|
|
||||||
|
JButton btnCancel = new JButton("Cancel");
|
||||||
|
btnCancel.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
|
updateManager.cleanup();
|
||||||
|
frmPackwizlauncher.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
btnCancel.setAlignmentX(Component.CENTER_ALIGNMENT);
|
||||||
|
GridBagConstraints gbc_btnCancel = new GridBagConstraints();
|
||||||
|
gbc_btnCancel.gridx = 0;
|
||||||
|
gbc_btnCancel.gridy = 1;
|
||||||
|
panel_1.add(btnCancel, gbc_btnCancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package link.infra.packwiz.launcher;
|
||||||
|
|
||||||
|
public class UpdateManager {
|
||||||
|
Thread updateThread = new Thread(new UpdateThread());
|
||||||
|
|
||||||
|
public void cleanup() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
10
src/main/java/link/infra/packwiz/launcher/UpdateThread.java
Normal file
10
src/main/java/link/infra/packwiz/launcher/UpdateThread.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package link.infra.packwiz.launcher;
|
||||||
|
|
||||||
|
public class UpdateThread implements Runnable {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user