Did some work on updater

This commit is contained in:
Gabriel Tofvesson 2016-10-29 21:35:28 +02:00
parent e1210440f4
commit 32273c5269
2 changed files with 33 additions and 4 deletions

View File

@ -2,7 +2,6 @@ package sample;
import javafx.application.Application; import javafx.application.Application;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.stage.Stage; import javafx.stage.Stage;
@ -16,18 +15,23 @@ public class Main extends Application {
public void start(Stage primaryStage) throws Exception{ public void start(Stage primaryStage) throws Exception{
primaryStage.initStyle(StageStyle.UNDECORATED); primaryStage.initStyle(StageStyle.UNDECORATED);
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml")); Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Team Avion Launcher [WIP]"); primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 900, 500)); primaryStage.setScene(new Scene(root, 900, 500));
primaryStage.show(); primaryStage.show();
primaryStage.maximizedProperty().addListener((observable, oldValue, newValue) -> { primaryStage.maximizedProperty().addListener((observable, oldValue, newValue) -> {
if (newValue) if (newValue)
primaryStage.setMaximized(false); primaryStage.setMaximized(false);
}); });
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close()); root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close()); // Close program if button is clicked
// Drag // Drag
root.lookup("#rectangle").setOnMouseDragged(event -> { root.lookup("#rectangle").setOnMouseDragged(event -> {
primaryStage.setX(event.getScreenX()+(event.getScreenX()-primaryStage.getX()));
primaryStage.setY(event.getScreenY()+(event.getScreenY()-primaryStage.getY()));
}); });
} }

View File

@ -0,0 +1,25 @@
package sample.net;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
/**
* Simple thing for updating launcher
*/
public class Updater {
private URLConnection conn;
private Updater(String URL) throws IOException {
conn = new URL(URL).openConnection();
}
public void downloadPorn(){
//TODO: Download lots of porn
}
public void downloadMorePorn(){
//TODO: Download more porn
}
}