Réorganisation du projet

julien
ZartaX0O3 4 years ago
parent b09fc7af18
commit 0e81d33751

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT" />
<option name="description" value="" />
</component>
</project>

2
code/.gitignore vendored

@ -6,7 +6,7 @@
# BlueJ files # BlueJ files
*.ctxt *.ctxt
/.idea
# Mobile Tools for Java (J2ME) # Mobile Tools for Java (J2ME)
.mtj.tmp/ .mtj.tmp/

@ -1,5 +1,4 @@
#player{ #player{
-fx-text-fill: #ffffff; -fx-text-fill: #ffffff;
} }

@ -8,20 +8,19 @@
<?import javafx.scene.shape.Circle?> <?import javafx.scene.shape.Circle?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<AnchorPane fx:id="mainRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" maxHeight="-Infinity" maxWidth="-Infinity" <AnchorPane fx:id="mainRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity" minHeight="-Infinity"
minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0"
xmlns="http://javafx.com/javafx/11" fx:controller="sample.MainPageController"> xmlns="http://javafx.com/javafx/11" fx:controller="controller.MainPageController">
<Circle layoutX="146.0" layoutY="138.0" opacity="0.42" radius="219.0" stroke="BLACK" strokeType="INSIDE"/>
<ImageView fitHeight="600.0" fitWidth="1300" layoutX="133.0" layoutY="150.0" pickOnBounds="true" preserveRatio="true" <ImageView fitHeight="600.0" fitWidth="1300" layoutX="133.0" layoutY="150.0" pickOnBounds="true" preserveRatio="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0"> AnchorPane.topAnchor="0.0">
<Image url="/fire.gif"/> <Image url="/image/plaine.gif"/>
</ImageView> </ImageView>
<Circle layoutX="146.0" layoutY="138.0" opacity="0.42" radius="219.0" stroke="BLACK" strokeType="INSIDE"/>
<ImageView fitHeight="205.0" fitWidth="204.0" layoutX="61.0" layoutY="-26.0" pickOnBounds="true" <ImageView fitHeight="205.0" fitWidth="204.0" layoutX="61.0" layoutY="-26.0" pickOnBounds="true"
preserveRatio="true"> preserveRatio="true">
<Image url="/logo.png"/> <Image url="/image/logo.png"/>
</ImageView> </ImageView>
<JFXButton layoutX="104.0" layoutY="163.0" prefHeight="30.0" prefWidth="119.0" <JFXButton layoutX="104.0" layoutY="163.0" prefHeight="30.0" prefWidth="119.0"
style="-fx-background-color: #EB9C0A;" text="New Game" textFill="WHITE" onMouseClicked="#startGame"> style="-fx-background-color: #EB9C0A;" text="New Game" textFill="WHITE" onMouseClicked="#startGame">

@ -10,16 +10,15 @@
<?import javafx.scene.shape.Rectangle?> <?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<?import java.net.URL?> <?import java.net.URL?>
<AnchorPane fx:id="levelRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" opacity="0.91" prefHeight="600.0"
prefWidth="800.0" <AnchorPane fx:id="levelRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" maxHeight="-Infinity" maxWidth="-Infinity"
xmlns="http://javafx.com/javafx/11" fx:controller="sample.TopPlayerController"> minHeight="-Infinity"
<stylesheets> minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0"
<URL value="@../css/anchor.css"/> xmlns="http://javafx.com/javafx/11" fx:controller="controller.TopPlayerController">
</stylesheets>
<ImageView fitHeight="600.0" fitWidth="1300" layoutX="133.0" layoutY="150.0" pickOnBounds="true" preserveRatio="true" <ImageView fitHeight="600.0" fitWidth="1300" layoutX="133.0" layoutY="150.0" pickOnBounds="true" preserveRatio="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0"> AnchorPane.topAnchor="0.0">
<Image url="/fire.gif"/> <Image url="/image/plaine.gif"/>
</ImageView> </ImageView>
<JFXButton onMouseClicked="#returnToMenu" layoutX="20.0" layoutY="10.0" prefHeight="30.0" prefWidth="80.0" <JFXButton onMouseClicked="#returnToMenu" layoutX="20.0" layoutY="10.0" prefHeight="30.0" prefWidth="80.0"
style="-fx-background-color: #EB9C0A;" style="-fx-background-color: #EB9C0A;"
@ -35,7 +34,7 @@
strokeType="INSIDE" width="500.0"/> strokeType="INSIDE" width="500.0"/>
<ImageView fitHeight="205.0" fitWidth="204.0" layoutX="350.0" layoutY="-4.0" pickOnBounds="true" <ImageView fitHeight="205.0" fitWidth="204.0" layoutX="350.0" layoutY="-4.0" pickOnBounds="true"
preserveRatio="true"> preserveRatio="true">
<Image url="/logo.png"/> <Image url="/image/logo.png"/>
</ImageView> </ImageView>
<Label layoutX="387.0" layoutY="168.0" text="Top Players"> <Label layoutX="387.0" layoutY="168.0" text="Top Players">
<font> <font>
@ -105,32 +104,32 @@
</LinearGradient> </LinearGradient>
</textFill> </textFill>
</Label> </Label>
<Label id="player" layoutX="395.0" layoutY="315.0" text="4 - ZartaX0O3"> <Label id="player" layoutX="395.0" layoutY="315.0" text="4 - ZartaX0O3" textFill="WHITE">
<font> <font>
<Font name="Segoe UI Black" size="17.0"/> <Font name="Segoe UI Black" size="17.0"/>
</font> </font>
</Label> </Label>
<Label id="player" layoutX="395.0" layoutY="382.0" text="6 - ZartaX0O3"> <Label id="player" layoutX="395.0" layoutY="382.0" text="6 - ZartaX0O3" textFill="WHITE">
<font> <font>
<Font name="Segoe UI Black" size="17.0"/> <Font name="Segoe UI Black" size="17.0"/>
</font> </font>
</Label> </Label>
<Label id="player" layoutX="395.0" layoutY="347.0" text="5 - ZartaX0O3"> <Label id="player" layoutX="395.0" layoutY="347.0" text="5 - ZartaX0O3" textFill="WHITE">
<font> <font>
<Font name="Segoe UI Black" size="17.0"/> <Font name="Segoe UI Black" size="17.0"/>
</font> </font>
</Label> </Label>
<Label id="player" layoutX="395.0" layoutY="417.0" text="7 - ZartaX0O3"> <Label id="player" layoutX="395.0" layoutY="417.0" text="7 - ZartaX0O3" textFill="WHITE">
<font> <font>
<Font name="Segoe UI Black" size="17.0"/> <Font name="Segoe UI Black" size="17.0"/>
</font> </font>
</Label> </Label>
<Label id="player" layoutX="395.0" layoutY="450.0" text="8 - ZartaX0O3"> <Label id="player" layoutX="395.0" layoutY="450.0" text="8 - ZartaX0O3" textFill="WHITE">
<font> <font>
<Font name="Segoe UI Black" size="17.0"/> <Font name="Segoe UI Black" size="17.0"/>
</font> </font>
</Label> </Label>
<Label id="player" layoutX="395.0" layoutY="486.0" text="9 - ZartaX0O3"> <Label id="player" layoutX="395.0" layoutY="486.0" text="9 - ZartaX0O3" textFill="WHITE">
<font> <font>
<Font name="Segoe UI Black" size="17.0"/> <Font name="Segoe UI Black" size="17.0"/>
</font> </font>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

@ -1,18 +1,14 @@
package sample; package controller;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent; import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.Objects; import java.util.Objects;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -45,7 +41,7 @@ public class MainPageController implements Initializable {
@FXML @FXML
void viewScore(MouseEvent event) throws Exception{ void viewScore(MouseEvent event) throws Exception{
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("TopPlayers.fxml"))); AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/TopPlayers.fxml")));
mainRoot.getChildren().setAll(pane); mainRoot.getChildren().setAll(pane);
} }

@ -1,18 +1,13 @@
package sample; package controller;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent; import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.Objects; import java.util.Objects;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -32,7 +27,7 @@ public class TopPlayerController implements Initializable {
@FXML @FXML
void returnToMenu(MouseEvent event) throws Exception{ void returnToMenu(MouseEvent event) throws Exception{
AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("MainPage.fxml"))); AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainPage.fxml")));
levelRoot.getChildren().setAll(pane); levelRoot.getChildren().setAll(pane);
} }

@ -1,21 +1,55 @@
package launcher; package launcher;
import model.Avatar; import javafx.application.Application;
import model.Case; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
public class Main { import javafx.scene.Scene;
public static void Main (String[] args) { import javafx.stage.Stage;
Case depart = new Case(1,10,10,true,false); import model.Database;
Avatar avatar1 = new Avatar(1,"Perso1.1.png",0,0);
int xdepart = depart.getCoordX(); import java.io.*;
avatar1.setCoordX(xdepart); import java.util.Objects;
int ydepart = depart.getCoordY();
avatar1.setCoordY(ydepart); public class Main extends Application {
int xavatar1 = avatar1.getCoordX();
int yavatar1 = avatar1.getCoordY(); private static Database currentd;
System.out.println("xavatar1 = " + xavatar1);
System.out.println("yavatar1 = " + yavatar1); @Override
System.out.println("xdepart = " + xdepart); public void start(Stage primaryStage) throws Exception{
System.out.println("ydepart = " + ydepart);
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/ConfigurationMenu.fxml")));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 900, 600));
primaryStage.setResizable(false);
primaryStage.show();
}
public static Database getDatabase(){
return currentd;
}
public static void serialize() throws IOException {
try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("database.txt"))) {
out.writeObject(currentd);
} finally {
//System.out.println("Saved!");
System.exit(0);
}
}
public static void deserialize() throws ClassNotFoundException, IOException{
ObjectInputStream in = null;
try {
in=new ObjectInputStream (new FileInputStream("database.txt"));
currentd=(Database) in.readObject();
in.close();
}
catch (FileNotFoundException | NullPointerException e){
currentd=new Database();
}
}
public static void main(String[] args) {
launch(args);
} }
} }

@ -1,14 +1,9 @@
package sample; package model;
import javafx.scene.layout.Pane; import launcher.Main;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
public class DataTable implements Serializable { public class DataTable implements Serializable {
private static int id=0; private static int id=0;

@ -1,4 +1,4 @@
package sample; package model;
import java.io.*; import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.*?>
<?import javafx.scene.effect.Shadow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.*?>
<?import java.net.URL?>
<AnchorPane fx:id="levelRoot" xmlns:fx="http://javafx.com/fxml/1" id="pane" maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity"
minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0"
xmlns="http://javafx.com/javafx/11" fx:controller="controller.TopPlayerController">
<ImageView fitHeight="600.0" fitWidth="1300" layoutX="133.0" layoutY="150.0" pickOnBounds="true" preserveRatio="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<Image url="/image/plaine.gif"/>
</ImageView>
<Rectangle arcHeight="5.0" arcWidth="5.0" height="600.0" layoutX="50" opacity="0.42" stroke="BLACK"
strokeType="INSIDE" width="800.0"/>
</AnchorPane>
Loading…
Cancel
Save