Skip to content
Snippets Groups Projects
Commit ed6f364c authored by Puissegur Alexis's avatar Puissegur Alexis
Browse files

merge

parents 9962c01f 93c45de6
No related branches found
No related tags found
No related merge requests found
File added
...@@ -30,13 +30,15 @@ dist.javadoc.dir=${dist.dir}/javadoc ...@@ -30,13 +30,15 @@ dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath= endorsed.classpath=
excludes= excludes=
file.reference.bluecove-2.1.1-SNAPSHOT.jar=bluecove-2.1.1-SNAPSHOT.jar file.reference.bluecove-2.1.1-SNAPSHOT.jar=bluecove-2.1.1-SNAPSHOT.jar
file.reference.javax.mail-api-1.4.7.jar=javax.mail-api-1.4.7.jar
includes=** includes=**
# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects # Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
jar.archive.disabled=true jar.archive.disabled=true
jar.compress=false jar.compress=false
javac.classpath=\ javac.classpath=\
${javafx.classpath.extension}:\ ${javafx.classpath.extension}:\
${file.reference.bluecove-2.1.1-SNAPSHOT.jar} ${file.reference.bluecove-2.1.1-SNAPSHOT.jar}:\
${file.reference.javax.mail-api-1.4.7.jar}
# Space-separated list of extra javac options # Space-separated list of extra javac options
javac.compilerargs= javac.compilerargs=
javac.deprecation=false javac.deprecation=false
......
...@@ -39,6 +39,7 @@ public class BluetoothThread extends Thread { ...@@ -39,6 +39,7 @@ public class BluetoothThread extends Thread {
connection.getInputStream().read(payload); connection.getInputStream().read(payload);
this.buffer = new String(payload, StandardCharsets.UTF_8); this.buffer = new String(payload, StandardCharsets.UTF_8);
notifyObserver(); notifyObserver();
} catch (Exception e) { } catch (Exception e) {
System.out.println("Could not read stream" + e); System.out.println("Could not read stream" + e);
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<?import javafx.scene.layout.GridPane?> <?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="350.0" prefWidth="440.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Vue.FXMLVueController"> <GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="350.0" prefWidth="440.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Vue.FXMLVueController">
...@@ -123,9 +124,10 @@ ...@@ -123,9 +124,10 @@
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="60.0" minHeight="10.0" prefHeight="60.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="63.0" minHeight="10.0" prefHeight="63.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="61.0" minHeight="2.333343505859375" prefHeight="44.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="92.0" minHeight="0.0" prefHeight="31.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="135.66665649414062" minHeight="10.0" prefHeight="105.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="135.66665649414062" minHeight="0.0" prefHeight="48.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="135.66665649414062" minHeight="10.0" prefHeight="105.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<children> <children>
<HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" spacing="10.0"> <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" spacing="10.0">
...@@ -153,9 +155,18 @@ ...@@ -153,9 +155,18 @@
<Font size="14.0" /> <Font size="14.0" />
</font> </font>
</Label> </Label>
<CheckBox fx:id="arrosageAuto" mnemonicParsing="false" onAction="#clickAuto" text="Désactivé" /> <CheckBox fx:id="arrosageAuto" mnemonicParsing="false" onAction="#clickAuto" prefHeight="22.0" prefWidth="81.0" text="Désactivé" />
</children> </children>
</HBox> </HBox>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="10.0" GridPane.halignment="CENTER" GridPane.rowIndex="3" GridPane.valignment="CENTER">
<children>
<Button fx:id="buttonBluetooth" mnemonicParsing="false" onAction="#clickActivationBluetooth" text="Activation bluetooth" />
<Label fx:id="activationMessage" text="Connection bluetooth désactivée" />
</children>
<GridPane.margin>
<Insets bottom="10.0" top="10.0" />
</GridPane.margin>
</VBox>
</children> </children>
<GridPane.margin> <GridPane.margin>
<Insets left="10.0" right="10.0" /> <Insets left="10.0" right="10.0" />
......
...@@ -62,24 +62,20 @@ public class FXMLVueController implements Initializable { ...@@ -62,24 +62,20 @@ public class FXMLVueController implements Initializable {
private Button buttonAccueil; private Button buttonAccueil;
@FXML @FXML
private Button buttonConfig; private Button buttonConfig;
@FXML
private Button buttonBluetooth;
@FXML
private Label activationMessage;
private boolean isConnected = false; private boolean isConnected = false;
private BluetoothManager bluetoothManager;
/** /**
* Initializes the controller class. * Initializes the controller class.
*/ */
@Override @Override
public void initialize(URL url, ResourceBundle rb) { public void initialize(URL url, ResourceBundle rb) {
bluetoothManager = new BluetoothManager(this);
/**
BluetoothManager bluetoothManager = new BluetoothManager(this);
bluetoothManager.launch();
try {
bluetoothManager.startThread();
} catch (Exception ex) {
Logger.getLogger(FXMLVueController.class.getName()).log(Level.SEVERE, null, ex);
}
**/
//Put the gridPane Accueil visible //Put the gridPane Accueil visible
accueil.setVisible(true); accueil.setVisible(true);
...@@ -144,6 +140,25 @@ public class FXMLVueController implements Initializable { ...@@ -144,6 +140,25 @@ public class FXMLVueController implements Initializable {
} }
else arrosageAuto.setText("Désactivé"); else arrosageAuto.setText("Désactivé");
} }
@FXML
private void clickActivationBluetooth(ActionEvent event) {
if(!this.isConnected){
isConnected = bluetoothManager.launch();
}
if(isConnected){
try {
bluetoothManager.startThread();
this.activationMessage.setText("Connection bluetooth activée");
this.buttonBluetooth.setDisable(true);
} catch (Exception ex) {
Logger.getLogger(FXMLVueController.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
public void update(BluetoothThread t){ public void update(BluetoothThread t){
// MAJ LA VUE // MAJ LA VUE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment