commit
43e497f9e6
@ -1,4 +1,4 @@
|
|||||||
package sample;
|
package Launcher;
|
||||||
|
|
||||||
public class Controller {
|
public class Controller {
|
||||||
}
|
}
|
46
src/Launcher/Main.java
Normal file
46
src/Launcher/Main.java
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package Launcher;
|
||||||
|
|
||||||
|
import javafx.application.Application;
|
||||||
|
import javafx.beans.property.ReadOnlyBooleanProperty;
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Parent;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
import javafx.stage.StageStyle;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
public class Main extends Application {
|
||||||
|
|
||||||
|
private double xOffset = 0;
|
||||||
|
private double yOffset = 0;
|
||||||
|
|
||||||
|
volatile double[] posOrigin = {0, 0};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start(Stage primaryStage) throws Exception{
|
||||||
|
|
||||||
|
primaryStage.initStyle(StageStyle.UNDECORATED);
|
||||||
|
Parent root = FXMLLoader.load(getClass().getResource("Main_Launcher.fxml"));
|
||||||
|
primaryStage.setTitle("Team-Avion Launcher [WIP]");
|
||||||
|
primaryStage.setScene(new Scene(root, 900, 500));
|
||||||
|
primaryStage.show();
|
||||||
|
|
||||||
|
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close());
|
||||||
|
root.lookup("#min").setOnMouseClicked(event -> primaryStage.setIconified(true));
|
||||||
|
|
||||||
|
// Drag
|
||||||
|
root.lookup("#rectangle").setOnMousePressed(event -> {
|
||||||
|
xOffset = event.getSceneX();
|
||||||
|
yOffset = event.getSceneY();
|
||||||
|
});
|
||||||
|
|
||||||
|
root.lookup("#rectangle").setOnMouseDragged(event -> {
|
||||||
|
primaryStage.setX(event.getScreenX() - xOffset);
|
||||||
|
primaryStage.setY(event.getScreenY() - yOffset);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
|
}
|
20
src/Launcher/Main_Launcher.fxml
Normal file
20
src/Launcher/Main_Launcher.fxml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
<?import javafx.scene.shape.Rectangle?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<Pane id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500" prefWidth="900" stylesheets="@../assets/style/nav.css" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<Rectangle id="rectangle" arcHeight="5.0" arcWidth="5.0" fill="white" height="50.0" strokeType="INSIDE" width="900.0" />
|
||||||
|
<Button id="exit" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="862.0" layoutY="13.0" mnemonicParsing="false" stylesheets="@../assets/style/nav.css" text="X" textFill="WHITE" />
|
||||||
|
<Button id="min" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="841.0" layoutY="13.0" mnemonicParsing="false" stylesheets="@../assets/style/nav.css" text="-" textFill="WHITE" />
|
||||||
|
<Label layoutX="46.0" layoutY="11.0" text="Team-Avion Launcher" textFill="WHITE">
|
||||||
|
<font>
|
||||||
|
<Font name="Centaur" size="24.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
</Pane>
|
35
src/Launcher/net/Updater.java
Normal file
35
src/Launcher/net/Updater.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package Launcher.net;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple thing for updating launcher
|
||||||
|
*/
|
||||||
|
public class Updater {
|
||||||
|
|
||||||
|
private static Updater instance;
|
||||||
|
private URLConnection conn;
|
||||||
|
|
||||||
|
private Updater(String URL) throws IOException {
|
||||||
|
conn = new URL(URL).openConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void download(){
|
||||||
|
//TODO: Download lots of
|
||||||
|
}
|
||||||
|
|
||||||
|
public void downloadMore(){
|
||||||
|
//TODO: Download more
|
||||||
|
}
|
||||||
|
|
||||||
|
public void downloadEvenMore(){
|
||||||
|
//TODO: Download even more
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Updater getInstance(String url) throws IOException {
|
||||||
|
if(instance==null) instance = new Updater(url);
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
23
src/Launcher/sample.fxml
Normal file
23
src/Launcher/sample.fxml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.Hyperlink?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
<?import javafx.scene.shape.Rectangle?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<Pane id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500" prefWidth="900" style="-fx-background-color: rgb(42, 44, 58);" xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<Rectangle id="rectangle" arcHeight="5.0" arcWidth="5.0" fill="white" height="50.0" strokeType="INSIDE" style="-fx-fill: rgb(29, 31, 48);" width="900.0" />
|
||||||
|
<Button id="exit" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="862.0" layoutY="13.0" mnemonicParsing="false" style="-fx-background-color: rgb(29, 31, 48);" stylesheets="@../assets/style/nav.css" text="X" textFill="WHITE" />
|
||||||
|
<Label layoutX="46.0" layoutY="11.0" text="Team Avion Launcher" textFill="WHITE">
|
||||||
|
<font>
|
||||||
|
<Font name="Centaur" size="24.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#e4e4e4" height="450.0" layoutX="-1.0" layoutY="50.0" strokeType="INSIDE" style="-fx-fill: rgb(29, 31, 48);" width="145.0" />
|
||||||
|
<Hyperlink id="hyperlink" layoutX="26.0" layoutY="66.0" text="Our Modpacks" />
|
||||||
|
<Hyperlink layoutX="26.0" layoutY="102.0" text="Settings" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
@ -1,3 +0,0 @@
|
|||||||
#exit{
|
|
||||||
-fx-background-color: rgba(255, 0, 255, 0.5);
|
|
||||||
}
|
|
20
src/assets/style/nav.css
Normal file
20
src/assets/style/nav.css
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#pane {
|
||||||
|
-fx-background-color: rgba(38, 33, 33, 1)
|
||||||
|
}
|
||||||
|
#rectangle {
|
||||||
|
-fx-fill: rgba(30, 25, 25, 1)
|
||||||
|
}
|
||||||
|
#exit{
|
||||||
|
-fx-background-color: rgba(30, 25, 25, 1);
|
||||||
|
}
|
||||||
|
#min {
|
||||||
|
-fx-background-color: rgba(30, 25, 25, 1);
|
||||||
|
}
|
||||||
|
#min:hover {
|
||||||
|
-fx-border-radius: 30px;
|
||||||
|
-fx-background-color: #bf0000;
|
||||||
|
}
|
||||||
|
#exit:hover{
|
||||||
|
-fx-border-radius: 30px;
|
||||||
|
-fx-background-color: #bf0000;
|
||||||
|
}
|
@ -1,24 +0,0 @@
|
|||||||
package sample;
|
|
||||||
|
|
||||||
import javafx.application.Application;
|
|
||||||
import javafx.fxml.FXMLLoader;
|
|
||||||
import javafx.scene.Parent;
|
|
||||||
import javafx.scene.Scene;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import javafx.stage.StageStyle;
|
|
||||||
|
|
||||||
public class Main extends Application {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void start(Stage primaryStage) throws Exception{
|
|
||||||
primaryStage.initStyle(StageStyle.UNDECORATED);
|
|
||||||
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
|
|
||||||
primaryStage.setTitle("Hello World");
|
|
||||||
primaryStage.setScene(new Scene(root, 900, 500));
|
|
||||||
primaryStage.show();
|
|
||||||
root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close());
|
|
||||||
}
|
|
||||||
public static void main(String[] args) {
|
|
||||||
launch(args);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<?import javafx.scene.control.Button?>
|
|
||||||
<?import javafx.scene.layout.Pane?>
|
|
||||||
|
|
||||||
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1">
|
|
||||||
<children>
|
|
||||||
<Button id="exit" fx:id="pepe" alignment="TOP_RIGHT" contentDisplay="RIGHT" mnemonicParsing="false" stylesheets="@../assets/nav.css" text="Click if you like Pepe" />
|
|
||||||
</children>
|
|
||||||
</Pane>
|
|
Loading…
x
Reference in New Issue
Block a user