diff --git a/Makefile b/Makefile index 300e4db284195cf55d46092887a5765d256e84f5..003e6a6a272c78162f4566cdca515fc4f610f747 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ testmemorycheck : $(TEST) $(ODIR)/%.o : $(SDIR)/%.c $(DEP) $(CC) $(FLAGS) -o $@ $< -$(ODIR)/application_Scheduling.o : $(SDIR)/application_Scheduling.c $(DEP) +$(ODIR)/Scheduling.o : $(SDIR)/Scheduling.c $(DEP) $(CC) $(FLAGS) $(JINCLUDES) -o $@ $< $(PROG) : $(OBJ) $(ODIR)/main.o diff --git a/include/Scheduling.h b/include/Scheduling.h new file mode 100644 index 0000000000000000000000000000000000000000..8809de049832f2e4129de9ed3b7de9901d8f7490 --- /dev/null +++ b/include/Scheduling.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class Scheduling */ + +#ifndef _Included_Scheduling +#define _Included_Scheduling +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: Scheduling + * Method: runSchedule + * Signature: (Ljava/lang/String;Ljava/lang/String;III)V + */ +JNIEXPORT void JNICALL Java_Scheduling_runSchedule + (JNIEnv *, jclass, jstring, jstring, jint, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/java/application/App.java b/java/application/App.java index 6aebc1d26df42c37055ded181605bfeca08cce8d..044feded483d9de135d5e1ee1d3701d9e875a87d 100644 --- a/java/application/App.java +++ b/java/application/App.java @@ -1,6 +1,9 @@ +import java.io.IOException; + import javafx.application.Application; +import javafx.fxml.FXMLLoader; import javafx.scene.Scene; -import javafx.scene.layout.StackPane; +import javafx.scene.control.SplitPane; import javafx.stage.Stage; public class App extends Application { @@ -10,9 +13,15 @@ public class App extends Application { @Override public void start(Stage primaryStage) throws Exception { - StackPane root = new StackPane(); - primaryStage.setTitle("Hello World"); - primaryStage.setScene(new Scene(root, 800, 600)); - primaryStage.show(); + try { + SplitPane root = FXMLLoader.load(getClass().getResource("resources/ProjetView.fxml")); + primaryStage.setTitle("Hello World"); + primaryStage.setScene(new Scene(root, 800, 600)); + primaryStage.show(); + } + catch (IOException e) + { + System.err.println("FXML indisponible."); + } } } diff --git a/java/application/Scheduling.java b/java/application/Scheduling.java new file mode 100644 index 0000000000000000000000000000000000000000..b92b4d18be33e1f301d224ac25e778446f57b201 --- /dev/null +++ b/java/application/Scheduling.java @@ -0,0 +1,5 @@ +public class Scheduling { + + public static native void runSchedule(String instanceInFile, String scheduleOutFile, int m, int preemption, int balanced); + +} diff --git a/java/bin/App.class b/java/bin/App.class index 8a8f1bb7264cf9255ed4fd5f89b037f3a2818016..85d39015b0d6e7806c05b76d73db4e8db4f6fbb0 100644 Binary files a/java/bin/App.class and b/java/bin/App.class differ diff --git a/java/bin/Scheduling.class b/java/bin/Scheduling.class new file mode 100644 index 0000000000000000000000000000000000000000..9e872064c688ae13b0f7e44c3aaa7677c80a8ead Binary files /dev/null and b/java/bin/Scheduling.class differ diff --git a/java/resources/ProjetView.fxml b/java/resources/ProjetView.fxml new file mode 100644 index 0000000000000000000000000000000000000000..46ba8d1d5f831fda1b7c1ac605d32b021a7fd57d --- /dev/null +++ b/java/resources/ProjetView.fxml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.geometry.Insets?> +<?import javafx.scene.canvas.Canvas?> +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.CheckBox?> +<?import javafx.scene.control.Separator?> +<?import javafx.scene.control.Spinner?> +<?import javafx.scene.control.SplitPane?> +<?import javafx.scene.control.TextField?> +<?import javafx.scene.layout.AnchorPane?> +<?import javafx.scene.layout.BorderPane?> +<?import javafx.scene.layout.Pane?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.text.Text?> + +<SplitPane dividerPositions="0.29797979797979796" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/19"> + <items> + <AnchorPane maxWidth="-Infinity" minHeight="0.0" minWidth="172.0" prefHeight="160.0" prefWidth="172.0"> + <children> + <VBox prefHeight="398.4" prefWidth="175.2" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <padding> + <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> + </padding> + <children> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="File path:" /> + <TextField fx:id="_filename" promptText="Scheduling instance file" /> + <Separator prefWidth="200.0" /> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Machine count:" /> + <Spinner fx:id="_machineCount" editable="true" /> + <Separator prefWidth="200.0" /> + <CheckBox fx:id="_balanced" mnemonicParsing="false" selected="true" text="Use balanced trees" /> + <CheckBox fx:id="_preemptive" mnemonicParsing="false" text="Use SRPT over SPT" /> + <Pane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="0.0" prefWidth="0.0" VBox.vgrow="ALWAYS" /> + <Button alignment="BOTTOM_CENTER" defaultButton="true" mnemonicParsing="false" onAction="#submitToDiagram" text="Display and Save" /> + </children> + </VBox> + </children></AnchorPane> + <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> + <children> + <BorderPane prefHeight="398.4" prefWidth="417.6" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <center> + <Canvas fx:id="_canvas" height="380.0" width="400.0" BorderPane.alignment="CENTER" /> + </center> + </BorderPane> + </children></AnchorPane> + </items> +</SplitPane> diff --git a/src/Scheduling.c b/src/Scheduling.c new file mode 100644 index 0000000000000000000000000000000000000000..8767d77354c48b65b990cc4969d185305553d45d --- /dev/null +++ b/src/Scheduling.c @@ -0,0 +1,9 @@ +#include <jni.h> +#include "schedule.h" +#include "Scheduling.h" + +JNIEXPORT void JNICALL Java_Scheduling_runSchedule + (JNIEnv * env, jclass , jstring, jstring, jint, jint, jint) +{ + //const char * mystring = (* env )->GetStringUTFChars(env, s, NULL); +} diff --git a/src/application_Scheduling.c b/src/application_Scheduling.c deleted file mode 100644 index 43f1e5b7b9258cc24a95b7c15ac8c448766600e0..0000000000000000000000000000000000000000 --- a/src/application_Scheduling.c +++ /dev/null @@ -1,4 +0,0 @@ -#include <jni.h> -#include "schedule.h" - -